aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2020-10-13 10:31:36 +0000
committerOlivier Hainque <hainque@adacore.com>2020-10-14 17:38:38 +0000
commit5b00bcc5432dc494c70f85ee717e4ecc47e7fcae (patch)
tree0ca57ff22b35a389d90a532efcb3a27629d8901b
parentd00f8b405679e2744e7a9789a7a6eaa6e2f21d78 (diff)
downloadgcc-5b00bcc5432dc494c70f85ee717e4ecc47e7fcae.zip
gcc-5b00bcc5432dc494c70f85ee717e4ecc47e7fcae.tar.gz
gcc-5b00bcc5432dc494c70f85ee717e4ecc47e7fcae.tar.bz2
Rework CPP_BUILTINS_SPEC for powerpc-vxworks
This change reworks CPP_BUILTINS_SPEC for powerpc-vxworks to prepare for the upcoming addition of 32 and 64 bit ports for VxWorks 7r2. 2020-10-14 Olivier Hainque <hainque@adacore.com> gcc/ * config/rs6000/vxworks.h (TARGET_OS_CPP_BUILTINS): Accommodate expectations from different versions of VxWorks, for 32 or 64bit configurations.
-rw-r--r--gcc/config/rs6000/vxworks.h57
1 files changed, 50 insertions, 7 deletions
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index 771dddf..60e1ef4 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -29,17 +29,60 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__ppc"); \
- builtin_define ("__PPC__"); \
- builtin_define ("__EABI__"); \
builtin_define ("__ELF__"); \
+ if (!TARGET_VXWORKS7) \
+ builtin_define ("__EABI__"); \
+ \
+ /* CPU macros, based on what the system compilers do. */ \
+ if (!TARGET_VXWORKS7) \
+ { \
+ builtin_define ("__ppc"); \
+ /* Namespace violation below, but the system headers \
+ really depend heavily on this. */ \
+ builtin_define ("CPU_FAMILY=PPC"); \
+ \
+ /* __PPC__ isn't actually emitted by the system compiler \
+ prior to vx7 but has been advertised by us for ages. */ \
+ builtin_define ("__PPC__"); \
+ } \
+ else \
+ { \
+ builtin_define ("__PPC__"); \
+ builtin_define ("__powerpc__"); \
+ if (TARGET_64BIT) \
+ { \
+ builtin_define ("__PPC64__"); \
+ builtin_define ("__powerpc64__"); \
+ } \
+ else \
+ { \
+ builtin_define ("__PPC"); \
+ builtin_define ("__powerpc"); \
+ } \
+ } \
+ \
+ /* Asserts for #cpu and #machine. */ \
+ if (TARGET_64BIT) \
+ { \
+ builtin_assert ("cpu=powerpc64"); \
+ builtin_assert ("machine=powerpc64"); \
+ } \
+ else \
+ { \
+ builtin_assert ("cpu=powerpc"); \
+ builtin_assert ("machine=powerpc"); \
+ } \
+ \
+ /* PowerPC VxWorks specificities. */ \
if (!TARGET_SOFT_FLOAT) \
- builtin_define ("__hardfp"); \
+ { \
+ builtin_define ("__hardfp"); \
+ builtin_define ("_WRS_HARDWARE_FP"); \
+ } \
\
- /* C89 namespace violation! */ \
- builtin_define ("CPU_FAMILY=PPC"); \
- \
+ /* Common VxWorks and port items. */ \
VXWORKS_OS_CPP_BUILTINS (); \
+ TARGET_OS_SYSV_CPP_BUILTINS (); \
} \
while (0)