Common ground work for vxworks7 ports updates

2019-11-06  Pat Bernardi  <bernardi@adacore.com>
            Jerome Lambourg  <lambourg@adacore.com>
            Olivier Hainque  <hainque@adacore.com>

	gcc/
	* config.gcc: Add comment to introduce the TARGET_VXWORKS
	commong macro definitions, conveying VXWORKS7 or 64bit general
	variations.  Add a block to set gcc_cv_initfini_array
	unconditionally to "yes" for VxWorks7.
	config/vx-common.h (VXWORKS_CC1_SPEC): New macro, empty string
	by default.  Update some comments.
	config/vxworks.h (VXWORKS_EXTRA_LIBS_RTP): New macro, empty by
	default, to be added the end of VXWORKS_LIBS_RTP.
	(VXWORKS_LIBS_RTP): Replace hardcoded part by VXWORKS_BASE_LIBS_RTP
	and append VXWORKS_EXTRA_LIBS_RTP, both of which specific ports may
	redefine.
	(VXWORKS_NET_LIBS_RTP): Account for VxWorks7 specificities.
	(VXWORKS_CC1_SPEC): Common base definition, with VxWorks7 variation
	to account for the now available TLS abilities.
	(TARGET_LIBC_HAS_FUNCTION): Account for VxWorks7 abilities.
	(VXWORKS_HAVE_TLS): Likewise.

Co-Authored-By: Jerome Lambourg <lambourg@adacore.com>
Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r278247
This commit is contained in:
Pat Bernardi 2019-11-14 15:45:50 +00:00 committed by Olivier Hainque
parent 60838d6346
commit ebcdba9c9f
4 changed files with 66 additions and 6 deletions

View File

@ -1,3 +1,24 @@
2019-11-06 Pat Bernardi <bernardi@adacore.com>
Jerome Lambourg <lambourg@adacore.com>
Olivier Hainque <hainque@adacore.com>
* config.gcc: Add comment to introduce the TARGET_VXWORKS
common macro definitions, conveying VXWORKS7 or 64bit general
variations. Add a block to set gcc_cv_initfini_array
unconditionally to "yes" for VxWorks7.
config/vx-common.h (VXWORKS_CC1_SPEC): New macro, empty string
by default. Update some comments.
config/vxworks.h (VXWORKS_EXTRA_LIBS_RTP): New macro, empty by
default, to be added the end of VXWORKS_LIBS_RTP.
(VXWORKS_LIBS_RTP): Replace hardcoded part by VXWORKS_BASE_LIBS_RTP
and append VXWORKS_EXTRA_LIBS_RTP, both of which specific ports may
redefine.
(VXWORKS_NET_LIBS_RTP): Account for VxWorks7 specificities.
(VXWORKS_CC1_SPEC): Common base definition, with VxWorks7 variation
to account for the now available TLS abilities.
(TARGET_LIBC_HAS_FUNCTION): Account for VxWorks7 abilities.
(VXWORKS_HAVE_TLS): Likewise.
2019-11-14 Richard Sandiford <richard.sandiford@arm.com>
* tree-vect-slp.c (vect_contains_pattern_stmt_p): New function.

View File

@ -962,6 +962,11 @@ case ${target} in
"" | yes | vxworks) thread_file='vxworks' ;;
*) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
esac
# A few common macro definitions conveying general characteristics
# of the configuration at hand. Note that by VxWorks 7, we mean the
# the SR6xx major update or beyond in vendor parlance:
case $target in
*-*-vxworks7*)
tm_defines="$tm_defines TARGET_VXWORKS7=1"
@ -972,6 +977,18 @@ case ${target} in
tm_defines="$tm_defines TARGET_VXWORKS64=1"
;;
esac
# Then a few build configuration controls for VxWorks 7, which
# has specificities on top of which we aim to provide more complete
# C++ support:
case $target in
*-*-vxworks7*)
# VxWorks 7 always has init/fini_array support and it is simpler to
# just leverage this, sticking to what the system toolchain does:
gcc_cv_initfini_array=yes
;;
esac
;;
*-*-elf|arc*-*-elf*)
# Assume that newlib is being used and so __cxa_atexit is provided.

View File

@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#define VXWORKS_LIBGCC_SPEC ""
#define VXWORKS_STARTFILE_SPEC ""
#define VXWORKS_ENDFILE_SPEC ""
#define VXWORKS_CC1_SPEC ""
/* VxWorks cannot have dots in constructor labels, because it uses a
mutant variation of collect2 that generates C code instead of
@ -61,7 +62,7 @@ along with GCC; see the file COPYING3. If not see
#undef DWARF2_UNWIND_INFO
#define DWARF2_UNWIND_INFO 1
/* VxWorks uses DWARF2. */
/* VxWorks uses DWARF2 debugging info. */
#define DWARF2_DEBUGGING_INFO 1
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG

View File

@ -78,10 +78,23 @@ along with GCC; see the file COPYING3. If not see
#define VXWORKS_SYSCALL_LIBS_RTP
#if TARGET_VXWORKS7
#define VXWORKS_NET_LIBS_RTP "-lnet"
#else
#define VXWORKS_NET_LIBS_RTP "-lnet -ldsi"
#endif
#define VXWORKS_BASE_LIBS_RTP "-lc -lgcc -lc_internal"
#define VXWORKS_EXTRA_LIBS_RTP
#define VXWORKS_LIBS_RTP \
VXWORKS_SYSCALL_LIBS_RTP " " VXWORKS_NET_LIBS_RTP " -lc -lgcc -lc_internal"
VXWORKS_SYSCALL_LIBS_RTP " " VXWORKS_NET_LIBS_RTP " " \
VXWORKS_BASE_LIBS_RTP " " VXWORKS_EXTRA_LIBS_RTP
/* TLS configuration. VxWorks 7 now always has proper TLS support.
Earlier versions did not, not even for RTPS. */
#define VXWORKS_HAVE_TLS TARGET_VXWORKS7
/* 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
@ -134,10 +147,15 @@ along with GCC; see the file COPYING3. If not see
#define VXWORKS_STARTFILE_SPEC "%{mrtp:%{!shared:-l:crt0.o}}"
#define VXWORKS_ENDFILE_SPEC ""
#undef VXWORKS_CC1_SPEC
#if TARGET_VXWORKS7
#define VXWORKS_CC1_SPEC \
"%(cc1_cpu) %{!mrtp:%{!ftls-model=*:-ftls-model=local-exec}}"
#else
#define VXWORKS_CC1_SPEC ""
#endif
/* 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);
@ -179,8 +197,11 @@ extern void vxworks_asm_out_destructor (rtx symbol, int priority);
#undef SIZE_TYPE
#define SIZE_TYPE (TARGET_VXWORKS64 ? "long unsigned int" : "unsigned int")
/* Assumptions on the target libc. VxWorks 7, post SR600, provides a C11
runtime without sincos support. */
#undef TARGET_LIBC_HAS_FUNCTION
#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
#define TARGET_LIBC_HAS_FUNCTION \
(TARGET_VXWORKS7 ? default_libc_has_function : no_c99_libc_has_function)
/* Both kernels and RTPs have the facilities required by this macro. */
#define TARGET_POSIX_IO