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 0B50515815E for ; Mon, 12 Feb 2024 08:47:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D86A2E29AE; Mon, 12 Feb 2024 08:47:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 BE1DBE29AE for ; Mon, 12 Feb 2024 08:47:18 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EF768343086 for ; Mon, 12 Feb 2024 08:47:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5EE0F13DB for ; Mon, 12 Feb 2024 08:47:16 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1707727469.ae290517d47b26295c46a1bca0fbdcfdee5bb1a8.grobian@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: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: ae290517d47b26295c46a1bca0fbdcfdee5bb1a8 X-VCS-Branch: master Date: Mon, 12 Feb 2024 08:47:16 +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: 101bcad1-63cf-4874-a45d-0d207cfbcf79 X-Archives-Hash: bad9aa8fb814878501b36581c730674c commit: ae290517d47b26295c46a1bca0fbdcfdee5bb1a8 Author: Fabian Groffen gentoo org> AuthorDate: Mon Feb 12 08:44:29 2024 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Mon Feb 12 08:44:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ae290517 scripts/bootstrap-prefix: unbreak arm64-macos bootstrap Trim down the guessing and more in configure_toolchain. Problem is that configure_toolchain is called in all three stages, and its output is used. Since we need to bootstrap a compiler very early, we need to rely on PATH for a compiler, which means in stage3 we always pick up the stage2 emerged compiler. This changes the output of the function due to a change in env. Avoid this by simply hardwiring the exceptional case, which is already hardwired before already. Signed-off-by: Fabian Groffen gentoo.org> scripts/bootstrap-prefix.sh | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 9a65ccf4fc..86ec75ee9f 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -180,34 +180,20 @@ configure_toolchain() { einfo "Triggering Darwin with GCC toolchain" compiler_stage1+=" sys-apps/darwin-miscutils" compiler_stage1+=" sys-devel/gcc" - # recent binutils-apple are hard to build (C++11 features, - # and cmake build system) so avoid going there, the system - # ld on machines with compiler that supports C11 is good - # enough to bring us to stage3, after which the @system set - # will take care of the rest - linker="sys-devel/native-cctools" - local ccvers="$(unset CHOST; ${CC} --version 2>/dev/null)" - case "${ccvers}" in - *"(GCC) "[1-9]*|"gcc ("*") "[1-9]*) - local cvers="${ccvers#*)}"; cvers="${cvers%%.*}" - # GCC-5 has C11 see above - if [[ ${cvers} -ge 5 ]] ; then - : # ok! stage1 bootstrapped one, get us a linker too - linker="=sys-devel/binutils-apple-3.2.6*" - else - # FIXME: should probably stage1 bootstrap GCC-5 - # or something - eerror "compiler ${ccvers} is too old: ${cvers} < 5" - eerror "you need a C11/C++11 compiler to bootstrap" - fi - ;; - *"Apple clang version "*|*"Apple LLVM version "*) - : # ok! + # binutils-apple/xtools doesn't work (yet) on arm64. The + # profiles will mask and keep using native-cctools for that, + # otherwise stage3 and @system will take care of switching + # to binutils-apple. + # one problem: when we have a really old linker, we need + # to use it sooner or else packages like libffi won't + # compile. + case ${CHOST} in + *-darwin[89]) + linker="=sys-devel/binutils-apple-3.2.6*" ;; *) - eerror "unknown compiler: ${ccvers}" - return 1 + linker="sys-devel/native-cctools" ;; esac ;;