This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix remaining libgo testsuite failures on Solaris 2
- From: Ian Lance Taylor <iant at google dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Jan 2011 12:23:16 -0800
- Subject: Re: Fix remaining libgo testsuite failures on Solaris 2
- References: <yddvd1ewgz0.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> The recent merge of libgo from upstream broke bootstrap with Go on
> Solaris: unless _XOPEN_SOURCE is defined as 400 or above, struct msghdr
> has no msg_control, msg_controllen, and msg_flags members, but uses
> msg_accrights and msg_accrightslen instead.
>
> I've fixed this (and the bootstrap) like this in mksysinfo.sh:
>
> diff -r 77ad95adb9e1 libgo/mksysinfo.sh
> --- a/libgo/mksysinfo.sh Sun Jan 23 23:05:50 2011 +0100
> +++ b/libgo/mksysinfo.sh Sun Jan 23 23:08:31 2011 +0100
> @@ -57,7 +57,8 @@
> #include <unistd.h>
> EOF
>
> -${CC} -D_GNU_SOURCE -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c
> +#${CC} -D_GNU_SOURCE -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c
> +${CC} -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c
Why did you remove the _D_GNU_SOURCE? Does it hurt?
> I think we really need to introduce the target_triplet arg to
> mksysinfo.sh again which I already had in my original Solaris libgo
> patch. I really doubt that we can find macros which make those
> parts/versions of libc visible that are needed in libgo, but have no ill
> effect on other platforms.
I agree that we can't make all systems work the same way, but I think
that testing target_triplet is wrong. We should instead test for the
relevant features in configure.ac, and use those tests in mksysinfo.sh.
E.g., the way mksysinfo.sh already tests HAVE_SYSCALL_H,
HAVE_SYS_EPOLL_H, etc.
> * Currently, go/os/sys_linux.go is used everywhere which doesn't work
> since only Linux has /proc/sys/kernel/hostname. I wonder what the
> best solution is, though:
>
> Solaris /bin/hostname uses sysinfo(SI_HOSTNAME), there's also
> gethostname(3C) and of course uname(2).
The best solution here is to grab os/sys_bsd.go from the master library
and use it on Solaris.
Thanks for the list of items to address, and thanks for testing it.
Ian