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 (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 625AD158232 for ; Sun, 8 Dec 2024 03:18:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3B8E3E107E; Sun, 8 Dec 2024 03:18:48 +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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B41E7E1084 for ; Sun, 8 Dec 2024 03:18:47 +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 992DA3430E2 for ; Sun, 8 Dec 2024 03:18:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 23B49AED for ; Sun, 8 Dec 2024 03:18:45 +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: <1733627800.491f85516b7903a4893cbd2bd0a3dcf6a7423c93.sam@gentoo> Subject: [gentoo-commits] proj/gcc-config:master commit in: / X-VCS-Repository: proj/gcc-config X-VCS-Files: gcc-config X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 491f85516b7903a4893cbd2bd0a3dcf6a7423c93 X-VCS-Branch: master Date: Sun, 8 Dec 2024 03:18:45 +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: b5ca7907-3f51-4465-b864-fd98488abfa9 X-Archives-Hash: f7819fc8dd226253803fcd6572a6a1a1 commit: 491f85516b7903a4893cbd2bd0a3dcf6a7423c93 Author: Sam James gentoo org> AuthorDate: Sun Dec 1 01:30:31 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sun Dec 8 03:16:40 2024 +0000 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=491f8551 gcc-config: handle offload/accel compilers properly accel/offload compilers are named like 'x86_64-pc-linux-gnu-accel-nvptx-none-gcc'. When building the offload compiler, we'll have ${CHOST}-${CTARGET} where CHOST is the host and CTARGET is whatever the offload target is. gcc-config doesn't expect this 'double tuple'. e.g. when building nvptx-none, we'll have something like 'nvptx-none-x86_64-pc-linux-gnu-accel-nvptx-none-gcc' and we want to strip that to be just x86_64-pc-linux-gnu-accel-nvptx-none-gcc, as that's what we want symlinks to be made for in /usr/bin. Bug: https://bugs.gentoo.org/945296 Signed-off-by: Sam James gentoo.org> gcc-config | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc-config b/gcc-config index 404ab29..4e92445 100755 --- a/gcc-config +++ b/gcc-config @@ -318,7 +318,7 @@ update_wrappers() { x=${x%:*} if [[ ! -x ${ref} ]] ; then - if is_cross_compiler ; then + if is_cross_compiler && [[ ${ref} != *-accel-* ]] ; then ewarn "insanity with ${x} and ${ref}" else # For native targets, the ref might not be @@ -332,6 +332,16 @@ update_wrappers() { # Delete stale native symlink. rm -f "${EROOT}usr/bin/${x}" elif [[ -x ${ref} ]] ; then + # accel/offload compilers are named like 'x86_64-pc-linux-gnu-accel-nvptx-none-gcc'. + # + # When building the offload compiler, we'll have ${CHOST}-${CTARGET} where + # CHOST is the host and CTARGET is whatever the offload target is. gcc-config + # doesn't expect this 'double tuple'. + # + # e.g. when building nvptx-none, we'll have something like 'nvptx-none-x86_64-pc-linux-gnu-accel-nvptx-none-gcc' + # and we want to strip that to be just x86_64-pc-linux-gnu-accel-nvptx-none-gcc, as that's + # what we want symlinks to be made for in /usr/bin. + [[ ${x} == *-accel-* ]] && x="${x#${CTARGET}-}" atomic_ln "${ref#${ROOT}}" "${EROOT}usr/bin" "${x}" else # Make sure we have no stale wrappers