aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vxworks.h
diff options
context:
space:
mode:
authorJerome Lambourg <lambourg@adacore.com>2017-06-26 17:04:44 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2017-06-26 17:04:44 +0000
commitb269e8998d5cc47d010d915aba548fa0ae2d8bf8 (patch)
tree5b8d472b1c2441c5158c12717e7582f21ba44bb6 /gcc/config/vxworks.h
parentd6ef53f2413b5fde30a6d9516c4ebf087e6a4363 (diff)
downloadgcc-b269e8998d5cc47d010d915aba548fa0ae2d8bf8.zip
gcc-b269e8998d5cc47d010d915aba548fa0ae2d8bf8.tar.gz
gcc-b269e8998d5cc47d010d915aba548fa0ae2d8bf8.tar.bz2
config.gcc (*-*-vxworks*): Add TARGET_VXWORKS7=1 to tm_defines for all vxworks7 targets.
2017-06-26 Jerome Lambourg <lambourg@adacore.com> Olivier Hainque <hainque@adacore.com> * config.gcc (*-*-vxworks*): Add TARGET_VXWORKS7=1 to tm_defines for all vxworks7 targets. * config/vxworks.h (TARGET_VXWORKS7): If not defined, define to 0. (VXWORKS_ADDITIONAL_CPP_SPEC): Alternative definition for VXWORKS7. (VXWORKS_LIBS_RTP, VXWORKS_LIBS_RTP_DIR): New macros, allowing variations for VX6/VX7 and 32/64bits later on in ... (VXWORKS_LIB_SPEC): Leverage new macros. (VXWORKS_OS_CPP_BUILTINS): Define _VSB_CONFIG_FILE for VXWORKS7, as well as _ALLOW_KEYWORD_MACROS when "inline" is not a keyword. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r249659
Diffstat (limited to 'gcc/config/vxworks.h')
-rw-r--r--gcc/config/vxworks.h53
1 files changed, 51 insertions, 2 deletions
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index d16c84d..11d811c 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -23,6 +23,11 @@ along with GCC; see the file COPYING3. If not see
#undef TARGET_VXWORKS
#define TARGET_VXWORKS 1
+/* If TARGET_VXWORKS7 is undefined, then we're not targeting it. */
+#ifndef TARGET_VXWORKS7
+#define TARGET_VXWORKS7 0
+#endif
+
/* In kernel mode, VxWorks provides all the libraries itself, as well as
the functionality of startup files, etc. In RTP mode, it behaves more
like a traditional Unix, with more external files. Most of our specs
@@ -36,6 +41,23 @@ along with GCC; see the file COPYING3. If not see
/* Since we provide a default -isystem, expand -isystem on the command
line early. */
+#if TARGET_VXWORKS7
+
+#undef VXWORKS_ADDITIONAL_CPP_SPEC
+#define VXWORKS_ADDITIONAL_CPP_SPEC \
+ "%{!nostdinc: \
+ %{isystem*} \
+ %{mrtp: -idirafter %:getenv(VSB_DIR /h) \
+ -idirafter %:getenv(VSB_DIR /share/h) \
+ -idirafter %:getenv(VSB_DIR /usr/h/public) \
+ -idirafter %:getenv(VSB_DIR /usr/h) \
+ ;: -idirafter %:getenv(VSB_DIR /h) \
+ -idirafter %:getenv(VSB_DIR /share/h) \
+ -idirafter %:getenv(VSB_DIR /krnl/h/system) \
+ -idirafter %:getenv(VSB_DIR /krnl/h/public)}}"
+
+#else /* TARGET_VXWORKS7 */
+
#undef VXWORKS_ADDITIONAL_CPP_SPEC
#define VXWORKS_ADDITIONAL_CPP_SPEC \
"%{!nostdinc: \
@@ -43,14 +65,30 @@ along with GCC; see the file COPYING3. If not see
%{mrtp: %:getenv(WIND_USR /h) \
;: %:getenv(WIND_BASE /target/h)}}"
+#endif
+
/* The references to __init and __fini will be satisfied by
libc_internal.a. */
+
+#define VXWORKS_LIBS_RTP "-lc -lgcc -lc_internal -lnet -ldsi"
+
+/* On Vx6 and previous, the libraries to pick up depends on the architecture,
+ so cannot be defined for all archs at once. On Vx7, a VSB is always needed
+ and its structure is fixed and does not depend on the arch. We can thus
+ tell gcc where to look for when linking with RTP libraries. */
+
+#if TARGET_VXWORKS7
+#define VXWORKS_LIBS_DIR_RTP "-L%:getenv(VSB_DIR /usr/lib/common)"
+#else
+#define VXWORKS_LIBS_DIR_RTP ""
+#endif
+
#undef VXWORKS_LIB_SPEC
#define VXWORKS_LIB_SPEC \
"%{mrtp:%{shared:-u " USER_LABEL_PREFIX "__init -u " USER_LABEL_PREFIX "__fini} \
%{!shared:%{non-static:-u " USER_LABEL_PREFIX "_STI__6__rtld -ldl} \
- --start-group -lc -lgcc -lc_internal -lnet -ldsi \
- --end-group}}"
+ --start-group " VXWORKS_LIBS_RTP " --end-group} \
+ " VXWORKS_LIBS_DIR_RTP "}"
/* The no-op spec for "-shared" below is present because otherwise GCC
will treat it as an unrecognized option. */
@@ -133,6 +171,17 @@ extern void vxworks_asm_out_destructor (rtx symbol, int priority);
builtin_define ("_WRS_KERNEL"); \
builtin_define ("_VX_TOOL_FAMILY=gnu"); \
builtin_define ("_VX_TOOL=gnu"); \
+ if (TARGET_VXWORKS7) \
+ { \
+ builtin_define ("_VSB_CONFIG_FILE=<config/vsbConfig.h>"); \
+ \
+ /* _ALLOW_KEYWORD_MACROS is needed on VxWorks 7 to \
+ prevent compilation failures triggered by our \
+ definition of "inline" in ansidecl when "inline" \
+ is not a keyword. */ \
+ if (!flag_isoc99 && !c_dialect_cxx()) \
+ builtin_define ("_ALLOW_KEYWORD_MACROS"); \
+ } \
} \
while (0)