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: libgo patch committed: Fill out syscall package for GNU/Linux


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

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

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