aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2021-11-26 21:37:46 +0000
committerOlivier Hainque <hainque@adacore.com>2021-12-13 13:54:01 +0000
commitf3f923e51391d279adace7ae24260d87e94b1108 (patch)
tree8dc16865ed3772d51c706522289ff5d376124731 /libgcc
parent7bf710b5116e6186204edd6a0168202fd8ef0389 (diff)
downloadgcc-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')
-rw-r--r--libgcc/config.host3
-rw-r--r--libgcc/config/t-vxworks7
-rw-r--r--libgcc/config/t-vxworks722
3 files changed, 3 insertions, 29 deletions
diff --git a/libgcc/config.host b/libgcc/config.host
index bd44f1b..1c1b60c 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -325,9 +325,6 @@ case ${host} in
tmake_file="vms/t-vms"
extra_parts="crt0.o crtbegin.o crtbeginS.o crtend.o crtendS.o"
;;
-*-*-vxworks7*)
- tmake_file=t-vxworks7
- ;;
*-*-vxworksae*)
tmake_file=t-vxworksae
;;
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)
diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7
deleted file mode 100644
index 180784b..0000000
--- a/libgcc/config/t-vxworks7
+++ /dev/null
@@ -1,22 +0,0 @@
-# Don't build libgcc.a with debug info
-LIBGCC2_DEBUG_CFLAGS =
-
-# We provide our own implementation for __clear_cache, using a
-# VxWorks specific entry point.
-LIB2FUNCS_EXCLUDE += _clear_cache
-
-# This ensures that the correct target headers are used; some VxWorks
-# system headers have names that collide with GCC's internal (host)
-# headers, e.g. regs.h. Make sure the local libgcc headers still
-# prevail (e.g. unwind.h), and that gcc provided header files intended
-# to be user visible eventually are visible as well.
-LIBGCC2_INCLUDES = -nostdinc -I. \
- -I$(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \
- -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \
- -I$(MULTIBUILDTOP)../../gcc/include \
- `case "/$(MULTIDIR)" in \
- */mrtp*) echo -I$(VSB_DIR)/usr/h/public -I$(VSB_DIR)/usr/h ;; \
- *) echo -I$(VSB_DIR)/krnl/h/system -I$(VSB_DIR)/krnl/h/public ;; \
- esac`
-
-CRTSTUFF_T_CFLAGS = $(LIBGCC2_INCLUDES)