This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix remaining libgo testsuite failures on Solaris 2


Ian Lance Taylor <iant@google.com> writes:

>> 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?

Probably not, it should have no effect on Solaris, but the rest
(especially _XOPEN_SOURCE=600) will likely hurt on other platforms.
As I (should have) mentioned, this `patch' was just a hack to let me
continue at all.

>> 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.

That would mean testing for msg_control, msg_controllen in struct msghdr
in this case, and trying various feature test macros until a match is
found (if any).  E.g., Tru64 UNIX seems to use _POSIX_PII_SOCKET for
that.  libjava already has some of that mess.

>> * 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.

At least the version currently in the GCC tree uses sysctl which doesn't
exist on Solaris.  I suppose uname(2) should be most portable, but I'd
have to check.

> Thanks for the list of items to address, and thanks for testing it.

My pleasure.  If you can make some suggestions for the best route to fix
these issues, I can try (some of) this myself, but given the often
trivial nature of the issues, it might just be a wast of time.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]