diff options
author | Jerome Lambourg <lambourg@adacore.com> | 2019-11-14 15:53:23 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2019-11-14 15:53:23 +0000 |
commit | 78e49fb1bc69592389a09ce5544b40fef634e893 (patch) | |
tree | 6a4a42db11d921d3246820bf1f2cdc529af89bc2 /gcc/config | |
parent | ebcdba9c9f71e548e7506ecc8cb13139614b392e (diff) | |
download | gcc-78e49fb1bc69592389a09ce5544b40fef634e893.zip gcc-78e49fb1bc69592389a09ce5544b40fef634e893.tar.gz gcc-78e49fb1bc69592389a09ce5544b40fef634e893.tar.bz2 |
Introduce vxworks specific crtstuff support
2019-11-06 Jerome Lambourg <lambourg@adacore.com>
Olivier Hainque <hainque@adacore.com>
libgcc/
* config/vxcrtstuff.c: New file.
* config/t-vxcrtstuff: New Makefile fragment.
* config.host: Append t-vxcrtstuff to the tmake_file list
on all VxWorks ports using dwarf for table based EH.
gcc/
* config/vx-common.h (USE_TM_CLONE_REGISTRY): Remove
definition, pointless with a VxWorks specific version
of crtstuff.
(DWARF2_UNWIND_INFO): Conditionalize on !ARM_UNWIND_INFO.
* config/vxworks.h (VX_CRTBEGIN_SPEC, VX_CRTEND_SPEC):
New local macros, controlling the addition of vxworks specific
crtstuff objects depending on the EH mechanism and kind of
module being linked.
(VXWORKS_STARTFILE_SPEC, VXWORKS_ENDFILE_SPEC): Use them.
Co-Authored-By: Olivier Hainque <hainque@adacore.com>
From-SVN: r278248
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/vx-common.h | 21 | ||||
-rw-r--r-- | gcc/config/vxworks.h | 18 |
2 files changed, 29 insertions, 10 deletions
diff --git a/gcc/config/vx-common.h b/gcc/config/vx-common.h index 2cbec74..c76dccf 100644 --- a/gcc/config/vx-common.h +++ b/gcc/config/vx-common.h @@ -58,9 +58,21 @@ along with GCC; see the file COPYING3. If not see #undef WINT_TYPE_SIZE #define WINT_TYPE_SIZE 16 -/* Dwarf2 unwind info is supported. */ +/* Dwarf2 unwind info is supported, unless overriden by a request for a target + specific format. + + Taking care of this here allows using DWARF2_UNWIND_INFO in #if conditions + from the common config/vxworks.h files, included before the cpu + specializations. Unlike with conditions used in C expressions, where the + definitions which matter are those at the expression expansion point, use + in #if constructs requires an accurate definition of the operands at the + #if point. Since <cpu>/vxworks.h. is typically included after + config/vxworks.h, #if expressions in the latter can't rely on possible + redefinitions in the former. */ +#if !ARM_UNWIND_INFO #undef DWARF2_UNWIND_INFO #define DWARF2_UNWIND_INFO 1 +#endif /* VxWorks uses DWARF2 debugging info. */ #define DWARF2_DEBUGGING_INFO 1 @@ -87,10 +99,3 @@ along with GCC; see the file COPYING3. If not see /* We occasionally need to distinguish between the VxWorks variants. */ #define VXWORKS_KIND_NORMAL 1 #define VXWORKS_KIND_AE 2 - -/* - * libitm is not supported on VxWorks. Rather than providing stub - * no-op _ITM_registerTMCloneTable/_ITM_deregisterTMCloneTable - * functions, simply prevent crtstuff from even referring to those. - */ -#define USE_TM_CLONE_REGISTRY 0 diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 8c93a30..d7083b3 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -143,9 +143,23 @@ along with GCC; see the file COPYING3. If not see #undef VXWORKS_LIBGCC_SPEC #define VXWORKS_LIBGCC_SPEC "-lgcc" +/* Setup the crtstuff begin/end we might need for dwarf EH registration. */ + +#if !defined(CONFIG_SJLJ_EXCEPTIONS) && DWARF2_UNWIND_INFO +#define VX_CRTBEGIN_SPEC \ + "%{!mrtp:vx_crtbegin-kernel.o%s} %{mrtp:vx_crtbegin-rtp.o%s}" +#define VX_CRTEND_SPEC "-l:vx_crtend.o" +#else +#define VX_CRTBEGIN_SPEC "" +#define VX_CRTEND_SPEC "" +#endif + #undef VXWORKS_STARTFILE_SPEC -#define VXWORKS_STARTFILE_SPEC "%{mrtp:%{!shared:-l:crt0.o}}" -#define VXWORKS_ENDFILE_SPEC "" +#define VXWORKS_STARTFILE_SPEC \ + VX_CRTBEGIN_SPEC " %{mrtp:%{!shared:-l:crt0.o}}" + +#undef VXWORKS_ENDFILE_SPEC +#define VXWORKS_ENDFILE_SPEC VX_CRTEND_SPEC #undef VXWORKS_CC1_SPEC #if TARGET_VXWORKS7 |