/* 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. */
+/* The VxWorks personality we rely on for VxWorks prior to 7, controlling the
+ definition of TOOL and TOOL_FAMILY macros used within system headers and
+ expected to match the kind of system toolchain on which the OS instance is
+ based (typically, gnu or llvm). This might be redefined on targets where
+ the base VxWorks environment doesn't come with a GNU toolchain.
+
+ From VxWorks 7 on, the actual personality might vary for different instances
+ for a given architecture. The TOOL/TOOL_FAMILY definitions are infered at
+ run-time from vxworks-predef.h, which allows accommodating such variations
+ with a single toolchain. */
#define VXWORKS_PERSONALITY "gnu"
builtin_define ("__RTP__"); \
else \
builtin_define ("_WRS_KERNEL"); \
- builtin_define ("TOOL_FAMILY=" VXWORKS_PERSONALITY); \
- builtin_define ("TOOL=" VXWORKS_PERSONALITY); \
if (TARGET_VXWORKS7) \
{ \
builtin_define ("_VSB_CONFIG_FILE=<config/vsbConfig.h>"); \
if (!flag_isoc99 && !c_dialect_cxx()) \
builtin_define ("_ALLOW_KEYWORD_MACROS"); \
} \
+ else \
+ { \
+ builtin_define ("TOOL_FAMILY=" VXWORKS_PERSONALITY); \
+ builtin_define ("TOOL=" VXWORKS_PERSONALITY); \
+ } \
/* C++ support relies on C99 features from C++11, even C++98 \
for listdc++ in particular, with corresponding checks at \
configure time. Make sure C99 features are exposed by the \
that the OS actually defines it as. */
#define __STDC_ISO_10646__ 200009L
+/* If we have a designated VSB configuration file, fetch the associated
+ auto configuration header from which we can infer the TOOL and TOOL_FAMILY
+ that other system headers expect. */
+
+#if defined(_VSB_CONFIG_FILE)
+
+#undef TOOL
+#undef TOOL_FAMILY
+
+#include <config/autoconf.h>
+
+#if defined(_WRS_CONFIG_PRI_llvm)
+#define TOOL_FAMILY llvm
+#elif defined(_WRS_CONFIG_PRI_gnu)
+#define TOOL_FAMILY gnu
+#endif
+
+#define TOOL TOOL_FAMILY
+
+#endif /* _VSB_CONFIG_FILE */
+
#endif
# paths differs between Windows and Linux hosts as the latter can perform
# inode based checks while the former may only rely on name comparisons.
-LIBGCC2_INCLUDES = -nostdinc -I. \
+LIBGCC2_INCLUDES = -nostdinc -include vxworks-predef.h -I. \
$(if $(findstring vxworks7, $(target_noncanonical)), \
-I$(VSB_DIR)/h -I$(VSB_DIR)/share/h -I=/system -I=/public, \
-I=/ -I=/wrn/coreip) \