From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F257C158003 for ; Sat, 3 Sep 2022 01:59:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 22080E0828; Sat, 3 Sep 2022 01:59:21 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 07B36E0828 for ; Sat, 3 Sep 2022 01:59:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0400E340E7D for ; Sat, 3 Sep 2022 01:59:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 21BFB1E for ; Sat, 3 Sep 2022 01:59:18 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1662170119.d15a8504e74114febbbbee439493a282f4450c5c.sam@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-prefix.sh X-VCS-Directories: scripts/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d15a8504e74114febbbbee439493a282f4450c5c X-VCS-Branch: master Date: Sat, 3 Sep 2022 01:59:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 20a9e6df-66c1-4678-8b98-38b6d74955b7 X-Archives-Hash: 18feb2eb8674b46ba69828b686f28363 commit: d15a8504e74114febbbbee439493a282f4450c5c Author: Sam James gentoo org> AuthorDate: Sat Sep 3 01:55:19 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sat Sep 3 01:55:19 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d15a8504 scripts/bootstrap-prefix.sh: fix for >= glibc-2.35 in stage3 slyfox explains it well in the linked bugs, but the gist is that we mostly got lucky for a while. We would mix system crt*.o with just-built libc_nonshared.a/libc.so which led to issues like: ``` configure:4383: x86_64-pc-linux-gnu-gcc -O2 -pipe -O2 -pipe -L/home/share/gentoo/usr/lib64 -Wl,--dynamic-linker=/home/share/gentoo/lib64/ld-linux-x86-64.so.2 conftest.c >&5 /home/share/gentoo/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/../lib64/Scrt1.o: in function `_start': (.text+0x16): undefined reference to `__libc_csu_fini' /home/share/gentoo/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: (.text+0x1d): undefined reference to `__libc_csu_init' ``` We need to force GCC to use the Prefix version of glibc we just built. Bug: https://github.com/NixOS/nixpkgs/issues/158042 Closes: https://bugs.gentoo.org/824482 Thanks-to: Bart Oldeman gmail.com> Thanks-to: Sergei Trofimovich gmail.com> Signed-off-by: Sam James gentoo.org> scripts/bootstrap-prefix.sh | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 0635887745..4795d87ee5 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -503,35 +503,6 @@ bootstrap_setup() { einfo "Your profile is set to ${fullprofile}." fi - # bug #788613 avoid gcc-11 during stage 2/3 prior sync/emerge -e - is-rap && cat >> "${ROOT}"/etc/portage/make.profile/package.mask <<-EOF - # during bootstrap mask, bug #788613 - >=sys-devel/gcc-11 - EOF - - # bug #824482 avoid glibc-2.34 - if is-rap; then - if ! [ -d "${ROOT}"/etc/portage/package.mask ]; then - mkdir "${ROOT}"/etc/portage/package.mask - fi - - if ! [ -d "${ROOT}"/etc/portage/package.unmask ]; then - mkdir "${ROOT}"/etc/portage/package.unmask - fi - - cat >> "${ROOT}"/etc/portage/package.mask/glibc <<-EOF - # Temporary mask for newer glibc until bootstrapping issues are fixed. - # bug #824482: Avoid glibc-2.34 for now. See package.unmask/glibc too. - >=sys-libs/glibc-2.34 - EOF - - cat >> "${ROOT}"/etc/portage/package.unmask/glibc <<-EOF - # Temporary mask for newer glibc until bootstrapping issues are fixed. - # bug #824482: Avoid glibc-2.34 for now. See package.mask/glibc too. - >=sys-libs/glibc-2.34_p1 - EOF - fi - # Use package.use to disable in the portage tree to be shared between # stage2 and stage3. The hack will be undone during tree sync in stage3. cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF @@ -2131,8 +2102,14 @@ bootstrap_stage3() { ${linker} ) # use the new dynamic linker in place of rpath from now on. - RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9]) + 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 BOOTSTRAP_RAP=yes \ pre_emerge_pkgs --nodeps "${pkgs[@]}" || return 1 @@ -2189,7 +2166,7 @@ bootstrap_stage3() { # Undo libgcc_s.so path of stage2 # Now we have the compiler right there - unset CXX CPPFLAGS LDFLAGS + unset CC CXX CPPFLAGS LDFLAGS rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf