public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch]  Rework CPP_BUILTINS_SPEC for powerpc-vxworks
@ 2020-10-01  9:30 Olivier Hainque
  2020-10-02 22:43 ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: Olivier Hainque @ 2020-10-01  9:30 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 622 bytes --]

This change reworks CPP_BUILTINS_SPEC for powerpc-vxworks to
prepare for the upcoming addition of 32 and 64 bit ports for
VxWorks 7r2.

This has been used in gcc-9 based production compilers for a
year on both vxworks 7 and 6.9. Also passed a build & test sequence
for powerpc-vxworks 7 and 6.9 with gcc-10 and a sanity check build
with a recent mainline.

Will commit to mainline shortly.

Olivier

2020-10-01  Olivier Hainque  <hainque@adacore.com>

        * config/rs6000/vxworks.h (TARGET_OS_CPP_BUILTINS): Accommodate
        expectations from different versions of VxWorks, for 32 or 64bit
        configurations.


[-- Attachment #2: 0006-Augment-CPP_BUILTINS_SPEC-for-powerpc-vxworks.diff --]
[-- Type: application/octet-stream, Size: 2712 bytes --]

--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -26,21 +26,56 @@ along with GCC; see the file COPYING3.  If not see
 /* CPP predefined macros.  */
 
 #undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS()		\
-  do						\
-    {						\
-      builtin_define ("__ppc");			\
-      builtin_define ("__PPC__");		\
-      builtin_define ("__EABI__");		\
-      builtin_define ("__ELF__");		\
-      if (!TARGET_SOFT_FLOAT)			\
-	builtin_define ("__hardfp");		\
+#define TARGET_OS_CPP_BUILTINS()                \
+  do                                            \
+    {                                           \
+      /* CPU macros.  */			\
+      builtin_define ("__ppc");                 \
+      builtin_define ("__ppc__");               \
+      builtin_define ("__PPC");                 \
+      builtin_define ("__PPC__");               \
+      builtin_define ("__powerpc");             \
+      builtin_define ("__powerpc__");           \
+      if (TARGET_64BIT)                         \
+        {                                       \
+          builtin_define ("__ppc64");           \
+          builtin_define ("__ppc64__");         \
+          builtin_define ("__PPC64");		\
+          builtin_define ("__PPC64__");         \
+          builtin_define ("__powerpc64");	\
+          builtin_define ("__powerpc64__");     \
+	}					\
 						\
-      /* C89 namespace violation! */		\
-      builtin_define ("CPU_FAMILY=PPC");	\
-        					\
-      VXWORKS_OS_CPP_BUILTINS ();		\
-    }		\
+      /* 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 ("_WRS_HARDWARE_FP");  \
+        }                                       \
+						\
+      if (!TARGET_VXWORKS7)			\
+	{					\
+          builtin_define ("__EABI__");          \
+	  builtin_define ("__ELF__");           \
+          builtin_define ("CPU_FAMILY=PPC");	\
+	}					\
+						\
+      /* Common VxWorks and port items.  */	\
+      VXWORKS_OS_CPP_BUILTINS ();               \
+      TARGET_OS_SYSV_CPP_BUILTINS ();           \
+    }                                           \
   while (0)
 
 /* vx6 library path.  */
-- 
2.17.1


[-- Attachment #3: Type: text/plain, Size: 5 bytes --]







^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-14 10:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01  9:30 [patch] Rework CPP_BUILTINS_SPEC for powerpc-vxworks Olivier Hainque
2020-10-02 22:43 ` Segher Boessenkool
2020-10-05 17:27   ` Olivier Hainque
2020-10-13 13:35     ` Olivier Hainque
2020-10-13 15:38       ` Segher Boessenkool
2020-10-14 10:52         ` Olivier Hainque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).