commit:     97f76fa9e3aeeac6f44dbc979dcddb86ce7e1686
Author:     Bart Oldeman <bart.oldeman <AT> calculquebec <DOT> ca>
AuthorDate: Wed Mar  1 17:29:36 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  4 02:21:34 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=97f76fa9

Use gcc --sysroot in rap stage3 post glibc install

Since glibc now has non-prefixed filenames in
`$EPREFIX/usr/lib64/libc.so`, it picks up non-prefixed
`/lib64/libc.so.6` from stage2 gcc, unless we replace its -I, -L, and
-B options by --sysroot. Then it will look at the same places as
the future stage3 gcc.

This avoids issues building binutils, which can't find dlopen in
older `/lib64/libc.so.6`, since dlopen used to be in `libdl`
instead.

The whole logic no longer tests for compiler == gcc, since clang
is only used for non-rap on MacOS.

Closes: https://bugs.gentoo.org/895240
Signed-off-by: Bart Oldeman <bart.oldeman <AT> calculquebec.ca>
Closes: https://github.com/gentoo/prefix/pull/22
Signed-off-by: Sam James <sam <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index c82cb4c1a8..f35de28ff8 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -2111,13 +2111,11 @@ bootstrap_stage3() {
                )
                # use the new dynamic linker in place of rpath from now on.
                RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9] | sed 
s"!${ROOT}/$(get_libdir)/ld-lsb.*!!")
-               export LDFLAGS="-L${ROOT}/usr/$(get_libdir) 
-Wl,--dynamic-linker=${RAP_DLINKER}"
-               if [[ ${compiler_type} == gcc ]] ; then
-                       # make sure these flags are used even in places that 
ignore/strip CPPFLAGS/LDFLAGS
-                       export LDFLAGS="-B${ROOT}/usr/$(get_libdir) ${LDFLAGS}"
-                       export CC="gcc ${CPPFLAGS} ${LDFLAGS}"
-                       export CXX="g++ ${CPPFLAGS} ${LDFLAGS}"
-               fi
+               export CPPFLAGS="--sysroot=${ROOT}"
+               export LDFLAGS="-Wl,--dynamic-linker=${RAP_DLINKER}"
+               # make sure these flags are used even in places that 
ignore/strip CPPFLAGS/LDFLAGS
+               export CC="gcc ${CPPFLAGS} ${LDFLAGS}"
+               export CXX="g++ ${CPPFLAGS} ${LDFLAGS}"
                BOOTSTRAP_RAP=yes \
                pre_emerge_pkgs --nodeps "${pkgs[@]}" || return 1
 

Reply via email to