gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sat, 29 Nov 2003 03:08:13 +0000 (03:08 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sat, 29 Nov 2003 03:08:13 +0000 (03:08 +0000)
* 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.

From-SVN: r74031

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 920f03b47e4952044dbe7647f9796ac83752e52a..b980ee6e26d2fddacce76090a16d558d5f28e0ac 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 db2a278db4a5f08c98a97d37a1094fc9daf71ecd..40348c60abbb5baa579923cb91ce61f80c5e69f7 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 2c9cc8ea6a1a51c4fec01c06b03f453ca99b9234..a4bc3d3e4a4bcf12e1308addc4aee3d63dfb2fd9 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 f55a42562cb52d8f3d2811e4a4394d3d12da1080..3cde7116d527222399dc5e1f93833d4eb2c22f52 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 288be199713b780d883268a7f29da4c6189886e2..9f130d6448cdfc5a44257790cfa7e9548656579d 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 288c2856ee636c4d1a8ffab0eb2074e42dc834dc..f842f949d6479a7a510638ab7cd9a41b639e7429 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 f5f4184e8d3052bd08285d1787cb39a62481a51c..23a8a730ec9862e1b3fe671af798bbc33d2c604d 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 adc1959c4d06a6888e532cd1c12490b91484b786..f402fbde9f3d50ddbfac43c651fb29340aa656c8 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 ff0ff254bac10f5f65185cfb169d09362d8fbc22..cc9994bcaed84db220c36777b740cabc0a2f3ad6 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 2f5630a3bd922c3632b86f3022291d80abfc80a0..c5c03abe20cdf5aac54d25e12e35dd459f3f99f5 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 b286b800fa6261cc916840efdb27b492a2834210..d7be93c73128c36898804cf43fb987a5e12ecc66 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 493d64f7974866dabc45bd01088550b0886345cc..e7d19ec181a25fe4e58814784340518770e9cb12 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 416561733c1ac3684335251400c42a928a010d32..98536c19bd3752ab3ad791222a990ef16c622b4e 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 c24c70c8d5a435f5ecbf6de5389507d2ea25983c..460dd26deaebdae5acda9e2bf0081b332708b508 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 2c85148c68582993646ab9041731f77e4bd7987c..0f7ba1777e8b865e78eae17a5af3b0a8e0ceb890 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 5bf21c55e3d60478207a2aa46448757d1cb6444b..03e637088fc441c076e4a4c0c944e1bde42afda1 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 0231539281ddd7636c769dd4eb51f9c333e99ae1..596cc1979c8b80ac62e1ff94c7e760e25f63fd85 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 48c5e3c908d13e40e1f979f42a4cc1a7580bd3ee..ae64020882ec89443dd7e570b6b5ae38adbcc026 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 59358df4386124fdf5186a74ef3dba7dac8747d0..0130498ce5ad1e56fccc8f53fdef5ba90ea12ab7 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 2a714e3ebdffd274c0eb2beb9d660229c1fcae68..c3808f1c34f7daea09384f4fa2b586eb47a91481 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 2c82b057e4368d427af925d73966b7d175bf1fa4..a49a1ca65165dfbc59882f28afafd4e936865ce0 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 e7e3b2ed995a6c57b98a43c6d8913299ed4f974d..9a6db9d76c1def453a379ad0acab5c4ee589714f 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 da423516b16af125d9db9342cde6ba115eae3f9c..d28e0c246804db52c799b8023784902b9d10df79 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 ac1cc12ad3bd2222babc4fcd2b44d4137883ee41..8af7c5a0259a51485e7a587d3325dce931d73fe8 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 c7c45dcdd9898d8e6ce6e51d43c0029e96496e5c..fb9f5a7370956d8cb6980a8f471291174357bca0 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 ef5aae04f63e08e69e3e57c97afdb09fe2fe81b9..0b3b077eca9b5fdef475dfd6b1be574afc9e15b2 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 cbac84803d49091ddcd3bea34f53769685731c60..77938bd6a35cd30b8ab4b7e418bb2cae89f22cbe 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 557d1c0ec28483e4580bd4630d2c31c58d49e62e..1b09ab1beac50cb16e26cd52e132e30e5b76c466 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