diff options
author | Olivier Hainque <hainque@adacore.com> | 2021-11-26 21:37:46 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@adacore.com> | 2021-12-13 13:54:01 +0000 |
commit | f3f923e51391d279adace7ae24260d87e94b1108 (patch) | |
tree | 8dc16865ed3772d51c706522289ff5d376124731 /libgcc/config/t-vxworks | |
parent | 7bf710b5116e6186204edd6a0168202fd8ef0389 (diff) | |
download | gcc-f3f923e51391d279adace7ae24260d87e94b1108.zip gcc-f3f923e51391d279adace7ae24260d87e94b1108.tar.gz gcc-f3f923e51391d279adace7ae24260d87e94b1108.tar.bz2 |
Leverage sysroot for VxWorks
The build of a VxWorks toolchain relies a lot on system headers
and VxWorks has a few very specific features that require special
processing. For example, different sets of headers for the kernel
vs the rtp modes, which the compiler knows about by way of -mrtp
on the command line.
If we manage to avoid the need for fixincludes on recent versions
of VxWorks (>= 7), we still need to handle at least VxWorks 6.9 at
this stage.
We sort of get away with locating the correct headers at
run-time thanks to environment variables and various tests for
-mrtp in cpp specs, but getting fixincludes to work for old
configurations has always been tricky and getting a toolchain
to build with c++/libstdc++ support gets trickier with every
move to a more recent release.
sysroot_headers_suffix_spec is a pretty powerful device to help
address such issues, and this patch introduces changes that let
us get advantage of it.
The general idea is to leverage the assumption that compilations
occur with --sysroot=$VSB_DIR on vx7 or --sysroot=$WIND_BASE/target
prior to that.
For the toolchains we build, this is achieved with a few
configure options like:
--with-sysroot
--with-build-sysroot=${WIND_BASE}/target
--with-specs=%{!sysroot=*:--sysroot=%:getenv(WIND_BASE /target)}
This also allows simplifying the libgcc compilation flags control
and we take the opportunity to merge t-vxworks7 into t-vxworks as
the two files were differing only on the libgcc2 flags part.
2021-12-09 Olivier Hainque <hainque@adacore.com>
gcc/
* config/t-vxworks: Clear NATIVE_SYSTEM_HEADER_DIR.
* config/vxworks.h (SYSROOT_HEADERS_SUFFIX_SPEC): Define, for
VxWorks 7 and earlier.
(VXWORKS_ADDITIONAL_CPP_SPEC): Simplify accordingly.
(STARTFILE_PREFIX_SPEC): Adjust accordingly.
* config/rs6000/vxworks.h (STARTFILE_PREFIX_SPEC): Adjust.
libgcc/
* config/t-vxworks (LIBGCC2_INCLUDES): Simplify and handle
both VxWorks7 and earlier.
* config/t-vxworks7: Remove.
* config.host: Remove special case for vxworks7.
Diffstat (limited to 'libgcc/config/t-vxworks')
-rw-r--r-- | libgcc/config/t-vxworks | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks index 5f7ced8..aa79474 100644 --- a/libgcc/config/t-vxworks +++ b/libgcc/config/t-vxworks @@ -13,9 +13,8 @@ LIB2FUNCS_EXCLUDE += _clear_cache LIBGCC2_INCLUDES = -nostdinc -I. \ -I$(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \ -I$(MULTIBUILDTOP)../../gcc/include \ - `case "/$(MULTIDIR)" in \ - */mrtp*) echo -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip ;; \ - *) echo -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip ;; \ - esac` + $(if $(findstring vxworks7, $(target_noncanonical)), \ + -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h -I=/system -I=/public, \ + -I=/ -I=/wrn/coreip) CRTSTUFF_T_CFLAGS = $(LIBGCC2_INCLUDES) |