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 DDFA8159C96 for ; Wed, 24 Jul 2024 17:19:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CDD1FE2AB0; Wed, 24 Jul 2024 17:19:00 +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 954C5E2AB0 for ; Wed, 24 Jul 2024 17:19:00 +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 9D00A341B27 for ; Wed, 24 Jul 2024 17:18:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0E1741E55 for ; Wed, 24 Jul 2024 17:18:58 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1721841512.0edf1af9e3cd350ebe7476d283e0e05918899bd9.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/kernel-build.eclass X-VCS-Directories: eclass/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: 0edf1af9e3cd350ebe7476d283e0e05918899bd9 X-VCS-Branch: master Date: Wed, 24 Jul 2024 17:18:58 +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: 2c34496b-ed98-4a59-ad4b-66252360ba65 X-Archives-Hash: aac06c91590e3692686fbf461b5beffa commit: 0edf1af9e3cd350ebe7476d283e0e05918899bd9 Author: Alfred Wingate protonmail com> AuthorDate: Tue Jul 23 14:11:41 2024 +0000 Commit: Andrew Ammerlaan gentoo org> CommitDate: Wed Jul 24 17:18:32 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0edf1af9 kernel-build.eclass: set toolchain variables more comprehensibly Building on llvm profiles is problematic if toolchain variables are not properly set. So set HOSTLD and HOSTAR to match at least the kernels own LLVM=1 variable to ensure a smoother build for end users. For example an unset HOSTLD causes issues as it defaults to GNU ld otherwise. https://docs.kernel.org/kbuild/llvm.html#the-llvm-argument Signed-off-by: Alfred Wingate protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/37690 Signed-off-by: Andrew Ammerlaan gentoo.org> eclass/kernel-build.eclass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index f478cf636a27..893a1bdb449c 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -187,6 +187,10 @@ kernel-build_src_configure() { fi # force ld.bfd if we can find it easily + local HOSTLD="$(tc-getBUILD_LD)" + if type -P "${HOSTLD}.bfd" &>/dev/null; then + HOSTLD+=.bfd + fi local LD="$(tc-getLD)" if type -P "${LD}.bfd" &>/dev/null; then LD+=.bfd @@ -198,6 +202,8 @@ kernel-build_src_configure() { HOSTCC="$(tc-getBUILD_CC)" HOSTCXX="$(tc-getBUILD_CXX)" + HOSTLD="${HOSTLD}" + HOSTAR="$(tc-getBUILD_AR)" HOSTCFLAGS="${BUILD_CFLAGS}" HOSTLDFLAGS="${BUILD_LDFLAGS}" @@ -210,6 +216,7 @@ kernel-build_src_configure() { STRIP="$(tc-getSTRIP)" OBJCOPY="$(tc-getOBJCOPY)" OBJDUMP="$(tc-getOBJDUMP)" + READELF="$(tc-getREADELF)" # we need to pass it to override colliding Gentoo envvar ARCH=$(tc-arch-kernel)