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 770A61581F3 for ; Sat, 30 Nov 2024 05:10:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9BD82E07D0; Sat, 30 Nov 2024 05:10:47 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 BEC71E07D0 for ; Sat, 30 Nov 2024 05:10:46 +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 D172A342F9B for ; Sat, 30 Nov 2024 05:10:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3C51316DA for ; Sat, 30 Nov 2024 05:10:44 +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: <1732943429.6d9336278643e0ad9fc99cfd497d50c3a8f30319.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/toolchain.eclass X-VCS-Directories: eclass/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 6d9336278643e0ad9fc99cfd497d50c3a8f30319 X-VCS-Branch: master Date: Sat, 30 Nov 2024 05:10:44 +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: 719e4d18-eb4d-48f9-952a-9438939514ee X-Archives-Hash: e5409b8e1549784b509614712e4a5874 commit: 6d9336278643e0ad9fc99cfd497d50c3a8f30319 Author: Sam James gentoo org> AuthorDate: Sat Nov 30 02:59:57 2024 +0000 Commit: Sam James gentoo org> CommitDate: Sat Nov 30 05:10:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d933627 toolchain.eclass: wire up offloading for nvptx 'crossdev -t nvptx-none' creates a standalone cross-compiler which is needed anyway, but by itself, it's less useful than offloading support within host gcc, where GCC can choose to offload into that cross-compiler as appropriate. This could include amdgcn-amdhsa support in the future. Bug: https://bugs.gentoo.org/945296 Signed-off-by: Sam James gentoo.org> eclass/toolchain.eclass | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index bcc47ffb9635..5b68c5acbc49 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1312,8 +1312,30 @@ toolchain_src_configure() { ;; nvptx*) needed_libc=newlib - # "LTO is not supported for this target" - confgcc+=( --disable-lto ) + confgcc+=( + # "LTO is not supported for this target" + --disable-lto + ) + + # --enable-as-accelerator-for= seems to disable + # installing nvtpx-none-cc etc, so we have to + # avoid passing that for the stage1-build that + # crossdev does. If we pass it unconditionally, + # we can't build newlib after building stage1 gcc. + if has_version ${CATEGORY}/${PN} ; then + confgcc+=( + # It's unlikely that anyone will want + # to build nvptx-none as a pure standalone + # toolchain (which will be single-threaded, etc). + # + # If someone really wants it, we can see about + # adding a USE=offload or similar based on CTARGET + # for cross targets. But for now, we always assume + # we're being built as an offloading compiler (accelerator). + --enable-as-accelerator-for=${CHOST} + --disable-sjlj-exceptions + ) + fi ;; esac @@ -1547,6 +1569,12 @@ toolchain_src_configure() { [[ ${CTARGET} == *-darwin* ]] && \ confgcc+=( --enable-version-specific-runtime-libs ) + # TODO: amdgcn-amdhsa? + [[ ${CTARGET} == x86_64* ]] && confgcc+=( + --enable-offload-defaulted + --enable-offload-targets=nvptx-none + ) + ### library options if in_iuse openmp ; then