diff options
author | Jerome Lambourg <lambourg@adacore.com> | 2017-06-27 09:15:55 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2017-06-27 09:15:55 +0000 |
commit | 931fae8133c14bf6240ca3439cb6ba2af120ebfb (patch) | |
tree | 64f59637399617b7040bd846cc419f0e8ddafcb9 /gcc/config/vxworks.h | |
parent | f6b3ca5a1a04285c61283122e96c84563691d161 (diff) | |
download | gcc-931fae8133c14bf6240ca3439cb6ba2af120ebfb.zip gcc-931fae8133c14bf6240ca3439cb6ba2af120ebfb.tar.gz gcc-931fae8133c14bf6240ca3439cb6ba2af120ebfb.tar.bz2 |
vxworks.h (VXWORKS_LIB_SPEC): Incorporate ...
2017-06-27 Jerome Lambourg <lambourg@adacore.com>
Olivier Hainque <hainque@adacore.com>
* config/vxworks.h (VXWORKS_LIB_SPEC): Incorporate ...
(TLS_SYM): New local macro, forcing reference to __tls__ on
link command lines for VxWorks 7 RTPs, triggering initialization
of tlsLib.
(VXWORKS_HAVE_TLS): New macro. State whether the target VxWorks
OS features TLS support, true for RTPs on VxWorks 7.
* config/vxworks.c (vxworks_override_options): Setup emutls
accordingly.
Co-Authored-By: Olivier Hainque <hainque@adacore.com>
From-SVN: r249684
Diffstat (limited to 'gcc/config/vxworks.h')
-rw-r--r-- | gcc/config/vxworks.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 9afd332..e78ea28 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -81,16 +81,22 @@ along with GCC; see the file COPYING3. If not see 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. */ +/* On Vx7 RTP, we need to drag the __tls__ symbol to trigger initialization of + tlsLib, responsible for TLS support by the OS. */ + #if TARGET_VXWORKS7 #define VXWORKS_LIBS_DIR_RTP "-L%:getenv(VSB_DIR /usr/lib/common)" +#define TLS_SYM "-u __tls__" #else #define VXWORKS_LIBS_DIR_RTP "" +#define TLS_SYM "" #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} \ + " TLS_SYM " \ --start-group " VXWORKS_LIBS_RTP " --end-group} \ " VXWORKS_LIBS_DIR_RTP "}" @@ -126,6 +132,9 @@ along with GCC; see the file COPYING3. If not see #define VXWORKS_ENDFILE_SPEC "" /* Do VxWorks-specific parts of TARGET_OPTION_OVERRIDE. */ + +#define VXWORKS_HAVE_TLS (TARGET_VXWORKS7 && TARGET_VXWORKS_RTP) + #undef VXWORKS_OVERRIDE_OPTIONS #define VXWORKS_OVERRIDE_OPTIONS vxworks_override_options () extern void vxworks_override_options (void); |