diff options
author | Benda Xu <heroxbd@gentoo.org> | 2017-11-29 18:27:03 +0900 |
---|---|---|
committer | Benda Xu <heroxbd@gentoo.org> | 2017-11-29 18:45:43 +0900 |
commit | 345944686caf4b029c869767ca40d38bee556c61 (patch) | |
tree | e5ab36785062890e08127db367406a56f02d6a93 | |
parent | bootstrap-prefix.sh: wget no-check-certificate before stage1 portage (diff) | |
download | prefix-345944686caf4b029c869767ca40d38bee556c61.tar.gz prefix-345944686caf4b029c869767ca40d38bee556c61.tar.bz2 prefix-345944686caf4b029c869767ca40d38bee556c61.zip |
bootstrap-prefix.sh: fix CPPFLAGS for header directory in stage3.
The CPPFLAGS is needed in stage3 before a working toolchain is
built. stage2 headers are not enough when e.g. the host headers are
too old.
'-isystem' is the correct choice because EPREFIX/usr/include is a
system-header-like directory. In rare cases, '-I' causes conflicts
between bundled header and system header, like Bug 618488.
After the stage3 toolchain is built, directories specified by
CPPFLAGS and LDFLAGS are automatically handled and the variables
should be removed. Not removing them pollutes the build system of
some sophisticated packages which hack CPPFLAGS or LD_LIBRARY_PATH,
e.g. dev-libs/gmp-6.
Closes: https://bugs.gentoo.org/618488
-rwxr-xr-x | scripts/bootstrap-prefix.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index bf35b32b81..f811cf6887 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -1549,7 +1549,7 @@ bootstrap_stage3() { configure_toolchain || return 1 export CONFIG_SHELL="${ROOT}"/tmp/bin/bash - is-rap || export CPPFLAGS="-I${ROOT}/usr/include" + export CPPFLAGS="-isystem ${ROOT}/usr/include" export LDFLAGS="-L${ROOT}/usr/$(get_libdir)" unset CC CXX @@ -1666,9 +1666,7 @@ bootstrap_stage3() { rm -f "${ROOT}"/bin/sh ln -s bash "${ROOT}"/bin/sh fi - unset CONFIG_SHELL - unset MAKEINFO - unset CXX + unset CONFIG_SHELL MAKEINFO CXX CPPFLAGS LDFLAGS export PREROOTPATH="${ROOT}/usr/bin:${ROOT}/bin" # get a sane bash, overwriting tmp symlinks |