aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/build/cc/gcc.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 8cf03cbd..1d7fc065 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -295,7 +295,6 @@ do_gcc_core_backend() {
exec_prefix="${CT_PREFIX_DIR}/${libstdcxx_name}"
fi
extra_config+=( "${CT_CC_SYSROOT_ARG[@]}" )
- extra_config+=( "--with-headers=${header_dir}" )
extra_user_config=( "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
log_txt="libstdc++ ${libstdcxx_name} library"
# to inhibit the libiberty and libgcc tricks later on
@@ -554,6 +553,13 @@ do_gcc_core_backend() {
fi
fi
+ # Add an extra system include dir if we have one. This is especially useful
+ # when building libstdc++ with a libc other than the system libc (e.g.
+ # picolibc)
+ if [ -n "${header_dir}" ]; then
+ cflags_for_target="${cflags_for_target} -idirafter ${header_dir}"
+ fi
+
# For non-sysrooted toolchain, GCC doesn't search except at the installation
# prefix; in core stage we use a temporary installation prefix - but
# we may have installed something into the final prefix. This is less than ideal:
@@ -1200,6 +1206,13 @@ do_gcc_backend() {
fi
fi
+ # Add an extra system include dir if we have one. This is especially useful
+ # when building libstdc++ with a libc other than the system libc (e.g.
+ # picolibc)
+ if [ -n "${header_dir}" ]; then
+ cflags_for_target="${cflags_for_target} -idirafter ${header_dir}"
+ fi
+
# Assume '-O2' by default for building target libraries.
cflags_for_target="-g -O2 ${cflags_for_target}"