From 3de6d254a9674be48b6bb277777b48aaf819ca68 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Sat, 20 Apr 2024 12:37:51 -0300 Subject: [PATCH] Replace VSB_DIR by sysroot ref in VXWORKS_ADDITIONAL_CPP_SPEC VXWORKS_ADDITIONAL_CPP_SPEC has an artificial guard on -fself-test to prevent all-gcc build failures from self-tests in environments where VSB_DIR is not defined. The libraries are not built during such checks; having a VxWorks installation at hand is not necessary, and requiring VSB_DIR to be defined is inappropriate. This patch replaces the use of %getenv(VSB_DIR) by $sysroot references which allows removing the artifical guard of -fself-tests. gcc/ * config/vxworks.h (VXWORKS_ADDITIONAL_CPP_SPEC): Remove guard on -fself-tests and replace %:getenv(VSB_DIR) by sysroot references. --- gcc/config/vxworks.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 7268ace41ec..bfad0703a8e 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -75,22 +75,27 @@ extern void vxworks_driver_init (unsigned int *, struct cl_decoded_option **); #if TARGET_VXWORKS7 -/* We arrange not rely on fixed includes for vx7 and the headers spread over - common kernel/rtp directories in addition to specific ones for each mode. - Setup sysroot_headers_suffix_spec to deal with kernel/rtp distinction. */ +/* We arrange not to rely on fixed includes for vx7 and the headers spread + over common kernel/rtp directories in addition to specific ones for each + mode. Setup sysroot_headers_suffix_spec to deal with the kernel/rtp + distinction. */ #undef SYSROOT_HEADERS_SUFFIX_SPEC #define SYSROOT_HEADERS_SUFFIX_SPEC "%{mrtp:/usr/h;:/krnl/h}" +/* Now expand everything using sysroot(+suffix) relative references. The + absence of %getenv(VSB_DIR) allows all-gcc builds with possible self-tests + to succeed without having to define the variable at all. */ + #undef VXWORKS_ADDITIONAL_CPP_SPEC -#define VXWORKS_ADDITIONAL_CPP_SPEC \ - "%{!nostdinc:%{!fself-test=*: \ - %{isystem*} \ - -idirafter %:getenv(VSB_DIR /h) \ - -idirafter %:getenv(VSB_DIR /share/h) \ - -idirafter =/system \ - -idirafter =/public \ - }}" +#define VXWORKS_ADDITIONAL_CPP_SPEC \ + "%{!nostdinc: \ + %{isystem*} \ + -idirafter =/../../h \ + -idirafter =/../../share/h \ + -idirafter =/system \ + -idirafter =/public \ + }" #else /* TARGET_VXWORKS7 */ -- 2.47.3