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]

Patch to fix gcc.dg/cpp/assert4.c for -gnu and -linux-gnu targets


The various -gnu and -linux-gnu targets fail the #system assertion
tests in gcc.dg/cpp/assert4.c all for different reasons.

This patch fixes these targets by introducing new macros for code
reuse, the macros include the base defines and assertions for hurd and
linux.  I use the new macros where possible, a couple of targets don't
include the top level gnu.h/linux.h files and the rs6000 setup looked
too hairy to touch so I used added the appropriate -A flag there.  The
cris targets also needed some extra fixing, that one still uses the -A
style a bit too.

Tested by building xgcc and cc1 in a cross-compiler for the following
targets to ensure against typos.  I also compiled gcc.dg/cpp/assert4.c
with each cross-compiler and ensured that the testcase passes the
#system portion of the test.

Note in addition to the -gnu and -linux-gnu targets, I also tested
extra some cris and x86_64 targets since I mucked with the #cpu and/or
#machine stuff for those:

alpha-unknown-gnu alpha-unknown-linux-gnu am33_2.0-unknown-linux-gnu
cris-unknown-aout cris-unknown-elf cris-unknown-linux-gnu
hppa1.1-unknown-linux-gnu hppa64-unknown-linux-gnu
i370-unknown-linux-gnu i386-moss-msdos i386-unknown-linux-gnu
i486-unknown-kfreebsd-gnu i686-unknown-gnu ia64-unknown-linux-gnu
m68k-unknown-linux-gnu m68k-unknown-uclinux mips-unknown-linux-gnu
mips64-unknown-linux-gnu powerpc-unknown-linux-gnu
s390-unknown-linux-gnu s390x-unknown-linux-gnu sh-unknown-linux-gnu
sparc-unknown-linux-gnu sparc64-unknown-linux-gnu
x86_64-unknown-freebsd6 x86_64-unknown-linux-gnu
xtensa-unknown-linux-gnu

Ok for mainline?

		Thanks,
		--Kaveh


2003-11-18  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New.
	* config/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): New.
	
	* config/alpha/gnu.h, config/alpha/linux.h,
	config/arm/linux-elf.h, config/cris/cris.h, config/cris/linux.h,
	config/i370/linux.h, config/i386/gnu.h, config/i386/i386.h,
	config/i386/linux-aout.h, config/i386/linux.h,
	config/i386/linux64.h, config/ia64/linux.h, config/m68k/linux.h,
	config/m68k/uclinux.h, config/mips/linux.h,
	config/mn10300/linux.h, config/pa/pa-linux.h,
	config/rs6000/sysv4.h, config/s390/linux.h, config/sh/linux.h,
	config/sparc/linux.h, config/sparc/linux64.h,
	config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Use
	HURD_TARGET_OS_CPP_BUILTINS/LINUX_TARGET_OS_CPP_BUILTINS or ensure
	all necessary assertions are included.

testsuite:
	* testsuite/gcc.dg/cpp/assert4.c: Update.

diff -rup orig/egcc-CVS20031118/gcc/config/alpha/gnu.h egcc-CVS20031118/gcc/config/alpha/gnu.h
--- orig/egcc-CVS20031118/gcc/config/alpha/gnu.h	2003-05-18 11:42:15.000000000 -0400
+++ egcc-CVS20031118/gcc/config/alpha/gnu.h	2003-11-19 22:23:15.981453000 -0500
@@ -6,11 +6,8 @@
 #undef TARGET_OS_CPP_BUILTINS /* config.gcc includes alpha/linux.h.  */
 #define TARGET_OS_CPP_BUILTINS()		\
     do {					\
-	builtin_define ("__GNU__");		\
-	builtin_define ("__gnu_hurd__");	\
+	HURD_TARGET_OS_CPP_BUILTINS();		\
 	builtin_define ("_LONGLONG");		\
-	builtin_define_std ("unix");		\
-	builtin_assert ("system=gnu");		\
     } while (0)
 
 #undef ELF_DYNAMIC_LINKER
diff -rup orig/egcc-CVS20031118/gcc/config/alpha/linux.h egcc-CVS20031118/gcc/config/alpha/linux.h
--- orig/egcc-CVS20031118/gcc/config/alpha/linux.h	2003-10-01 20:01:08.000000000 -0400
+++ egcc-CVS20031118/gcc/config/alpha/linux.h	2003-11-19 21:02:36.721161000 -0500
@@ -30,6 +30,8 @@ Boston, MA 02111-1307, USA.  */
 	builtin_define_std ("linux");				\
 	builtin_define_std ("unix");				\
 	builtin_assert ("system=linux");			\
