patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate

Svante Signell svante.signell@gmail.com
Wed May 21 07:47:00 GMT 2014


On Wed, 2014-05-21 at 01:27 +0200, Samuel Thibault wrote:
> Svante Signell, le Fri 16 May 2014 10:03:05 +0200, a écrit :
> > is used in gcc-4.9-4.9.0/src/libgo/go/net/fd_unix.go:
> > func dupCloseOnExec(fd int) (newfd int, err error) {
> > if atomic.LoadInt32(&tryDupCloexec) == 1 && syscall.F_DUPFD_CLOEXEC!=0 {
> > r0, _, e1 := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd),
> > syscall.F_DUPFD_CLOEXEC, 0)
> 
> That code can not work as it is, fcntl is not a system call on
> GNU/Hurd. Why isn't gccgo just using the C fcntl function?  That one
> will just work and be portable.

I don't know, I'm not a go developer. Ask Ian.

> > +# Special treatment of EWOULDBLOCK for GNU/Hurd
> > +# /usr/include/bits/errno.h: #define EWOULDBLOCK EAGAIN
> > +if egrep 'define EWOULDBLOCK EAGAIN' gen-sysinfo.go > /dev/null 2>&1; then
> > +  egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)' ${OUT} | \
> > +    sed -i.bak -e 's/_EWOULDBLOCK/_EAGAIN/' ${OUT}
> 
> I don't understand why you both pass the output of egrep to sed, and you
> give the -i option to sed. AIUI, the
> egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)'
> part is completely unused, so you can just drop it.

Well, the -i option is to get a backup copy for debugging purposes, can
safely be removed. BTW: On Linux no .bak files are generated, as
expected. Regarding the code I attach mksysinfo.sh and config.h.hurd  to
be run on Hurd and config.h.linux to be run on Linux. Good luck making
the patch better. It worked for me, but as I wrote before I'm no
sed/grep expert.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.h.hurd
Type: text/x-csrc
Size: 11612 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140521/c547131f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mksysinfo.sh
Type: application/x-shellscript
Size: 39833 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140521/c547131f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.h.linux
Type: text/x-csrc
Size: 11525 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140521/c547131f/attachment-0002.bin>


More information about the Gcc-patches mailing list