From: Neil Booth Date: Wed, 5 Jun 2002 17:01:31 +0000 (+0000) Subject: gnu.h: Undef TARGET_OS_CPP_BUILTINS. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f23a084df7341350693b43f1bee2317a35cbcd8d;p=gcc.git gnu.h: Undef TARGET_OS_CPP_BUILTINS. config: * alpha/gnu.h: Undef TARGET_OS_CPP_BUILTINS. * i386/beos-elf.h: Use TARGET_OS_CPP_BUILTINS rather than CPP_PREDEFINES and part of CPP_SPEC. i386/freebsd-aout.h, i386/gas.h, i386/gnu.h, i386/linux-aout.h, i386/linux.h, i386/moss.h, i386/xm-vsta.h: Similarly. From-SVN: r54286 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3b9651c5c64..d6c942ab23d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-06-05 Neil Booth + +config: + * alpha/gnu.h: Undef TARGET_OS_CPP_BUILTINS. + * i386/beos-elf.h: Use TARGET_OS_CPP_BUILTINS rather than + CPP_PREDEFINES and part of CPP_SPEC. + i386/freebsd-aout.h, i386/gas.h, i386/gnu.h, i386/linux-aout.h, + i386/linux.h, i386/moss.h, i386/xm-vsta.h: Similarly. + Wed Jun 5 15:20:58 CEST 2002 Jan Hubicka * reg-stack.c (reg_to_stack): Do not call find_basic_blocks. diff --git a/gcc/config/i386/beos-elf.h b/gcc/config/i386/beos-elf.h index e7613b86af1..7f9c2e2edec 100644 --- a/gcc/config/i386/beos-elf.h +++ b/gcc/config/i386/beos-elf.h @@ -67,17 +67,26 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 16 - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__ELF__ -D__BEOS__ -D__INTEL__ -D_X86_=1 \ --D__stdcall=__attribute__((__stdcall__)) \ --D__cdecl=__attribute__((__cdecl__)) \ --D__declspec(x)=__attribute__((x)) \ --Asystem=beos" - -#undef CPP_SPEC -#define CPP_SPEC "%{!no-fPIC:%{!no-fpic:-D__PIC__ -D__pic__}}" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__ELF__"); \ + builtin_define ("__BEOS__"); \ + builtin_define ("__INTEL__"); \ + builtin_define ("_X86_"); \ + builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ + builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ + builtin_define ("__declspec(x)=__attribute__((x))"); \ + builtin_assert ("system=beos"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } \ + while (0) + /* BeOS uses lots of multichars, so don't warn about them unless the user explicitly asks for the warnings with -Wmultichar. Note that CC1_SPEC is used for both cc1 and cc1plus. */ diff --git a/gcc/config/i386/freebsd-aout.h b/gcc/config/i386/freebsd-aout.h index 7f8a4fe811c..c5ce80a1118 100644 --- a/gcc/config/i386/freebsd-aout.h +++ b/gcc/config/i386/freebsd-aout.h @@ -37,9 +37,16 @@ Boston, MA 02111-1307, USA. */ defaults.h works. */ #undef ASM_PREFERRED_EH_DATA_FORMAT -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -D__FreeBSD__\ - -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("unix"); \ + builtin_define ("__FreeBSD__"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=bsd"); \ + builtin_assert ("system=FreeBSD"); \ + } \ + while (0) /* Like the default, except no -lg. */ #define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}" diff --git a/gcc/config/i386/gas.h b/gcc/config/i386/gas.h index c627775a860..1f9de018821 100644 --- a/gcc/config/i386/gas.h +++ b/gcc/config/i386/gas.h @@ -45,11 +45,6 @@ Boston, MA 02111-1307, USA. */ #define SDB_DEBUGGING_INFO -/* Specify predefined symbols in preprocessor. */ - -#define CPP_PREDEFINES "-Dunix" -#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" - /* Allow #sccs in preprocessor. */ #define SCCS_DIRECTIVE diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h index 50e01956038..acf2d3fdac8 100644 --- a/gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h @@ -3,14 +3,29 @@ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (i386 GNU)"); -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__ELF__ -DMACH -Asystem=mach \ - -Dunix -Asystem=unix -Asystem=posix -D__gnu_hurd__ -D__GNU__ -Asystem=gnu" +#undef TARGET_OS_CPP_BUILTINS /* config.gcc includes i386/linux.h. */ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("MACH"); \ + builtin_define_std ("unix"); \ + builtin_define ("__ELF__"); \ + builtin_define ("__GNU__"); \ + builtin_define ("__gnu_hurd__"); \ + builtin_assert ("system=gnu"); \ + builtin_assert ("system=mach"); \ + builtin_assert ("system=posix"); \ + builtin_assert ("system=unix"); \ + 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} %{bsd:-D_BSD_SOURCE}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}" #undef CC1_SPEC #define CC1_SPEC "%(cc1_cpu)" diff --git a/gcc/config/i386/linux-aout.h b/gcc/config/i386/linux-aout.h index 51203cda3e5..783b8a946ed 100644 --- a/gcc/config/i386/linux-aout.h +++ b/gcc/config/i386/linux-aout.h @@ -23,13 +23,23 @@ Boston, MA 02111-1307, USA. */ #undef ASM_COMMENT_START #define ASM_COMMENT_START "#" -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-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_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}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index 232a9eec5e4..3bc20fe5410 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -80,14 +80,27 @@ Boston, MA 02111-1307, USA. */ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -#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 ("__ELF__"); \ + builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=posix"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } \ + while (0) #undef CPP_SPEC #ifdef USE_GNULIBC_1 -#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" #else -#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}" #endif #undef CC1_SPEC diff --git a/gcc/config/i386/moss.h b/gcc/config/i386/moss.h index 200cae0edcc..642c625a395 100644 --- a/gcc/config/i386/moss.h +++ b/gcc/config/i386/moss.h @@ -19,8 +19,20 @@ 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. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__ELF__ -Dmoss -Asystem=posix" +#undef TARGET_OS_CPP_BUILTINS /* config.gcc includes i386/linux.h. */ +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("moss"); \ + builtin_define ("__ELF__"); \ + builtin_assert ("system=posix"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } \ + while (0) #undef STARTFILE_SPEC #define STARTFILE_SPEC "crt0.o%s" diff --git a/gcc/config/i386/xm-vsta.h b/gcc/config/i386/xm-vsta.h index 735d1d51943..53943eaf7da 100644 --- a/gcc/config/i386/xm-vsta.h +++ b/gcc/config/i386/xm-vsta.h @@ -1,2 +1,11 @@ /* Use semicolons to separate elements of a path. */ #define PATH_SEPARATOR ';' + +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("unix"); \ + } \ + while (0) + +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"