Skip to content

Commit b831465

Browse files
committed
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++. ChangeLog: * configure.ac: Always add sys-include to search path. * configure: Regenerate. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 8abab7c commit b831465

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
@@ -10553,13 +10553,17 @@ if test x"${build}" = x"${host}" ; then
1055310553
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
1055410554
fi
1055510555

10556-
# On Canadian crosses, we'll be searching the right directories for
10557-
# the previously-installed cross compiler, so don't bother to add
10558-
# flags for directories within the install tree of the compiler
10559-
# being built; programs in there won't even run.
10560-
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
10556+
if test -d ${srcdir}/gcc; then
10557+
# On Canadian crosses, we'll be searching the right directories for the
10558+
# previously-installed cross compiler, so don't bother to add flags for
10559+
# executable directories within the install tree of the compiler being built;
10560+
# programs in there won't even run.
10561+
if test "${build}" = "${host}"; then
10562+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
10563+
fi
10564+
1056110565
# Search for pre-installed headers if nothing else fits.
10562-
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
10566+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
1056310567
fi
1056410568

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

configure.ac

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

3628-
# On Canadian crosses, we'll be searching the right directories for
3629-
# the previously-installed cross compiler, so don't bother to add
3630-
# flags for directories within the install tree of the compiler
3631-
# being built; programs in there won't even run.
3632-
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
3628+
if test -d ${srcdir}/gcc; then
3629+
# On Canadian crosses, we'll be searching the right directories for the
3630+
# previously-installed cross compiler, so don't bother to add flags for
3631+
# executable directories within the install tree of the compiler being built;
3632+
# programs in there won't even run.
3633+
if test "${build}" = "${host}"; then
3634+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
3635+
fi
3636+
36333637
# Search for pre-installed headers if nothing else fits.
3634-
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
3638+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
36353639
fi
36363640

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

0 commit comments

Comments
 (0)