+	builtin_assert ("system=unix");				\
+	builtin_assert ("system=posix");			\
 	/* The GNU C++ standard library requires this.  */	\
 	if (c_dialect_cxx ())					\
 	  builtin_define ("_GNU_SOURCE");			\
diff -rup orig/egcc-CVS20031118/gcc/config/arm/linux-elf.h egcc-CVS20031118/gcc/config/arm/linux-elf.h
--- orig/egcc-CVS20031118/gcc/config/arm/linux-elf.h	2003-09-16 20:01:45.000000000 -0400
+++ egcc-CVS20031118/gcc/config/arm/linux-elf.h	2003-11-18 16:50:17.617490000 -0500
@@ -89,14 +89,7 @@
    %{mbig-endian:-EB}" \
    SUBTARGET_EXTRA_LINK_SPEC
 
-#define TARGET_OS_CPP_BUILTINS()		\
-    do {					\
-	builtin_define_std ("unix");		\
-	builtin_define_std ("linux");		\
-	builtin_define ("__gnu_linux__");	\
-	builtin_assert ("system=unix");		\
-	builtin_assert ("system=posix");	\
-    } while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
 
 /* This is how we tell the assembler that two symbols have the same value.  */
 #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
diff -rup orig/egcc-CVS20031118/gcc/config/cris/cris.h egcc-CVS20031118/gcc/config/cris/cris.h
--- orig/egcc-CVS20031118/gcc/config/cris/cris.h	2003-10-15 20:01:51.000000000 -0400
+++ egcc-CVS20031118/gcc/config/cris/cris.h	2003-11-19 23:30:10.118506000 -0500
@@ -251,6 +251,8 @@ extern const char *cris_elinux_stacksize
       builtin_define_std ("CRIS");		\
       builtin_define_std ("GNU_CRIS");		\
       builtin_define ("__CRIS_ABI_version=2");	\
+      builtin_assert ("cpu=cris");		\
+      builtin_assert ("machine=cris");		\
     }						\
   while (0)
 
diff -rup orig/egcc-CVS20031118/gcc/config/cris/linux.h egcc-CVS20031118/gcc/config/cris/linux.h
--- orig/egcc-CVS20031118/gcc/config/cris/linux.h	2003-06-03 20:01:57.000000000 -0400
+++ egcc-CVS20031118/gcc/config/cris/linux.h	2003-11-19 23:32:48.045339000 -0500
@@ -48,9 +48,7 @@ Boston, MA 02111-1307, USA.  */
 #undef CRIS_CPP_SUBTARGET_SPEC
 #define CRIS_CPP_SUBTARGET_SPEC \
   "%{pthread:-D_REENTRANT}\
-   %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}\
-   %{!ansi:%{!std=*:%{!undef:-Dlinux -Dunix}\
-     -Asystem(unix) -Asystem(posix) -Acpu(cris) -Amachine(cris)}}"
+   %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}"
 
 #undef CRIS_CC1_SUBTARGET_SPEC
 #define CRIS_CC1_SUBTARGET_SPEC \
