aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/vxworks.h
diff options
context:
space:
mode:
authorMarc Poulhiès <poulhies@adacore.com>2022-01-04 14:56:27 +0000
committerOlivier Hainque <hainque@adacore.com>2022-10-02 09:25:39 +0000
commit2f26f5b584856927337728ddc598c44f1426fa32 (patch)
tree1b706f0eb77919e7b38f409f57b097a0dd00542e /gcc/config/vxworks.h
parent372044a67ec8346f4f308c5fe79d9e1cb6e7e6c6 (diff)
downloadgcc-2f26f5b584856927337728ddc598c44f1426fa32.zip
gcc-2f26f5b584856927337728ddc598c44f1426fa32.tar.gz
gcc-2f26f5b584856927337728ddc598c44f1426fa32.tar.bz2
Define GCC_DRIVER_HOST_INITIALIZATION for VxWorks targets
We need to perform static links by default on VxWorks, where the use of shared libraries involves unusual steps compared to standard native systems. This has to be conveyed before the lang_specific_driver code gets invoked (in particular for g++), so specs aren't available. This change defines the GCC_DRIVER_HOST_INITIALIZATION macro for VxWorks, to insert a -static option in case the user hasn't provided any explicit indication on the command line of the kind of link desired. While a HOST macro doesn't seem appropriate to control a target OS driven behavior, this matches other uses and won't conflict as VxWorks is not supported on any of the other configurations using this macro. gcc/ * config/vxworks-driver.cc: New. * config.gcc (*vxworks*): Add vxworks-driver.o in extra_gcc_objs. * config/t-vxworks: Add vxworks-driver.o. * config/vxworks.h (GCC_DRIVER_HOST_INITIALIZATION): New.
Diffstat (limited to 'gcc/config/vxworks.h')
-rw-r--r--gcc/config/vxworks.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index f2103de..84a9c93 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -28,6 +28,16 @@ along with GCC; see the file COPYING3. If not see
#undef TARGET_VXWORKS
#define TARGET_VXWORKS 1
+/* ??? Even though assigned to a HOST driver hook, this function
+ operates for all vxworks targets regardless of the current host.
+ We will get warnings at build time if the macro happens to be
+ redefined one way or another for a host. */
+struct cl_decoded_option;
+extern void vxworks_driver_init (unsigned int *, struct cl_decoded_option **);
+
+#define GCC_DRIVER_HOST_INITIALIZATION \
+ vxworks_driver_init (&decoded_options_count, &decoded_options)
+
/* 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