1 |
commit: 97f76fa9e3aeeac6f44dbc979dcddb86ce7e1686 |
2 |
Author: Bart Oldeman <bart.oldeman <AT> calculquebec <DOT> ca> |
3 |
AuthorDate: Wed Mar 1 17:29:36 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Mar 4 02:21:34 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=97f76fa9 |
7 |
|
8 |
Use gcc --sysroot in rap stage3 post glibc install |
9 |
|
10 |
Since glibc now has non-prefixed filenames in |
11 |
`$EPREFIX/usr/lib64/libc.so`, it picks up non-prefixed |
12 |
`/lib64/libc.so.6` from stage2 gcc, unless we replace its -I, -L, and |
13 |
-B options by --sysroot. Then it will look at the same places as |
14 |
the future stage3 gcc. |
15 |
|
16 |
This avoids issues building binutils, which can't find dlopen in |
17 |
older `/lib64/libc.so.6`, since dlopen used to be in `libdl` |
18 |
instead. |
19 |
|
20 |
The whole logic no longer tests for compiler == gcc, since clang |
21 |
is only used for non-rap on MacOS. |
22 |
|
23 |
Closes: https://bugs.gentoo.org/895240 |
24 |
Signed-off-by: Bart Oldeman <bart.oldeman <AT> calculquebec.ca> |
25 |
Closes: https://github.com/gentoo/prefix/pull/22 |
26 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
27 |
|
28 |
scripts/bootstrap-prefix.sh | 12 +++++------- |
29 |
1 file changed, 5 insertions(+), 7 deletions(-) |
30 |
|
31 |
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh |
32 |
index c82cb4c1a8..f35de28ff8 100755 |
33 |
--- a/scripts/bootstrap-prefix.sh |
34 |
+++ b/scripts/bootstrap-prefix.sh |
35 |
@@ -2111,13 +2111,11 @@ bootstrap_stage3() { |
36 |
) |
37 |
# use the new dynamic linker in place of rpath from now on. |
38 |
RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9] | sed s"!${ROOT}/$(get_libdir)/ld-lsb.*!!") |
39 |
- export LDFLAGS="-L${ROOT}/usr/$(get_libdir) -Wl,--dynamic-linker=${RAP_DLINKER}" |
40 |
- if [[ ${compiler_type} == gcc ]] ; then |
41 |
- # make sure these flags are used even in places that ignore/strip CPPFLAGS/LDFLAGS |
42 |
- export LDFLAGS="-B${ROOT}/usr/$(get_libdir) ${LDFLAGS}" |
43 |
- export CC="gcc ${CPPFLAGS} ${LDFLAGS}" |
44 |
- export CXX="g++ ${CPPFLAGS} ${LDFLAGS}" |
45 |
- fi |
46 |
+ export CPPFLAGS="--sysroot=${ROOT}" |
47 |
+ export LDFLAGS="-Wl,--dynamic-linker=${RAP_DLINKER}" |
48 |
+ # make sure these flags are used even in places that ignore/strip CPPFLAGS/LDFLAGS |
49 |
+ export CC="gcc ${CPPFLAGS} ${LDFLAGS}" |
50 |
+ export CXX="g++ ${CPPFLAGS} ${LDFLAGS}" |
51 |
BOOTSTRAP_RAP=yes \ |
52 |
pre_emerge_pkgs --nodeps "${pkgs[@]}" || return 1 |