OSDN Git Service

* config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Nov 2003 03:08:13 +0000 (03:08 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 Nov 2003 03:08:13 +0000 (03:08 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74031 138bc75d-0d04-0410-961f-82ee72b054a4

28 files changed:
gcc/ChangeLog
gcc/config/alpha/gnu.h
gcc/config/alpha/linux.h
gcc/config/arm/linux-elf.h
gcc/config/cris/cris.h
gcc/config/cris/linux.h
gcc/config/gnu.h
gcc/config/i370/linux.h
gcc/config/i386/gnu.h
gcc/config/i386/i386.h
gcc/config/i386/linux-aout.h
gcc/config/i386/linux.h
gcc/config/i386/linux64.h
gcc/config/ia64/linux.h
gcc/config/linux.h
gcc/config/m68k/linux.h
gcc/config/m68k/uclinux.h
gcc/config/mips/linux.h
gcc/config/mn10300/linux.h
gcc/config/pa/pa-linux.h
gcc/config/rs6000/sysv4.h
gcc/config/s390/linux.h
gcc/config/sh/linux.h
gcc/config/sparc/linux.h
gcc/config/sparc/linux64.h
gcc/config/xtensa/linux.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/assert4.c

index 920f03b..b980ee6 100644 (file)
@@ -1,3 +1,21 @@
+2003-11-28  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.
+
 2003-11-28  Jan Hubicka  <jh@suse.cz>
 
        * emit-rtl.c (set_used_flags): New.
index db2a278..40348c6 100644 (file)
@@ -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
index 2c9cc8e..a4bc3d3 100644 (file)
@@ -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");                       \
index f55a425..3cde711 100644 (file)
    %{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) \
index 288be19..9f130d6 100644 (file)
@@ -251,6 +251,8 @@ extern const char *cris_elinux_stacksize_str;
       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)
 
index 288c285..f842f94 100644 (file)
@@ -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__");           \
index f5f4184..23a8a73 100644 (file)
 
 /* 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)
index adc1959..f402fbd 100644 (file)
@@ -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.  */
 
index ff0ff25..cc9994b 100644 (file)
@@ -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__");         \
index 2f5630a..c5c03ab 100644 (file)
@@ -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");                          \
index b286b80..d7be93c 100644 (file)
@@ -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__");         \
index 493d64f..e7d19ec 100644 (file)
@@ -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__");         \
index 4165617..98536c1 100644 (file)
@@ -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__");                         \
index c24c70c..460dd26 100644 (file)
 /* 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)
 
index 2c85148..0f7ba17 100644 (file)
@@ -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
index 5bf21c5..03e6370 100644 (file)
@@ -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)
 
index 0231539..596cc19 100644 (file)
@@ -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__"); \
index 48c5e3c..ae64020 100644 (file)
@@ -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");                       \
index 59358df..0130498 100644 (file)
 #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__} \
index 2a714e3..c3808f1 100644 (file)
@@ -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)
 
index 2c82b05..a49a1ca 100644 (file)
@@ -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 } \
index e7e3b2e..9a6db9d 100644 (file)
@@ -53,11 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #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__");          \
index da42351..d28e0c2 100644 (file)
@@ -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)
 
index ac1cc12..8af7c5a 100644 (file)
@@ -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");        \
     }                                          \
index c7c45dc..fb9f5a7 100644 (file)
@@ -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");        \
     }                                          \
index ef5aae0..0b3b077 100644 (file)
@@ -19,13 +19,7 @@ along with GCC; see the file COPYING.  If not, write to the Free
 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}"
index cbac848..77938bd 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * testsuite/gcc.dg/cpp/assert4.c: Update.
+
 2003-11-28  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.dg/builtin-apply2.c: Set size of stack argument data to 64.
index 557d1c0..1b09ab1 100644 (file)
@@ -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)
 # 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