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 D59AD159C96 for ; Wed, 24 Jul 2024 09:53:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E541E2AC4; Wed, 24 Jul 2024 09:52: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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D555FE2ABD for ; Wed, 24 Jul 2024 09:52:46 +0000 (UTC) From: Andrew Ammerlaan To: gentoo-dev@lists.gentoo.org Cc: Alfred Wingate , Andrew Ammerlaan Subject: [gentoo-dev] [PATCH 3/3] kernel-build.eclass: set toolchain variables more comprehensibly Date: Wed, 24 Jul 2024 11:52:34 +0200 Message-ID: <20240724095234.310603-3-andrewammerlaan@gentoo.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240724095234.310603-1-andrewammerlaan@gentoo.org> References: <20240724095234.310603-1-andrewammerlaan@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 0836c111-2ab8-44eb-8bde-96dd75b611a1 X-Archives-Hash: 25fed35e8ae0278b53e0e15f80e2651b From: Alfred Wingate 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 Closes: https://github.com/gentoo/gentoo/pull/37690 Signed-off-by: Andrew Ammerlaan --- 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) -- 2.45.2