This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: Fill out syscall package for GNU/Linux
- 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, gofrontend-dev at googlegroups dot com
- Date: Sun, 04 Mar 2012 22:04:16 -0800
- Subject: Re: libgo patch committed: Fill out syscall package for GNU/Linux
- Authentication-results: mr.google.com; spf=pass (google.com: domain of iant@google.com designates 10.68.189.70 as permitted sender) smtp.mail=iant@google.com; dkim=pass header.i=iant@google.com
- References: <mcr62epo1b9.fsf@dhcp-172-18-216-180.mtv.corp.google.com> <yddy5rjxqsv.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <yddr4xavmx3.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
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.])