Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Mon, 11 Dec 2017 05:22:11
Message-Id: 1512966399.f05380dd9a7d090acb25ab97721d240dee039b53.heroxbd@gentoo
1 commit: f05380dd9a7d090acb25ab97721d240dee039b53
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 11 04:26:39 2017 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Mon Dec 11 04:26:39 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f05380dd
7
8 bootstrap-prefix.sh: fine tune USE flags by package.use
9
10 We want dev-libs/gmp[-cxx] and sys-devel/gcc[cxx]. Environmental
11 USE is not precise enough.
12
13 scripts/bootstrap-prefix.sh | 37 ++++++++++++++++++++++---------------
14 1 file changed, 22 insertions(+), 15 deletions(-)
15
16 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
17 index 3caa1aa5e1..1b15a7add2 100755
18 --- a/scripts/bootstrap-prefix.sh
19 +++ b/scripts/bootstrap-prefix.sh
20 @@ -438,6 +438,28 @@ bootstrap_setup() {
21 ln -s "${fullprofile}" "${ROOT}"/etc/portage/make.profile
22 einfo "Your profile is set to ${fullprofile}."
23 fi
24 +
25 + # Use package.use to disable in the portage tree to be shared between
26 + # stage2 and stage3. The hack will be undone during tree sync in stage3.
27 + cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
28 + # Most binary Linux distributions seem to fancy toolchains that
29 + # do not do c++ support (need to install a separate package).
30 + sys-libs/ncurses -cxx
31 + sys-devel/binutils -cxx
32 + EOF
33 +
34 + # Strange enough, -cxx causes wrong libtool config on Cygwin,
35 + # but we require a C++ compiler there anyway - so just use it.
36 + [[ ${CHOST} == *-cygwin* ]] ||
37 + cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
38 + # gmp has cxx flag enabled by default. When dealing with a host
39 + # compiler without cxx support this causes configure failure.
40 + # In addition, The stage2 g++ is only for compiling stage3 compiler,
41 + # because the host libstdc++.so runtime may be not compatible and
42 + # stage2 libstdc++.so might conflict with that of stage3. The
43 + # trade-off is just not to use cxx.
44 + dev-libs/gmp -cxx
45 + EOF
46 }
47
48 do_tree() {
49 @@ -1412,27 +1434,15 @@ bootstrap_stage2() {
50 sys-devel/binutils-config
51 )
52
53 - # Most binary Linux distributions seem to fancy toolchains that
54 - # do not do c++ support (need to install a separate package).
55 - USE="${USE} -cxx" \
56 emerge_pkgs --nodeps "${pkgs[@]}" || return 1
57
58 # Build a linker and compiler that live in ${ROOT}/tmp, but
59 # produce binaries in ${ROOT}. Debian multiarch supported by RAP
60 # needs ld to support sysroot.
61 - USE="${USE} -cxx" \
62 TPREFIX="${ROOT}" \
63 EXTRA_ECONF=$(rapx --with-sysroot=/) \
64 emerge_pkgs --nodeps ${linker} || return 1
65
66 - # gmp has cxx flag enabled by default. When dealing with a host
67 - # compiler without cxx support this causes configure failure. Use
68 - # package.use to disable in the temporary prefix.
69 - # Strange enough, -cxx causes wrong libtool config on Cygwin,
70 - # but we require a C++ compiler there anyway - so just use it.
71 - [[ ${CHOST} == *-cygwin* ]] ||
72 - echo "dev-libs/gmp -cxx" >> "${ROOT}"/tmp/etc/portage/package.use
73 -
74 # Old versions of gcc has been masked. We need gcc-4.7 to bootstrap
75 # on systems without a c++ compiler.
76 echo '<sys-devel/gcc-4.8' >> "${ROOT}"/tmp/etc/portage/package.unmask
77 @@ -1448,9 +1458,6 @@ bootstrap_stage2() {
78 PYTHON_COMPAT_OVERRIDE=python2.7 \
79 emerge_pkgs --nodeps ${compiler_stage1} || return 1
80
81 - # undo gmp cxx hack
82 - rm -f "${ROOT}"/tmp/etc/portage/package.use
83 -
84 if [[ ${CHOST} == *darwin* ]] ; then
85 # we use Clang as our toolchain compiler, so we need to make
86 # sure we actually use it