@@ -103,9 +101,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-      builtin_define ("__gnu_linux__");		\
-      builtin_define ("__linux__");		\
-      builtin_define ("__unix__");		\
+      LINUX_TARGET_OS_CPP_BUILTINS();		\
       if (flag_pic)				\
 	{					\
 	  builtin_define ("__PIC__");		\
diff -rup orig/egcc-CVS20031118/gcc/config/gnu.h egcc-CVS20031118/gcc/config/gnu.h
--- orig/egcc-CVS20031118/gcc/config/gnu.h	2002-04-15 16:44:32.000000000 -0400
+++ egcc-CVS20031118/gcc/config/gnu.h	2003-11-19 22:22:34.504479000 -0500
@@ -18,3 +18,15 @@
 
 /* The system headers under GNU are C++-aware.  */
 #define NO_IMPLICIT_EXTERN_C
+
+#define HURD_TARGET_OS_CPP_BUILTINS()		\
+    do {					\
+	builtin_define ("__gnu_hurd__");	\
+	builtin_define ("__GNU__");		\
+	builtin_define_std ("unix");		\
+	builtin_define_std ("MACH");		\
+	builtin_assert ("system=gnu");		\
+	builtin_assert ("system=mach");		\
+	builtin_assert ("system=unix");		\
+	builtin_assert ("system=posix");	\
+    } while (0)
diff -rup orig/egcc-CVS20031118/gcc/config/i370/linux.h egcc-CVS20031118/gcc/config/i370/linux.h
--- orig/egcc-CVS20031118/gcc/config/i370/linux.h	2003-09-27 20:01:14.000000000 -0400
+++ egcc-CVS20031118/gcc/config/i370/linux.h	2003-11-18 16:52:24.667764000 -0500
@@ -29,13 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_ELF_ABI
 
 /* Target OS preprocessor built-ins.  */
-#define TARGET_OS_CPP_BUILTINS()		\
-    do {					\
-	builtin_define_std ("unix");		\
-	builtin_define_std ("linux");		\
-	builtin_define ("__gnu_linux__");	\
-	builtin_assert ("system=posix");	\
-    } while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
 
 /* Options for this target machine.  */
 
diff -rup orig/egcc-CVS20031118/gcc/config/i386/gnu.h egcc-CVS20031118/gcc/config/i386/gnu.h
--- orig/egcc-CVS20031118/gcc/config/i386/gnu.h	2003-05-18 11:42:22.000000000 -0400
+++ egcc-CVS20031118/gcc/config/i386/gnu.h	2003-11-19 22:26:18.829277000 -0500
@@ -7,14 +7,7 @@
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-	builtin_define_std ("MACH");		\
-	builtin_define_std ("unix");		\
-	builtin_define ("__GNU__");		\
-	builtin_define ("__gnu_hurd__");	\
-	builtin_assert ("system=gnu");		\
-	builtin_assert ("system=mach");		\
-	builtin_assert ("system=posix");	\
-	builtin_assert ("system=unix");		\
+	HURD_TARGET_OS_CPP_BUILTINS();		\
 	if (flag_pic)				\
 	  {					\
 	    builtin_define ("__PIC__");		\
diff -rup orig/egcc-CVS20031118/gcc/config/i386/i386.h egcc-CVS20031118/gcc/config/i386/i386.h
--- orig/egcc-CVS20031118/gcc/config/i386/i386.h	2003-11-02 20:01:15.000000000 -0500
+++ egcc-CVS20031118/gcc/config/i386/i386.h	2003-11-19 23:50:32.794051000 -0500
@@ -546,6 +546,7 @@ extern int x86_prefetch_sse;
       if (TARGET_64BIT)						\
 	{							\
 	  builtin_assert ("cpu=x86_64");			\
+	  builtin_assert ("machine=x86_64");			\
 	  builtin_define ("__amd64");				\
 	  builtin_define ("__amd64__");				\
 	  builtin_define ("__x86_64");				\
diff -rup orig/egcc-CVS20031118/gcc/config/i386/linux-aout.h egcc-CVS20031118/gcc/config/i386/linux-aout.h
--- orig/egcc-CVS20031118/gcc/config/i386/linux-aout.h	2003-09-26 20:01:19.000000000 -0400
+++ egcc-CVS20031118/gcc/config/i386/linux-aout.h	2003-11-18 16:52:57.265222000 -0500
@@ -26,10 +26,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-	builtin_define_std ("linux");		\
-	builtin_define_std ("unix");		\
-	builtin_define ("__gnu_linux__");	\
-	builtin_assert ("system=posix");	\
+	LINUX_TARGET_OS_CPP_BUILTINS();		\
 	if (flag_pic)				\
 	  {					\
 	    builtin_define ("__PIC__");		\
diff -rup orig/egcc-CVS20031118/gcc/config/i386/linux.h egcc-CVS20031118/gcc/config/i386/linux.h
--- orig/egcc-CVS20031118/gcc/config/i386/linux.h	2003-09-26 20:01:20.000000000 -0400
+++ egcc-CVS20031118/gcc/config/i386/linux.h	2003-11-18 16:53:31.992521000 -0500
@@ -73,10 +73,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-	builtin_define_std ("linux");		\
-	builtin_define_std ("unix");		\
-	builtin_define ("__gnu_linux__");	\
-	builtin_assert ("system=posix");	\
+	LINUX_TARGET_OS_CPP_BUILTINS();		\
 	if (flag_pic)				\
 	  {					\
 	    builtin_define ("__PIC__");		\
diff -rup orig/egcc-CVS20031118/gcc/config/i386/linux64.h egcc-CVS20031118/gcc/config/i386/linux64.h
--- orig/egcc-CVS20031118/gcc/config/i386/linux64.h	2003-09-26 20:01:20.000000000 -0400
+++ egcc-CVS20031118/gcc/config/i386/linux64.h	2003-11-18 16:54:24.988460000 -0500
@@ -24,10 +24,7 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()				\
   do								\
     {								\
-	builtin_define_std ("linux");				\
-	builtin_define_std ("unix");				\
-	builtin_define ("__gnu_linux__");			\
-	builtin_assert ("system=posix");			\
+	LINUX_TARGET_OS_CPP_BUILTINS();				\
 	if (flag_pic)						\
 	  {							\
 	    builtin_define ("__PIC__");				\
diff -rup orig/egcc-CVS20031118/gcc/config/ia64/linux.h egcc-CVS20031118/gcc/config/ia64/linux.h
--- orig/egcc-CVS20031118/gcc/config/ia64/linux.h	2003-06-03 20:02:03.000000000 -0400
+++ egcc-CVS20031118/gcc/config/ia64/linux.h	2003-11-18 16:55:32.703338000 -0500
@@ -12,10 +12,7 @@
 /* Target OS builtins.  */
 #define TARGET_OS_CPP_BUILTINS()		\
 do {						\
-	builtin_assert("system=linux");		\
-	builtin_define_std("linux");		\
-	builtin_define_std("unix");		\
-	builtin_define("__gnu_linux__");	\
+	LINUX_TARGET_OS_CPP_BUILTINS();		\
 	builtin_define("_LONGLONG");		\
 } while (0)
 
diff -rup orig/egcc-CVS20031118/gcc/config/linux.h egcc-CVS20031118/gcc/config/linux.h
--- orig/egcc-CVS20031118/gcc/config/linux.h	2003-09-16 20:01:44.000000000 -0400
+++ egcc-CVS20031118/gcc/config/linux.h	2003-11-18 16:47:07.421830000 -0500
@@ -97,6 +97,16 @@ Boston, MA 02111-1307, USA.  */
        %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
 #endif
 
+#define LINUX_TARGET_OS_CPP_BUILTINS()				\
+    do {							\
+	builtin_define ("__gnu_linux__");			\
+	builtin_define_std ("linux");				\
+	builtin_define_std ("unix");				\
+	builtin_assert ("system=linux");			\
+	builtin_assert ("system=unix");				\
+	builtin_assert ("system=posix");			\
+    } while (0)
+
 #if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
 #endif
diff -rup orig/egcc-CVS20031118/gcc/config/m68k/linux.h egcc-CVS20031118/gcc/config/m68k/linux.h
--- orig/egcc-CVS20031118/gcc/config/m68k/linux.h	2003-09-27 20:01:21.000000000 -0400
+++ egcc-CVS20031118/gcc/config/m68k/linux.h	2003-11-18 16:57:28.293742000 -0500
@@ -86,13 +86,9 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
+	LINUX_TARGET_OS_CPP_BUILTINS();		\
 	builtin_define_std ("mc68000");		\
 	builtin_define_std ("mc68020");		\
-	builtin_define_std ("linux");		\
-	builtin_define_std ("unix");		\
-	builtin_define ("__gnu_linux__");	\
-	builtin_assert ("system=unix");		\
-	builtin_assert ("system=posix");	\
    }						\
   while (0)
 
diff -rup orig/egcc-CVS20031118/gcc/config/m68k/uclinux.h egcc-CVS20031118/gcc/config/m68k/uclinux.h
--- orig/egcc-CVS20031118/gcc/config/m68k/uclinux.h	2003-10-11 00:23:20.000000000 -0400
+++ egcc-CVS20031118/gcc/config/m68k/uclinux.h	2003-11-19 21:07:43.567289000 -0500
@@ -55,6 +55,8 @@ Boston, MA 02111-1307, USA.  */
 	builtin_define_std ("linux");		\
 	builtin_define_std ("unix");		\
 	builtin_define ("__gnu_linux__");	\
+	builtin_assert ("system=linux");	\
+	builtin_assert ("system=unix");		\
 	builtin_assert ("system=posix");	\
 	if (TARGET_ID_SHARED_LIBRARY)		\
 	  builtin_define ("__ID_SHARED_LIBRARY__"); \
diff -rup orig/egcc-CVS20031118/gcc/config/mips/linux.h egcc-CVS20031118/gcc/config/mips/linux.h
--- orig/egcc-CVS20031118/gcc/config/mips/linux.h	2003-10-24 20:01:22.000000000 -0400
+++ egcc-CVS20031118/gcc/config/mips/linux.h	2003-11-18 16:57:58.311401000 -0500
@@ -55,12 +55,9 @@ Boston, MA 02111-1307, USA.  */
 
 #define TARGET_OS_CPP_BUILTINS()				\
     do {							\
-	builtin_define ("__gnu_linux__");			\
+	LINUX_TARGET_OS_CPP_BUILTINS();				\
 	builtin_define ("__PIC__");				\
 	builtin_define ("__pic__");				\
-	builtin_define_std ("unix");				\
-	builtin_define_std ("linux");				\
-	builtin_assert ("system=linux");			\
 	/* The GNU C++ standard library requires this.  */	\
 	if (c_dialect_cxx ())					\
 	  builtin_define ("_GNU_SOURCE");			\
diff -rup orig/egcc-CVS20031118/gcc/config/mn10300/linux.h egcc-CVS20031118/gcc/config/mn10300/linux.h
--- orig/egcc-CVS20031118/gcc/config/mn10300/linux.h	2003-09-27 20:01:28.000000000 -0400
+++ egcc-CVS20031118/gcc/config/mn10300/linux.h	2003-11-18 16:58:37.468286000 -0500
@@ -23,16 +23,7 @@
 #undef  PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
-#define TARGET_OS_CPP_BUILTINS()		\
-    do						\
-      {						\
-	builtin_define_std ("unix");		\
-	builtin_define_std ("linux");		\
-	builtin_define ("__gnu_linux__");	\
-	builtin_assert ("system=unix");		\
-	builtin_assert ("system=posix");	\
-      }						\
-    while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
 
 #undef  CPP_SPEC
 #define CPP_SPEC "%{mam33:-D__AM33__} %{!mam33:-D__AM33__=2 -D__AM33_2__} \
diff -rup orig/egcc-CVS20031118/gcc/config/pa/pa-linux.h egcc-CVS20031118/gcc/config/pa/pa-linux.h
--- orig/egcc-CVS20031118/gcc/config/pa/pa-linux.h	2003-10-29 20:02:09.000000000 -0500
+++ egcc-CVS20031118/gcc/config/pa/pa-linux.h	2003-11-18 16:59:05.025986000 -0500
@@ -56,12 +56,8 @@ Boston, MA 02111-1307, USA.  */
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-	builtin_define ("__gnu_linux__");	\
-	builtin_define_std ("linux");		\
-	builtin_define_std ("unix");		\
+	LINUX_TARGET_OS_CPP_BUILTINS();		\
 	builtin_assert ("machine=bigendian");	\
-	builtin_assert ("system=posix");	\
-	builtin_assert ("system=unix");		\
     }						\
   while (0)
 
diff -rup orig/egcc-CVS20031118/gcc/config/rs6000/sysv4.h egcc-CVS20031118/gcc/config/rs6000/sysv4.h
--- orig/egcc-CVS20031118/gcc/config/rs6000/sysv4.h	2003-11-18 08:12:25.000000000 -0500
+++ egcc-CVS20031118/gcc/config/rs6000/sysv4.h	2003-11-19 23:46:44.041903000 -0500
@@ -1124,7 +1124,7 @@ extern int fixuplabelno;
   %{!ansi:							  \
     %{!std=*:-Dunix -D__unix -Dlinux -D__linux}			  \
     %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
--Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
+-Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
 
 /* GNU/Hurd support.  */
 #define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
diff -rup orig/egcc-CVS20031118/gcc/config/s390/linux.h egcc-CVS20031118/gcc/config/s390/linux.h
--- orig/egcc-CVS20031118/gcc/config/s390/linux.h	2003-07-04 20:00:48.000000000 -0400
+++ egcc-CVS20031118/gcc/config/s390/linux.h	2003-11-18 17:08:41.770485000 -0500
@@ -53,11 +53,7 @@ Software Foundation, 59 Temple Place - S
 #define TARGET_OS_CPP_BUILTINS()		\
   do						\
     {						\
-      builtin_define_std ("linux");		\
-      builtin_define_std ("unix");		\
-      builtin_assert ("system=linux");		\
-      builtin_assert ("system=unix");		\
-      builtin_define ("__gnu_linux__");		\
+      LINUX_TARGET_OS_CPP_BUILTINS();		\
       if (flag_pic)				\
         {					\
           builtin_define ("__PIC__");		\
diff -rup orig/egcc-CVS20031118/gcc/config/sh/linux.h egcc-CVS20031118/gcc/config/sh/linux.h
--- orig/egcc-CVS20031118/gcc/config/sh/linux.h	2003-10-06 20:01:26.000000000 -0400
+++ egcc-CVS20031118/gcc/config/sh/linux.h	2003-11-19 21:11:49.939510000 -0500
@@ -57,6 +57,8 @@ do { \
   builtin_define_std ("unix"); \
   builtin_define ("__gnu_linux__"); \
   builtin_define_std ("linux"); \
+  builtin_assert ("system=linux"); \
+  builtin_assert ("system=unix"); \
   builtin_assert ("system=posix"); \
 } while (0)
 
diff -rup orig/egcc-CVS20031118/gcc/config/sparc/linux.h egcc-CVS20031118/gcc/config/sparc/linux.h
--- orig/egcc-CVS20031118/gcc/config/sparc/linux.h	2003-10-01 20:01:13.000000000 -0400
+++ egcc-CVS20031118/gcc/config/sparc/linux.h	2003-11-19 21:15:00.532121000 -0500
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA.  */
 	builtin_define_std ("unix");		\
 	builtin_define_std ("linux");		\
 	builtin_define ("__gnu_linux__");	\
+	builtin_assert ("system=linux");	\
 	builtin_assert ("system=unix");		\
 	builtin_assert ("system=posix");	\
     }						\
diff -rup orig/egcc-CVS20031118/gcc/config/sparc/linux64.h egcc-CVS20031118/gcc/config/sparc/linux64.h
--- orig/egcc-CVS20031118/gcc/config/sparc/linux64.h	2003-10-01 20:01:13.000000000 -0400
+++ egcc-CVS20031118/gcc/config/sparc/linux64.h	2003-11-19 21:19:36.785258000 -0500
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA.  */
 	builtin_define_std ("linux");		\
 	builtin_define ("_LONGLONG");		\
 	builtin_define ("__gnu_linux__");	\
+	builtin_assert ("system=linux");	\
 	builtin_assert ("system=unix");		\
 	builtin_assert ("system=posix");	\
     }						\
diff -rup orig/egcc-CVS20031118/gcc/config/xtensa/linux.h egcc-CVS20031118/gcc/config/xtensa/linux.h
--- orig/egcc-CVS20031118/gcc/config/xtensa/linux.h	2003-09-12 20:01:18.000000000 -0400
+++ egcc-CVS20031118/gcc/config/xtensa/linux.h	2003-11-18 17:10:38.561326000 -0500
@@ -19,13 +19,7 @@ along with GCC; see the file COPYING.  I
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
-#define TARGET_OS_CPP_BUILTINS()				\
-  do {								\
-    builtin_define_std ("linux");				\
-    builtin_define_std ("unix");				\
-    builtin_define ("__gnu_linux__");				\
-    builtin_assert ("system=posix");				\
-  } while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
 
 #undef SUBTARGET_CPP_SPEC
 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
diff -rup orig/egcc-CVS20031118/gcc/testsuite/gcc.dg/cpp/assert4.c egcc-CVS20031118/gcc/testsuite/gcc.dg/cpp/assert4.c
--- orig/egcc-CVS20031118/gcc/testsuite/gcc.dg/cpp/assert4.c	2003-11-16 16:26:29.000000000 -0500
+++ egcc-CVS20031118/gcc/testsuite/gcc.dg/cpp/assert4.c	2003-11-19 23:29:28.292177000 -0500
@@ -15,7 +15,7 @@
 #endif
 
 #if defined __gnu_hurd__
-# if !#system(gnu) || !#system(unix) || !#system(posix)
+# if !#system(gnu) || !#system(unix) || !#system(posix) || !#system(mach)
 #  error
 # endif
 #elif #system(gnu)
@@ -128,6 +128,14 @@
 # error
 #endif
 
+#if defined __cris__
+# if !#cpu(cris) || !#machine(cris)
+#  error
+# endif
+#elif #cpu(cris) || #machine(cris)
+# error
+#endif
+
 #if defined __d30v__
 # if !#cpu(d30v) || !#machine(d30v)
 #  error


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