From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1298) id 9CBB53858439; Sun, 2 Oct 2022 09:33:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CBB53858439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664703212; bh=C2pG0/2RV2+9IjFqa6dB9GognjE+lFTsYsftZwSlVb0=; h=From:To:Subject:Date:From; b=ad9XsuF7RSYdL2OUXeOS9IT+IQmfwuMaHuPCx6VneR1g4gdp5pkp45CEgE8JR+5k2 /Kc5pzxZWMWR87ZgI3sOowZSm3OFjhyjb10JrXwihYdvB0q35pu/FpSCBuI/buoaWb wc0j+pRqaWwatum3AD1lJyztDwOY6menA88UXbfU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Olivier Hainque To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3019] Adjust LIBGCC2_INCLUDES for VxWorks and augment comment X-Act-Checkin: gcc X-Git-Author: Olivier Hainque X-Git-Refname: refs/heads/master X-Git-Oldrev: 2f26f5b584856927337728ddc598c44f1426fa32 X-Git-Newrev: b83b13331aca413cac80b0d7928b59b12e490f93 Message-Id: <20221002093332.9CBB53858439@sourceware.org> Date: Sun, 2 Oct 2022 09:33:32 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b83b13331aca413cac80b0d7928b59b12e490f93 commit r13-3019-gb83b13331aca413cac80b0d7928b59b12e490f93 Author: Olivier Hainque Date: Mon Mar 7 10:55:29 2022 +0000 Adjust LIBGCC2_INCLUDES for VxWorks and augment comment Investigating the reasons for libgcc build failures in a canadian context, orthogonally to the recent update of vxcrtstuff, exposed interesting differences in the way include search paths are managed between a regular Linux->VxWorks cross build and a canadian setup building a Windows->VxWorks toolchain in a Linux environment. This change augments the comment attached to LIBGCC2_INCLUDE in libgcc/config/t-vxworks to better describe the parameters at play. It also adjusts the addition of options for gcc/include and gcc/include-fixed to minimize the actual differences for libgcc in the two kinds of configurations. 2022-03-06 Olivier Hainque libgcc/ * config/t-vxworks (LIBGCC2_INCLUDE): Augment comment. Move -I options for gcc/include and gcc/include-fixed at the end and make them -isystem. Diff: --- libgcc/config/t-vxworks | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks index 18a0b1ee469..81a4deab073 100644 --- a/libgcc/config/t-vxworks +++ b/libgcc/config/t-vxworks @@ -5,17 +5,37 @@ LIBGCC2_DEBUG_CFLAGS = # 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. +# Arrange to have the correct target headers used when compiling +# libgcc. We specifically need to handle VxWorks system headers +# having names that collide with GCC's internal headers. +# +# For example, compiling gthr-vxworks.c #includes +# which in turn #includes , which exists both in the gcc +# source tree and as a VxWorks system header. We need that +# #include to get the VxWorks version, not the compiler one. +# +# We still need to make sure that the local libgcc headers prevail +# (e.g. ./unwind.h), and that gcc provided header files intended +# to be user visible eventually are visible as well (gcc/include +# and gcc/include-fixed). +# +# The latter are added unconditionally as -isystem during regular +# cross builds via the %I spec processing and search paths introduced +# by -B options. These take priority over whatever we can add here, +# even with -nostdinc, and end up at the tail of the search chain. +# +# We keep explicit options nevertheless, to accommodate canadian +# setups where the libraries are built with an installed cross compiler, +# without -B. Also note, incidentally, that the detection of duplicate +# paths differs between Windows and Linux hosts as the latter can perform +# inode based checks while the former may only rely on name comparisons. + LIBGCC2_INCLUDES = -nostdinc -I. \ - -I$(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \ - -I$(MULTIBUILDTOP)../../gcc/include \ $(if $(findstring vxworks7, $(target_noncanonical)), \ -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h -I=/system -I=/public, \ - -I=/ -I=/wrn/coreip) + -I=/ -I=/wrn/coreip) \ + -isystem $(MULTIBUILDTOP)../../gcc/include-fixed$(MULTISUBDIR) \ + -isystem $(MULTIBUILDTOP)../../gcc/include # Use these also for the vxcrstuff objects (.e.g for version.h), on top of # the options possibly already set specifically for the target: