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"

Reply via email to