This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate
- From: Samuel Thibault <samuel dot thibault at gnu dot org>
- To: Svante Signell <svante dot signell at gmail dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org, bug-hurd at gnu dot org, Roland McGrath <roland at hack dot frob dot com>
- Date: Wed, 21 May 2014 01:27:04 +0200
- Subject: Re: patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate
- Authentication-results: sourceware.org; auth=none
- References: <1399027556 dot 8487 dot 12 dot camel at PackardBell-PC> <20140502105234 dot GM6577 at type> <1399363609 dot 13092 dot 29 dot camel at G3620 dot my dot own dot domain> <20140506125157 dot GH5788 at type dot bordeaux dot inria dot fr> <1399381520 dot 13092 dot 67 dot camel at G3620 dot my dot own dot domain> <20140506130755 dot GL5788 at type dot bordeaux dot inria dot fr> <1399382738 dot 13092 dot 70 dot camel at G3620 dot my dot own dot domain> <20140506132605 dot GD1010 at type dot bordeaux dot inria dot fr> <1399450727 dot 13092 dot 106 dot camel at G3620 dot my dot own dot domain> <1400227385 dot 10012 dot 98 dot camel at G3620 dot my dot own dot domain>
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.
> +# 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.
> @@ -528,6 +540,12 @@
> +# Special treatment of st_dev for GNU/Hurd
> +# /usr/include/i386-gnu/bits/stat.h: #define st_dev st_fsid
> +if grep 'define st_dev st_fsid' gen-sysinfo.go > /dev/null 2>&1; then
> + egrep '^type _stat ' gen-sysinfo.go > /dev/null 2>&1| \
> + sed -i.bak -e 's/; st_fsid/; st_dev/' gen-sysinfo.go
> +fi
The same remark about egrep | sed -i applies here.
And anyway, why not simply using the very first patch you proposed,
which was:
@@ -536,6 +548,7 @@
fi | sed -e 's/type _stat64/type Stat_t/' \
-e 's/type _stat/type Stat_t/' \
-e 's/st_dev/Dev/' \
+ -e 's/st_fsid/Dev/' \
-e 's/st_ino/Ino/g' \
-e 's/st_nlink/Nlink/' \
-e 's/st_mode/Mode/' \
which I said several times that it should be completely fine.
Samuel