Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:script-rap commit in: scripts/
Date: Fri, 27 May 2016 10:54:07
Message-Id: 1464346106.4513898cf015ccb78abba9eb6ec451e754c14ad0.heroxbd@gentoo
1 commit: 4513898cf015ccb78abba9eb6ec451e754c14ad0
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 27 10:48:26 2016 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Fri May 27 10:48:26 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4513898c
7
8 scripts/bootstrap-prefix.sh: solve RHEL 6.7 bootstrap issues.
9
10 - binutils-config and ldconfig should be called explicitly
11 - lto of gcc should be disabled. ld points to the host dynamic
12 loader and gcc points to the RAP one, ld cannot load the gcc
13 lto plugin.
14
15 scripts/bootstrap-prefix.sh | 17 +++++++++++------
16 1 file changed, 11 insertions(+), 6 deletions(-)
17
18 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
19 index 874e627..196dc73 100755
20 --- a/scripts/bootstrap-prefix.sh
21 +++ b/scripts/bootstrap-prefix.sh
22 @@ -149,8 +149,7 @@ configure_cflags() {
23 configure_toolchain() {
24 linker="sys-devel/binutils"
25 local gcc_deps="dev-libs/gmp dev-libs/mpfr dev-libs/mpc"
26 - local gcc_rap_deps=$(rapx "sys-kernel/linux-headers sys-libs/glibc")
27 - compiler="${gcc_deps} ${gcc_rap_deps} sys-devel/gcc-config sys-devel/gcc"
28 + compiler="${gcc_deps} sys-devel/gcc-config sys-devel/gcc"
29 compiler_stage1="${gcc_deps} sys-devel/gcc-config"
30 case ${CHOST} in
31 *-cygwin*)
32 @@ -1376,10 +1375,14 @@ bootstrap_stage3() {
33 ${linker}
34 )
35 fi
36 - LDFLAGS="${LDFLAGS} $(rapx -Wl,-rpath=${ROOT}/usr/$(get_libdir))" \
37 + # binutils has the host dynamic loader(DL), while gcc will have the RAP one.
38 + # A gcc lto plugin (new DL) will fail to work with ld (old DL).
39 + # USE=-cxx disables ld.gold and plugins.
40 + USE="${USE} $(rapx -cxx)" \
41 emerge_pkgs --nodeps "${pkgs[@]}" || return 1
42
43 if is-rap ; then
44 + binutils-config 1 || return 1
45 if [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
46 echo "We need ${ROOT}/usr/bin/perl to merge glibc." > "${ROOT}"/usr/bin/perl
47 chmod +x "${ROOT}"/usr/bin/perl
48 @@ -1389,8 +1392,9 @@ bootstrap_stage3() {
49 mkdir -p "${ROOT}"/etc/ld.so.conf.d
50 dirname $(gcc -print-libgcc-file-name) > "${ROOT}"/etc/ld.so.conf.d/stage2.conf
51 fi
52 + emerge_pkgs --nodeps sys-kernel/linux-headers sys-libs/glibc \
53 + && "${ROOT}"/usr/sbin/ldconfig || return 1
54 fi
55 -
56 # On some hosts, gcc gets confused now when it uses the new linker,
57 # see for instance bug #575480. While we would like to hide that
58 # linker, we can't since we want the compiler to pick it up.
59 @@ -1404,9 +1408,10 @@ bootstrap_stage3() {
60 ( cd "${ROOT}"/usr/bin && test ! -e python && ln -s "${ROOT}"/tmp/usr/bin/python2.7 )
61 # in addition, avoid collisions
62 rm -Rf "${ROOT}"/tmp/usr/lib/python2.7/site-packages/clang
63 + RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9])
64 # try to get ourself out of the mudd, bug #575324
65 - EXTRA_ECONF="--disable-compiler-version-checks" \
66 - LDFLAGS="${LDFLAGS} $(rapx -Wl,--dynamic-linker=$(echo ${ROOT}/$(get_libdir)/ld*.so.[0-9]))" \
67 + EXTRA_ECONF="--disable-compiler-version-checks $(rapx --disable-lto)" \
68 + LDFLAGS="${LDFLAGS} $(rapx -Wl,--dynamic-linker=${RAP_DLINKER})" \
69 emerge_pkgs --nodeps ${compiler} || return 1
70 is-rap && rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf
71 ( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python2.7 )