1 |
commit: 345944686caf4b029c869767ca40d38bee556c61 |
2 |
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 29 09:27:03 2017 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 29 09:45:43 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=34594468 |
7 |
|
8 |
bootstrap-prefix.sh: fix CPPFLAGS for header directory in stage3. |
9 |
|
10 |
The CPPFLAGS is needed in stage3 before a working toolchain is |
11 |
built. stage2 headers are not enough when e.g. the host headers are |
12 |
too old. |
13 |
|
14 |
'-isystem' is the correct choice because EPREFIX/usr/include is a |
15 |
system-header-like directory. In rare cases, '-I' causes conflicts |
16 |
between bundled header and system header, like Bug 618488. |
17 |
|
18 |
After the stage3 toolchain is built, directories specified by |
19 |
CPPFLAGS and LDFLAGS are automatically handled and the variables |
20 |
should be removed. Not removing them pollutes the build system of |
21 |
some sophisticated packages which hack CPPFLAGS or LD_LIBRARY_PATH, |
22 |
e.g. dev-libs/gmp-6. |
23 |
|
24 |
Closes: https://bugs.gentoo.org/618488 |
25 |
|
26 |
scripts/bootstrap-prefix.sh | 6 ++---- |
27 |
1 file changed, 2 insertions(+), 4 deletions(-) |
28 |
|
29 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
30 |
index bf35b32b81..f811cf6887 100755 |
31 |
--- a/scripts/bootstrap-prefix.sh |
32 |
+++ b/scripts/bootstrap-prefix.sh |
33 |
@@ -1549,7 +1549,7 @@ bootstrap_stage3() { |
34 |
|
35 |
configure_toolchain || return 1 |
36 |
export CONFIG_SHELL="${ROOT}"/tmp/bin/bash |
37 |
- is-rap || export CPPFLAGS="-I${ROOT}/usr/include" |
38 |
+ export CPPFLAGS="-isystem ${ROOT}/usr/include" |
39 |
export LDFLAGS="-L${ROOT}/usr/$(get_libdir)" |
40 |
unset CC CXX |
41 |
|
42 |
@@ -1666,9 +1666,7 @@ bootstrap_stage3() { |
43 |
rm -f "${ROOT}"/bin/sh |
44 |
ln -s bash "${ROOT}"/bin/sh |
45 |
fi |
46 |
- unset CONFIG_SHELL |
47 |
- unset MAKEINFO |
48 |
- unset CXX |
49 |
+ unset CONFIG_SHELL MAKEINFO CXX CPPFLAGS LDFLAGS |
50 |
export PREROOTPATH="${ROOT}/usr/bin:${ROOT}/bin" |
51 |
|
52 |
# get a sane bash, overwriting tmp symlinks |