This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH configure,config.gcc] Fix for PR69153 to allow config.gcc to set target_header_dir
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Tue, 19 Jan 2016 18:46:12 -0600
- Subject: Re: [PATCH configure,config.gcc] Fix for PR69153 to allow config.gcc to set target_header_dir
- Authentication-results: sourceware.org; auth=none
- References: <HE1PR07MB090530387C9DF47DCA4DE50AE4C80 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <1452467429 dot 5201 dot 20 dot camel at vnet dot ibm dot com> <20160111192045 dot GA1716 at ibm-tiger dot the-meissners dot org> <HE1PR07MB0905A269DED43260872472F2E4C90 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com>
On Mon, 2016-01-11 at 21:35 +0000, Bernd Edlinger wrote:
> Could if work also if you set native_system_header_dir to
> /opt/$with_advance_toolchain/include or somthing and instead of
> -isystem $at/include in INCLUDE_EXTRA_SPEC you could add something like
> %{!nostdinc:-idirafter $original_native_system_header_dir } ?
The following patch does seem to work on my native build.
I'll have to check on a cross build, but I wonder, does the
second hunk setting INCLUDE_EXTRA_SPEC make sense on a cross
build, since the original native_system_header_dir is equal
to /usr/include?
I will say I do like that second hunk for the native build, since the
native Advance Toolchain does not contain everything you'd find in a
normal /usr/include, so falling back on /usr/include if the Advance
Toolchain doesn't supply it seems wise. I guess we really should
be conditionally setting that hunk.
Peter
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (revision 232595)
+++ gcc/config.gcc (working copy)
@@ -4167,6 +4167,8 @@
-d "/opt/$with_advance_toolchain/bin/." -a \
-d "/opt/$with_advance_toolchain/include/."; then
+ orig_native_system_header_dir=$native_system_header_dir
+ native_system_header_dir=`find /opt/$with_advance_toolchain/ -path '*/include/features.h' | sed -e 's#/features.h##'`
tm_file="$tm_file ./advance-toolchain.h"
(at="/opt/$with_advance_toolchain"
echo "/* Use Advance Toolchain $at */"
@@ -4178,7 +4180,7 @@
echo "#if USE_AT_INCLUDE_FILES"
echo "#undef INCLUDE_EXTRA_SPEC"
echo "#define INCLUDE_EXTRA_SPEC" \
- "\"-isystem $at/include\""
+ "\"%{!nostdinc:-idirafter $orig_native_system_header_dir}\""
echo "#endif"
echo
echo "#undef LINK_OS_EXTRA_SPEC32"