Skip to content

Commit fa3ef7f

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 <root@stephanos.io>
1 parent 0835dbe commit fa3ef7f

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
@@ -10251,13 +10251,17 @@ if test x"${build}" = x"${host}" ; then
1025110251
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
1025210252
fi
1025310253

10254-
# On Canadian crosses, we'll be searching the right directories for
10255-
# the previously-installed cross compiler, so don't bother to add
10256-
# flags for directories within the install tree of the compiler
10257-
# being built; programs in there won't even run.
10258-
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
10254+
if test -d ${srcdir}/gcc; then
10255+
# On Canadian crosses, we'll be searching the right directories for the
10256+
# previously-installed cross compiler, so don't bother to add flags for
10257+
# executable directories within the install tree of the compiler being built;
10258+
# programs in there won't even run.
10259+
if test "${build}" = "${host}"; then
10260+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
10261+
fi
10262+
1025910263
# Search for pre-installed headers if nothing else fits.
10260-
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
10264+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
1026110265
fi
1026210266

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

configure.ac

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

3435-
# On Canadian crosses, we'll be searching the right directories for
3436-
# the previously-installed cross compiler, so don't bother to add
3437-
# flags for directories within the install tree of the compiler
3438-
# being built; programs in there won't even run.
3439-
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
3435+
if test -d ${srcdir}/gcc; then
3436+
# On Canadian crosses, we'll be searching the right directories for the
3437+
# previously-installed cross compiler, so don't bother to add flags for
3438+
# executable directories within the install tree of the compiler being built;
3439+
# programs in there won't even run.
3440+
if test "${build}" = "${host}"; then
3441+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/'
3442+
fi
3443+
34403444
# Search for pre-installed headers if nothing else fits.
3441-
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
3445+
FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
34423446
fi
34433447

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

0 commit comments

Comments
 (0)