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 A5C9F15ACFB for ; Mon, 24 Apr 2023 20:12:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE1D8E0871; Mon, 24 Apr 2023 20:12:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 8BE4CE0871 for ; Mon, 24 Apr 2023 20:12:12 +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 664A1340DBD for ; Mon, 24 Apr 2023 20:12:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 689CCA49 for ; Mon, 24 Apr 2023 20:12:09 +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: <1682367113.1684174109750be2a0d96eba93d45ddea6f3c39e.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: 1684174109750be2a0d96eba93d45ddea6f3c39e X-VCS-Branch: master Date: Mon, 24 Apr 2023 20:12:09 +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: 013a75b2-f989-49d5-9f30-ac4c1c7c46a1 X-Archives-Hash: 3e188db270f1af6c71f761056d66b3a0 commit: 1684174109750be2a0d96eba93d45ddea6f3c39e Author: Yifeng Li tomli me> AuthorDate: Mon Apr 24 05:50:09 2023 +0000 Commit: Sam James gentoo org> CommitDate: Mon Apr 24 20:11:53 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=16841741 bootstrap-prefix.sh: use --disable-darwin-at-rpath in stage2 During Gentoo prefix bootstrap stage2, GCC is built with "--disable-bootstrap". For Darwin, it means that rather than letting GCC to eventually build itself using multiple passes, we're forcing it to build with the host LLVM/clang toolchain in a single pass. It's not officially supported, but practically it worked. However, since >=gcc-12.2.0, in order to support the new embedded rpath feature on Darwin, two incompatible options, "-nodefaultrpaths" and "-nodefaultexport" are introduced. This causes linking failures, since these options are only recognized by GCC and are unknown to LLVM/clang (hypothetically, using an older GCC possibly causes the same problem as well). Thus, embedded rpath should be disabled during prefix bootstrap stage2 via --disable-darwin-at-rpath in EXTRA_ECONF. Bug: https://bugs.gentoo.org/895334 Signed-off-by: Yifeng Li tomli.me> Signed-off-by: Sam James gentoo.org> scripts/bootstrap-prefix.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index c032f7424a..392d2f9a3c 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -1893,13 +1893,37 @@ bootstrap_stage2() { EXTRA_ECONF=$(rapx --with-sysroot=/) \ emerge_pkgs --nodeps ${linker} || return 1 + # During Gentoo prefix bootstrap stage2, GCC is built with + # "--disable-bootstrap". For Darwin, it means that rather than letting + # GCC to eventually build itself using multiple passes, we're forcing + # it to build with the host LLVM/clang toolchain in a single pass. + # It's not officially supported, but practically it worked. However, + # since >=gcc-12.2.0, in order to support the new embedded rpath + # feature on Darwin, two incompatible options, "-nodefaultrpaths" and + # "-nodefaultexport" are introduced. This causes linking failures, + # since these options are only recognized by GCC and are unknown to + # LLVM/clang (hypothetically, using an older GCC possibly causes the + # same problem as well). + # + # Thus, embedded rpath should be disabled during prefix bootstrap stage2 + # and passed into EXTRA_ECONF. + # https://bugs.gentoo.org/895334 + if [[ ${CHOST} == *-darwin* ]] ; + then + local disable_darwin_rpath="--disable-darwin-at-rpath" + else + local disable_darwin_rpath="" + fi + for pkg in ${compiler_stage1} ; do # =gcc-12.2.0, rpath needs to be disabled in stage2 on + # Darwin, see above. + EXTRA_ECONF="--disable-bootstrap $(rapx --with-linker-hash-style=both) --with-local-prefix=${ROOT} ${disable_darwin_rpath}" \ MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \ GCC_MAKE_TARGET=all \ OVERRIDE_CXXFLAGS="${CPPFLAGS} -O2 -pipe" \