libgo patch committed: Fill out syscall package for GNU/Linux

Submitted by Ian Taylor on March 5, 2012, 6:04 a.m.

Details

Message ID mcry5rfeg7z.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Taylor March 5, 2012, 6:04 a.m.
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> Ian Lance Taylor <iant@google.com> writes:
>>
>>> This patch to libgo fills out the syscall package for GNU/Linux to match
>>> all the functions in the syscall package in the master Go library.
>>> There is a test case for this patch at
>>> http://code.google.com/p/go/issues/detail?id=3071 .  Bootstrapped and
>>> ran Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.
>>
>> Unfortunately, this broke Solaris bootstrap:
>
> It also broke Linux/x86_64 bootstrap (CentOS 5.6):
>
> In file included from /usr/include/sys/ustat.h:30:0,
>                  from /usr/include/ustat.h:1,
>                  from sysinfo.c:91:
> /usr/include/bits/ustat.h:25:8: error: redefinition of 'struct ustat'
> In file included from /usr/include/linux/filter.h:8:0,
>                  from sysinfo.c:61:
> /usr/include/linux/types.h:156:8: note: originally defined here


After some actual testing, this additional patch seems to be needed to
fix the problem.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Comments

Rainer Orth March 8, 2012, 1:06 p.m.
Ian Lance Taylor <iant@google.com> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>>
>>> Ian Lance Taylor <iant@google.com> writes:
>>>
>>>> This patch to libgo fills out the syscall package for GNU/Linux to match
>>>> all the functions in the syscall package in the master Go library.
>>>> There is a test case for this patch at
>>>> http://code.google.com/p/go/issues/detail?id=3071 .  Bootstrapped and
>>>> ran Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.
>>>
>>> Unfortunately, this broke Solaris bootstrap:
>>
>> It also broke Linux/x86_64 bootstrap (CentOS 5.6):
>>
>> In file included from /usr/include/sys/ustat.h:30:0,
>>                  from /usr/include/ustat.h:1,
>>                  from sysinfo.c:91:
>> /usr/include/bits/ustat.h:25:8: error: redefinition of 'struct ustat'
>> In file included from /usr/include/linux/filter.h:8:0,
>>                  from sysinfo.c:61:
>> /usr/include/linux/types.h:156:8: note: originally defined here
>
>
> After some actual testing, this additional patch seems to be needed to
> fix the problem.  Bootstrapped and ran Go testsuite on
> x86_64-unknown-linux-gnu.  Committed to mainline.

This patch and the preceding one need to go onto the 4.7 branch, too,
otherwise bootstrap on Solaris and CentOS 5.6 is broken.

	Rainer
Ian Taylor March 8, 2012, 5:44 p.m.
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> This patch and the preceding one need to go onto the 4.7 branch, too,
> otherwise bootstrap on Solaris and CentOS 5.6 is broken.

Thanks--I plan to prepare a large patch for the 4.7 branch tomorrow.

Ian

Patch hide | download patch | download mbox

diff -r 6ec2944349b2 libgo/configure.ac
--- a/libgo/configure.ac	Fri Mar 02 13:07:34 2012 -0800
+++ b/libgo/configure.ac	Sun Mar 04 21:53:22 2012 -0800
@@ -463,6 +463,8 @@ 
 
 AC_CACHE_CHECK([whether <ustat.h> can be used],
 [libgo_cv_c_ustat_h],
+[CFLAGS_hold=$CFLAGS
+CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE $OSCFLAGS"
 AC_COMPILE_IFELSE(
 [AC_LANG_SOURCE([
 #include <sys/types.h>
@@ -470,7 +472,8 @@ 
 #include <linux/filter.h>
 #endif
 #include <ustat.h>
-])], [libgo_cv_c_ustat_h=yes], [libgo_cv_c_ustat_h=no]))
+])], [libgo_cv_c_ustat_h=yes], [libgo_cv_c_ustat_h=no])
+CFLAGS=$CFLAGS_hold])
 if test $libgo_cv_c_ustat_h = yes; then
   AC_DEFINE(HAVE_USTAT_H, 1,
     [Define to 1 if you have the <ustat.h> header file and it works.])