]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgo: Fix use of -D_GNU_SOURCE and friends when building libgo.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 20 Dec 2011 18:14:30 +0000 (18:14 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 20 Dec 2011 18:14:30 +0000 (18:14 +0000)
From-SVN: r182548

libgo/Makefile.am
libgo/Makefile.in
libgo/configure
libgo/configure.ac
libgo/go/syscall/wait.c
libgo/mksysinfo.sh

index 5bbeb890bd91bfe3ef77e48ba724b0bf4b73cb5b..f146320b5595cff82dc9554e0d0375825571f712 100644 (file)
@@ -37,7 +37,7 @@ AM_CPPFLAGS = -I $(srcdir)/runtime $(LIBFFIINCS) $(PTHREAD_CFLAGS)
 ACLOCAL_AMFLAGS = -I ./config -I ../config
 
 AM_CFLAGS = -fexceptions -fplan9-extensions $(SPLIT_STACK) $(WARN_CFLAGS) \
-       $(STRINGOPS_FLAG) \
+       $(STRINGOPS_FLAG) $(OSCFLAGS) \
        -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include
 
 if USING_SPLIT_STACK
index 70f3aca9ed8032a5bca584beb913d61bf59ac204..627672eb93d0d763d048d24e3ebb86cac50e185b 100644 (file)
@@ -509,7 +509,7 @@ WARN_CFLAGS = $(WARN_FLAGS) $(WERROR)
 AM_CPPFLAGS = -I $(srcdir)/runtime $(LIBFFIINCS) $(PTHREAD_CFLAGS)
 ACLOCAL_AMFLAGS = -I ./config -I ../config
 AM_CFLAGS = -fexceptions -fplan9-extensions $(SPLIT_STACK) $(WARN_CFLAGS) \
-       $(STRINGOPS_FLAG) \
+       $(STRINGOPS_FLAG) $(OSCFLAGS) \
        -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include
 
 @USING_SPLIT_STACK_TRUE@AM_LDFLAGS = -XCClinker $(SPLIT_STACK)
index 314399fc404bcefa5546735b36ebfa4af578f58e..d9915f91afcf22ab674e01a0f93785748776723e 100755 (executable)
 
 
 
+OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 case "$target" in
     mips-sgi-irix6.5*)
        # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct
        # msghdr in <sys/socket.h>.
-       OSCFLAGS='-D_XOPEN_SOURCE=500'
+       OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500"
        ;;
     *-*-solaris2.[89])
        # Solaris 8/9 need this so struct msghdr gets the msg_control
        # etc. fields in <sys/socket.h> (_XPG4_2).
-       OSCFLAGS='-D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D__EXTENSIONS__'
+       OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D__EXTENSIONS__"
        ;;
     *-*-solaris2.1[01])
        # Solaris 10+ needs this so struct msghdr gets the msg_control
        # etc. fields in <sys/socket.h> (_XPG4_2).  _XOPEN_SOURCE=500 as
        # above doesn't work with C99.
-       OSCFLAGS='-D_XOPEN_SOURCE=600 -D__EXTENSIONS__'
+       OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
        ;;
 esac
 
index 6cb5f900203c9d642bde4c824b884b516e45afc4..a001d50b58a4f7643f94e042e084fb668f2dba84 100644 (file)
@@ -277,23 +277,24 @@ AC_SUBST(GO_LIBCALL_OS_ARCH_FILE)
 AC_SUBST(GO_SYSCALL_OS_FILE)
 AC_SUBST(GO_SYSCALL_OS_ARCH_FILE)
 
-dnl Some targets need special flags to build sysinfo.go.
+dnl Special flags used to generate sysinfo.go.
+OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 case "$target" in
     mips-sgi-irix6.5*)
        # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct
        # msghdr in <sys/socket.h>.
-       OSCFLAGS='-D_XOPEN_SOURCE=500'
+       OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500"
        ;;
     *-*-solaris2.[[89]])
        # Solaris 8/9 need this so struct msghdr gets the msg_control
        # etc. fields in <sys/socket.h> (_XPG4_2).
-       OSCFLAGS='-D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D__EXTENSIONS__'
+       OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D__EXTENSIONS__"
        ;;
     *-*-solaris2.1[[01]])
        # Solaris 10+ needs this so struct msghdr gets the msg_control
        # etc. fields in <sys/socket.h> (_XPG4_2).  _XOPEN_SOURCE=500 as
        # above doesn't work with C99.
-       OSCFLAGS='-D_XOPEN_SOURCE=600 -D__EXTENSIONS__'
+       OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__"
        ;;
 esac
 AC_SUBST(OSCFLAGS)
index d3c90d74ea1241674ff4ffedec23d8e1ed7defe9..fd7b65e2414216c14f497a7f6922279cc6127bd0 100644 (file)
@@ -7,9 +7,6 @@
    We use C code to extract the wait status so that we can easily be
    OS-independent.  */
 
-#define _GNU_SOURCE
-#define __EXTENSIONS__
-
 #include <stdint.h>
 #include <sys/wait.h>
 
index a5e8144cd77e964e600ba978ebdabebb26d7c366..ca9e5f686b1d5ba568a4fdf6670351c544cc5972 100755 (executable)
@@ -25,10 +25,6 @@ rm -f sysinfo.c
 cat > sysinfo.c <<EOF
 #include "config.h"
 
-#define _GNU_SOURCE
-#define _LARGEFILE_SOURCE
-#define _FILE_OFFSET_BITS 64
-
 #include <sys/types.h>
 #include <dirent.h>
 #include <errno.h>