Skip to content

Commit dff727b

Browse files
stephanosioJeffreyALaw
authored andcommitted
[PATCH] configure: Always add pre-installed header directories to search path
configure script was adding the target directory flags, including the '-B' flags for the executable prefix and the '-isystem' flags for the pre-installed header directories, to the target flags only for non-Canadian builds under the premise that the host binaries under the executable prefix will not be able to execute on the build system for Canadian builds. While that is true for the '-B' flags specifying the executable prefix, the '-isystem' flags specifying the pre-installed header directories are not affected by this and do not need special handling. This patch updates the configure script to always add the 'include' and 'sys-include' pre-installed header directories to the target search path, in order to ensure that the availability of the pre-installed header directories in the search path is consistent across non-Canadian and Canadian builds. When '--with-headers' flag is specified, this effectively ensures that the libc headers, that are copied from the specified header directory to the sys-include directory, are used by libstdc++. * configure.ac: Always add pre-installed heades to search path. * configure: Regenerate.
1 parent f725d67 commit dff727b

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

configure

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11595,13 +11595,17 @@ if test x"${build}" = x"${host}" ; then
1159511595
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
1159611596
fi
1159711597

11598-
# On Canadian crosses, we'll be searching the right directories for
11599-
# the previously-installed cross compiler, so don't bother to add
11600-
# flags for directories within the install tree of the compiler
11601-
# being built; programs in there won't even run.
11602-
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
11598+
if test -d ${srcdir}/gcc; then
11599+
# On Canadian crosses, we'll be searching the right directories for the
11600+
# previously-installed cross compiler, so don't bother to add flags for
11601+
# executable directories within the install tree of the compiler being built;
11602+
# programs in there won't even run.
11603+
if test "${build}" = "${host}"; then
11604+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
11605+
fi
11606+
1160311607
# Search for pre-installed headers if nothing else fits.
11604-
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
11608+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
1160511609
fi
1160611610

1160711611
if test "x${use_gnu_ld}" = x &&

configure.ac

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,13 +3822,17 @@ if test x"${build}" = x"${host}" ; then
38223822
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
38233823
fi
38243824

3825-
# On Canadian crosses, we'll be searching the right directories for
3826-
# the previously-installed cross compiler, so don't bother to add
3827-
# flags for directories within the install tree of the compiler
3828-
# being built; programs in there won't even run.
3829-
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
3825+
if test -d ${srcdir}/gcc; then
3826+
# On Canadian crosses, we'll be searching the right directories for the
3827+
# previously-installed cross compiler, so don't bother to add flags for
3828+
# executable directories within the install tree of the compiler being built;
3829+
# programs in there won't even run.
3830+
if test "${build}" = "${host}"; then
3831+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
3832+
fi
3833+
38303834
# Search for pre-installed headers if nothing else fits.
3831-
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
3835+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
38323836
fi
38333837

38343838
if test "x${use_gnu_ld}" = x &&

0 commit comments

Comments
 (0)