public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] vxworks: Extract VX_CPU_PREFIX up into config/vxworks.h
@ 2020-10-27 14:47 Olivier Hainque
  0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2020-10-27 14:47 UTC (permalink / raw)
  To: GCC Patches

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

Hello,

This change moves the VX_CPU_PREFIX definition in
rs6000/vxworks.h to a place where it can be reused by
other target ports.

Committing after a successful build of both the ppc
and x86 ports (patch to come for the latter).


2020-10-21  Olivier Hainque  <hainque@adacore.com>
    
gcc/
    	* config/vxworks.h (VX_CPU_PREFIX): #define here.
    	* config/rs6000/vxworks.h: Remove #definition.


[-- Attachment #2: 0002-Extract-VX_CPU_PREFIX-up-into-config-vxworks.h.txt --]
[-- Type: text/plain, Size: 1599 bytes --]

diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index c5c32482d5e0..9dabdab323ab 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -97,18 +97,6 @@ along with GCC; see the file COPYING3.  If not see
     }		\
   while (0)
 
-/* Specific CPU macro definitions expected by the system headers,
-   inferred from -mcpu requests by the user.  Different versions of
-   VxWorks expect different forms of macros, such as
-
-   -D_VX_CPU=_VX_PPC403 on Vx7 and some variants of Vx6,
-   -DCPU=PPC403 on all Vx6 and earlier.  */
-
-#if TARGET_VXWORKS7
-#define VX_CPU_PREFIX "_VX_"
-#else
-#define VX_CPU_PREFIX ""
-#endif
 
 #define VX_CPUDEF(CPUID) \
   ":-D" VX_CPU_PREFIX "CPU=" VX_CPU_PREFIX #CPUID
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index b7e5970a8d87..e2ce22bec8b6 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -265,6 +265,18 @@ extern void vxworks_asm_out_destructor (rtx symbol, int priority);
     }									\
   while (0)
 
+/* For specific CPU macro definitions expected by the system headers,
+   different versions of VxWorks expect different forms of macros,
+   such as "_VX_CPU=..." on Vx7 and some variants of Vx6, or "CPU=..."
+   on all Vx6 and earlier.  Setup a common prefix macro here, that
+   arch specific ports can reuse.  */
+
+#if TARGET_VXWORKS7
+#define VX_CPU_PREFIX "_VX_"
+#else
+#define VX_CPU_PREFIX ""
+#endif
+
 #define VXWORKS_KIND VXWORKS_KIND_NORMAL
 
 /* The diab linker does not handle .gnu_attribute sections.  */
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-27 14:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 14:47 [patch] vxworks: Extract VX_CPU_PREFIX up into config/vxworks.h 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).