diff options
Diffstat (limited to 'gcc/config/i386')
-rw-r--r-- | gcc/config/i386/i386-aout.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386elf.h | 4 | ||||
-rw-r--r-- | gcc/config/i386/linux64.h | 19 | ||||
-rw-r--r-- | gcc/config/i386/mach.h | 11 | ||||
-rw-r--r-- | gcc/config/i386/netware.h | 12 | ||||
-rw-r--r-- | gcc/config/i386/rtemself.h | 19 | ||||
-rw-r--r-- | gcc/config/i386/sco5.h | 28 | ||||
-rw-r--r-- | gcc/config/i386/sol2.h | 31 | ||||
-rw-r--r-- | gcc/config/i386/sysv4-cpp.h | 32 | ||||
-rw-r--r-- | gcc/config/i386/sysv4.h | 9 | ||||
-rw-r--r-- | gcc/config/i386/vsta.h | 13 | ||||
-rw-r--r-- | gcc/config/i386/vxi386.h | 41 | ||||
-rw-r--r-- | gcc/config/i386/win32.h | 26 |
13 files changed, 165 insertions, 85 deletions
diff --git a/gcc/config/i386/i386-aout.h b/gcc/config/i386/i386-aout.h index 824414fcc18..ca0cb2569ce 100644 --- a/gcc/config/i386/i386-aout.h +++ b/gcc/config/i386/i386-aout.h @@ -23,9 +23,4 @@ Boston, MA 02111-1307, USA. */ #define TARGET_VERSION fprintf (stderr, " (80386, BSD a.out syntax)"); -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "" - /* end of i386-aout.h */ diff --git a/gcc/config/i386/i386elf.h b/gcc/config/i386/i386elf.h index 46f207850ec..cd01db2a54e 100644 --- a/gcc/config/i386/i386elf.h +++ b/gcc/config/i386/i386elf.h @@ -40,10 +40,6 @@ Boston, MA 02111-1307, USA. */ (TYPE_MODE (TYPE) == BLKmode \ || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8)) -/* This used to define X86, but james@bigtex.cactus.org says that - is supposed to be defined optionally by user programs--not by default. */ -#define CPP_PREDEFINES "" - #undef CPP_SPEC #define CPP_SPEC "" diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h index 99c381aa4de..7f19a536913 100644 --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -23,11 +23,24 @@ Boston, MA 02111-1307, USA. */ #define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)"); -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -Asystem(posix)" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("linux"); \ + builtin_define_std ("unix"); \ + builtin_define ("__gnu_linux__"); \ + builtin_define ("__ELF__"); \ + builtin_assert ("system=posix"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } \ + while (0) #undef CPP_SPEC -#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" /* Provide a LINK_SPEC. Here we provide support for the special GCC options -static and -shared, which allow us to link things in one diff --git a/gcc/config/i386/mach.h b/gcc/config/i386/mach.h index 29039f39948..0aa3846ae21 100644 --- a/gcc/config/i386/mach.h +++ b/gcc/config/i386/mach.h @@ -2,8 +2,15 @@ #define TARGET_VERSION fprintf (stderr, " (80386, Mach)"); -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -DMACH -Asystem=unix -Asystem=mach" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("unix"); \ + builtin_define_std ("MACH"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=mach"); \ + } \ + while (0) /* Specify extra dir to search for include files. */ #define SYSTEM_INCLUDE_DIR "/usr/mach/include" diff --git a/gcc/config/i386/netware.h b/gcc/config/i386/netware.h index 8a51cf3db37..1f12662b926 100644 --- a/gcc/config/i386/netware.h +++ b/gcc/config/i386/netware.h @@ -24,10 +24,14 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (i386 Netware 4)"); -/* These surely require augmentation */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-DAPX386 -D__i386__ -D__netware__ -Asystem=netware -Acpu=i386 -Amachine=i386" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("APX386"); \ + builtin_define ("__netware__"); \ + builtin_assert ("system=netware"); \ + } \ + while (0) #undef WCHAR_TYPE #define WCHAR_TYPE "short unsigned int" diff --git a/gcc/config/i386/rtemself.h b/gcc/config/i386/rtemself.h index db95d36db85..dcf2808cd14 100644 --- a/gcc/config/i386/rtemself.h +++ b/gcc/config/i386/rtemself.h @@ -21,11 +21,14 @@ Boston, MA 02111-1307, USA. */ /* Specify predefined symbols in preprocessor. */ -#include <i386/i386elf.h> - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems \ - -D__ELF__ -D__i386__ -D__USE_INIT_FINI__" - -#undef CPP_SPEC -#define CPP_SPEC "%{msoft-float:-D_SOFT_FLOAT}" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__rtems__"); \ + builtin_define ("__ELF__"); \ + builtin_define ("__USE_INIT_FINI__"); \ + builtin_assert ("system=rtems"); \ + if (!TARGET_80387) \ + builtin_define ("_SOFT_FLOAT"); \ + } \ + while (0) diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h index 818cba84f93..f1f34f997de 100644 --- a/gcc/config/i386/sco5.h +++ b/gcc/config/i386/sco5.h @@ -634,20 +634,32 @@ init_section () \ %{mcoff:crtendS.o%s} \ %{pg:gcrtn.o%s}%{!pg:crtn.o%s}" -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-Asystem=svr3" - -/* You are in a maze of GCC specs ... all alike */ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__unix"); \ + builtin_define ("_SCO_DS"); \ + builtin_define ("_M_I386"); \ + builtin_define ("_M_XENIX"); \ + builtin_define ("_M_UNIX"); \ + builtin_assert ("system=svr3"); \ + if (flag_iso) \ + cpp_define (pfile, "_STRICT_ANSI"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } \ + while (0) #undef CPP_SPEC #define CPP_SPEC "\ %{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \ %{fPIC:%{mcoff:%e-fPIC is not valid with -mcoff}} \ - -D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX \ %{!Xods30:-D_STRICT_NAMES} \ %{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \ - %{ansi:-isystem include/ansi%s -isystem /usr/include/ansi -D_STRICT_ANSI} \ + %{ansi:-isystem include/ansi%s -isystem /usr/include/ansi} \ %{!ansi: \ %{posix:-isystem include/posix%s -isystem /usr/include/posix \ -D_POSIX_C_SOURCE=2 -D_POSIX_SOURCE=1} \ @@ -664,8 +676,6 @@ init_section () \ %{scointl:-DM_INTERNAT -D_M_INTERNAT} \ %{!mcoff:-D_SCO_ELF} \ %{mcoff:-D_M_COFF -D_SCO_COFF} \ - %{!mcoff:%{fpic:-D__PIC__ -D__pic__} \ - %{fPIC:%{!fpic:-D__PIC__ -D__pic__}}} \ %{Xa:-D_SCO_C_DIALECT=1} \ %{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \ %{!Xc:%{Xk:-D_SCO_C_DIALECT=4} \ diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h index d860f11de48..c4ac740f50b 100644 --- a/gcc/config/i386/sol2.h +++ b/gcc/config/i386/sol2.h @@ -77,9 +77,26 @@ Boston, MA 02111-1307, USA. */ #define HANDLE_PRAGMA_REDEFINE_EXTNAME 1 -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-Dunix -D__svr4__ -D__SVR4 -Dsun -D__PRAGMA_REDEFINE_EXTNAME -Asystem=svr4" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("unix"); \ + builtin_define_std ("sun"); \ + builtin_define ("__svr4__"); \ + builtin_define ("__SVR4"); \ + builtin_define ("__PRAGMA_REDEFINE_EXTNAME"); \ + builtin_assert ("system=svr4"); \ + /* For C++ we must add some additional macros \ + required by the C++ standard library. */ \ + if (c_language == clk_cplusplus) \ + { \ + builtin_define ("_XOPEN_SOURCE=500"); \ + builtin_define ("_LARGEFILE_SOURCE=1"); \ + builtin_define ("_LARGEFILE64_SOURCE=1"); \ + builtin_define ("-D__EXTENSIONS__"); \ + } \ + } \ + while (0) /* Solaris 2/Intel as chokes on #line directives. */ #undef CPP_SPEC @@ -89,14 +106,6 @@ Boston, MA 02111-1307, USA. */ %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} \ %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}" -/* For C++ we need to add some additional macro definitions required - by the C++ standard library. */ -#define CPLUSPLUS_CPP_SPEC "\ --D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \ --D__EXTENSIONS__ \ -%(cpp) \ -" - #undef LIB_SPEC #define LIB_SPEC \ "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} \ diff --git a/gcc/config/i386/sysv4-cpp.h b/gcc/config/i386/sysv4-cpp.h new file mode 100644 index 00000000000..5b46bf1d945 --- /dev/null +++ b/gcc/config/i386/sysv4-cpp.h @@ -0,0 +1,32 @@ +/* Target definitions for GNU compiler for Intel 80386 running System V.4 + Copyright (C) 1991, 2001, 2002 Free Software Foundation, Inc. + + Written by Ron Guilmette (rfg@netcom.com). + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; 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 ("unix"); \ + builtin_define ("__svr4__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=svr4"); \ + } \ + while (0) + diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h index f877877cf23..6b3335e8923 100644 --- a/gcc/config/i386/sysv4.h +++ b/gcc/config/i386/sysv4.h @@ -31,12 +31,6 @@ Boston, MA 02111-1307, USA. */ (TYPE_MODE (TYPE) == BLKmode \ || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8)) -/* Define which macros to predefine. __svr4__ is our extension. */ -/* This used to define X86, but james@bigtex.cactus.org says that - is supposed to be defined optionally by user programs--not by default. */ -#define CPP_PREDEFINES \ - "-Dunix -D__svr4__ -Asystem=unix -Asystem=svr4" - /* Output at beginning of assembler file. */ /* The .file command should always begin the output. */ @@ -140,6 +134,3 @@ Boston, MA 02111-1307, USA. */ "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \ : "=d"(BASE)) #endif - -#undef CPP_SPEC -#define CPP_SPEC "" diff --git a/gcc/config/i386/vsta.h b/gcc/config/i386/vsta.h index 24e257324dd..93883295eb0 100644 --- a/gcc/config/i386/vsta.h +++ b/gcc/config/i386/vsta.h @@ -21,7 +21,12 @@ Boston, MA 02111-1307, USA. */ #define TARGET_VERSION fprintf (stderr, " (80386, BSD syntax)"); -#ifdef CPP_PREDEFINES -#undef CPP_PREDEFINES -#endif -#define CPP_PREDEFINES "-Dunix -DVSTA -Asystem=unix -Asystem=vsta" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("unix"); \ + builtin_define ("VSTA"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=vsta"); \ + } \ + while (0) diff --git a/gcc/config/i386/vxi386.h b/gcc/config/i386/vxi386.h index dafe46a198f..57e0662006d 100644 --- a/gcc/config/i386/vxi386.h +++ b/gcc/config/i386/vxi386.h @@ -21,28 +21,31 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (80386, VxWorks BSD syntax)"); -#undef CPP_CPU_SPEC -#define CPP_CPU_SPEC "\ --Asystem=unix -Acpu=i386 -Amachine=i386 \ -%{!ansi:-Di386} -D__i386 -D__i386__ \ -%{march=i386:-DCPU=I80386} \ -%{march=i486:-DCPU=I80486 %(cpp_486)} \ -%{march=pentium:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUM %(cpp_586)} \ -%{march=pentiumpro:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUMPRO %(cpp_686)} \ -%{!march=*: \ - %{mcpu=i386:-DCPU=I80386} \ - %{mcpu=i486:-DCPU=I80486 %(cpp_486)} %{m486:-DCPU=I80486 %(cpp_486)} \ - %{mpentium:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUM %(cpp_586)} \ - %{mcpu=pentium:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUM %(cpp_586)} \ - %{mpentiumpro:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUMPRO %(cpp_686)} \ - %{mcpu=pentiumpro:-DCPU=PENTIUM -DCPU_VARIANT=PENTIUMPRO %(cpp_686)} \ - %{!mcpu*:%{!m486:%{!mpentium*:-DCPU=I80386}}}}" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__vxworks"); \ + builtin_assert ("system=unix"); \ + \ + if (TARGET_386) \ + builtin_define ("CPU=I80386"); \ + else if (TARGET_486) \ + builtin_define ("CPU=I80486"); \ + else if (TARGET_PENTIUM) \ + { \ + builtin_define ("CPU=PENTIUM"); \ + builtin_define ("CPU_VARIANT=PENTIUM"); \ + } \ + else if (TARGET_PENTIUMPRO) \ + { \ + builtin_define ("CPU=PENTIUM"); \ + builtin_define ("CPU_VARIANT=PENTIUMPRO"); \ + } \ + } \ + while (0) #define HANDLE_SYSV_PRAGMA -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__vxworks" - /* VxWorks does all the library stuff itself. */ #undef LIB_SPEC diff --git a/gcc/config/i386/win32.h b/gcc/config/i386/win32.h index c03030b6d48..48b38877370 100644 --- a/gcc/config/i386/win32.h +++ b/gcc/config/i386/win32.h @@ -62,11 +62,24 @@ Boston, MA 02111-1307, USA. */ { "no-nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, "" }, -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D_WIN32 -DWINNT -D_X86_=1 \ - -D__stdcall=__attribute__((__stdcall__)) \ - -D__cdecl=__attribute__((__cdecl__)) \ - -Asystem=winnt" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_WIN32"); \ + builtin_define_std ("WINNT"); \ + builtin_define ("_X86_"); \ + builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ + builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ + builtin_assert ("system=winnt"); \ + if (TARGET_CYGWIN) \ + { \ + builtin_define ("__CYGWIN32__"); \ + builtin_define ("__CYGWIN__"); \ + } \ + else \ + builtin_define ("__MINGW32__"); \ + } \ + while (0) #undef STARTFILE_SPEC @@ -75,8 +88,7 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SPEC #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \ - %{!mcygwin:-iwithprefixbefore include/mingw32 -D__MINGW32__} \ - %{mcygwin:-D__CYGWIN32__ -D__CYGWIN__}" + %{!mcygwin:-iwithprefixbefore include/mingw32}" /* We have to dynamic link to get to the system DLLs. All of libc, libm and the Unix stuff is in cygwin.dll. The import library is called |