1 |
commit: 08047a53f5d51d7a370ec0d5d047253cad60dc2a |
2 |
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 25 12:08:17 2018 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 25 12:08:17 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=08047a53 |
7 |
|
8 |
bootstrap-prefix.sh: expose stage3 dynamic linker early on. |
9 |
|
10 |
The stage3 ld should use stage3 dynamic linker, to prevent from |
11 |
symbol clashes between host dynamic linker and stage3 shared |
12 |
libraries, like the errors below. |
13 |
|
14 |
4 /home/xxx/gentoo/usr/bin/ld: /lib64/libc.so.6: version |
15 |
`GLIBC_2.14' not found (required by /home/xxx/gentoo/usr/bin/ld |
16 |
5 /home/xxx/gentoo/usr/bin/ld: /lib64/libc.so.6: version |
17 |
`GLIBC_2.14' not found (required by /home/xxx/gentoo/usr/lib64/binutils/x86_64-pc-linux-gnu/2.29.1/libbfd-2.29.1.so) |
18 |
6 /home/xxx/gentoo/usr/bin/ld: /lib64/libc.so.6: version |
19 |
`GLIBC_2.14' not found (required by /home/xxx/gentoo/usr/lib64/libz.so.1) |
20 |
|
21 |
scripts/bootstrap-prefix.sh | 16 +++++++++++----- |
22 |
1 file changed, 11 insertions(+), 5 deletions(-) |
23 |
|
24 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
25 |
index 5f2e0d473f..6e63af8575 100755 |
26 |
--- a/scripts/bootstrap-prefix.sh |
27 |
+++ b/scripts/bootstrap-prefix.sh |
28 |
@@ -1627,14 +1627,22 @@ bootstrap_stage3() { |
29 |
app-portage/elt-patches |
30 |
sys-kernel/linux-headers |
31 |
sys-libs/glibc |
32 |
- sys-devel/binutils-config |
33 |
- sys-libs/zlib |
34 |
- ${linker} |
35 |
) |
36 |
|
37 |
BOOTSTRAP_RAP=yes \ |
38 |
emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
39 |
grep -q 'apiversion=9999' "${ROOT}"/usr/bin/perl && rm "${ROOT}"/usr/bin/perl |
40 |
+ |
41 |
+ pkgs=( |
42 |
+ sys-devel/binutils-config |
43 |
+ sys-libs/zlib |
44 |
+ ${linker} |
45 |
+ ) |
46 |
+ # use the new dynamic linker in place of rpath from now on. |
47 |
+ RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9]) |
48 |
+ export LDFLAGS="-L${ROOT}/usr/$(get_libdir) -Wl,--dynamic-linker=${RAP_DLINKER}" |
49 |
+ emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |
50 |
+ |
51 |
# remove stage2 ld so that stage3 ld is used by stage2 gcc. |
52 |
[[ -f ${ROOT}/tmp/usr/${CHOST}/bin/ld ]] && mv ${ROOT}/tmp/usr/${CHOST}/bin/ld{,.stage2} |
53 |
else |
54 |
@@ -1681,11 +1689,9 @@ bootstrap_stage3() { |
55 |
&& ln -s ../../../libc++.1.dylib libstdc++.6.0.9.dylib ) |
56 |
fi |
57 |
|
58 |
- RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9]) |
59 |
# try to get ourself out of the mudd, bug #575324 |
60 |
EXTRA_ECONF="--disable-compiler-version-checks $(rapx --disable-lto)" \ |
61 |
MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \ |
62 |
- LDFLAGS="${LDFLAGS} $(rapx -Wl,--dynamic-linker=${RAP_DLINKER})" \ |
63 |
PYTHON_COMPAT_OVERRIDE=python2.7 \ |
64 |
emerge_pkgs --nodeps ${compiler} || return 1 |
65 |
# undo libgcc_s.so path of stage2 |