diff mbox series

Introduce VXWORKS_PERSONALITY

Message ID FDE6CAE6-6B4C-4EE0-B84F-2C756065F296@adacore.com
State New
Headers show
Series Introduce VXWORKS_PERSONALITY | expand

Commit Message

Olivier Hainque Oct. 29, 2018, 2:29 p.m. UTC
Hello,

This patch simply makes explicit the notion of VxWorks
"personality" on which a given port relies, which controls
conditional parts exposed by the system headers, depending
on the kind of system compiler used to build the VxWorks
kernel on which we expect programs will run.

This defaults to "gnu" as the vast majority of VxWorks
environments we target come which GNU toolchains and this
is our natural interface.

I checked that I could build functional toolchains based on
gcc-8, passing Ada ACATS in two modes for two targets: powerpc
which uses a gnu personality, and aarch64 (port to be
contributed shortly) which comes with only an llvm system compiler
at this stage.

This exercises quite a bit of the Ada runtime system, several
parts of which interface with OS services through a C layer.

Testing exposed that the _VX_TOOL/_VX_TOOL_FAMILY pair is
more typically inferred from the TOOL/TOOL_FAMILY pair within the
system headers, not always vice-versa, so this patch arranges to
#define the latter instead of the former.

Olivier

2018-10-29  Olivier Hainque  <hainque@adacore.com>

	* config/vxworks.h (VXWORKS_PERSONALITY): New VxWorks
	ports configuration macro, defaults to "gnu".
	(VXWORKS_OS_CPP_BUILTINS): Use it. Feed TOOL and
	TOOL_FAMILY instead of _VX_TOOL/_VXTOOL_FAMILY.
From c70c245919209a4ae6dd1278fd87a5a652960d7d Mon Sep 17 00:00:00 2001
From: Olivier Hainque <hainque@adacore.com>
Date: Fri, 19 Oct 2018 18:47:19 +0200
Subject: [PATCH 1/4] Introduce VXWORKS_PERSONALITY

---
 gcc/config/vxworks.h |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index 656ced5..3e5506e 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -169,6 +169,13 @@  extern void vxworks_asm_out_destructor (rtx symbol, int priority);
 #define TARGET_POSIX_IO
 
 /* A VxWorks implementation of TARGET_OS_CPP_BUILTINS.  */
+
+/* The VxWorks personality we rely on, controlling which sections of system
+   headers files we trigger.  This might be redefined on targets where the
+   base VxWorks environment doesn't come with a GNU toolchain.  */
+
+#define VXWORKS_PERSONALITY "gnu"
+
 #define VXWORKS_OS_CPP_BUILTINS()					\
   do									\
     {									\
@@ -179,8 +186,8 @@  extern void vxworks_asm_out_destructor (rtx symbol, int priority);
 	builtin_define ("__RTP__");					\
       else								\
 	builtin_define ("_WRS_KERNEL");					\
-      builtin_define ("_VX_TOOL_FAMILY=gnu");				\
-      builtin_define ("_VX_TOOL=gnu");					\
+      builtin_define ("TOOL_FAMILY=" VXWORKS_PERSONALITY);		\
+      builtin_define ("TOOL=" VXWORKS_PERSONALITY);			\
       if (TARGET_VXWORKS7)						\
         {								\
            builtin_define ("_VSB_CONFIG_FILE=<config/vsbConfig.h>");	\