Gentoo Archives: gentoo-dev

From: Adrian Ratiu <adrian.ratiu@×××××××××.com>
To: gentoo-dev@l.g.o
Cc: James Beddek <telans@××××××.de>, Andrew Savchenko <bircoph@g.o>, Manoj Gupta <manojgupta@××××××××.org>
Subject: [gentoo-dev] [PATCH v3] kernel-2.eclass: Respect portage toolchain variables
Date: Mon, 03 Jan 2022 17:51:28
Message-Id: 20220103174926.2194473-1-adrian.ratiu@collabora.com
1 Starting with kernel>=v5.7 the build system can override the
2 tools vars by setting LLVM=1 [1], but older kernels still use
3 the default GNU tools, so to be able to use a full LLVM/Clang
4 build, CC & co should be set to their respective portage values.
5
6 [1] a0d1c951ef08 kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
7
8 Co-authored-by: Manoj Gupta <manojgupta@××××××××.org>
9 Signed-off-by: Adrian Ratiu <adrian.ratiu@×××××××××.com>
10 ---
11 Changes in v3:
12 - Add rest of vars used by kernel builds (suggested by James)
13 - Minor commit msg rewording
14
15 Changes in v2:
16 - Set AR variable which is also required for linux-headers
17 - Reword msg for clarity
18 ---
19 eclass/kernel-2.eclass | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
23 index adc1425bc2e..865c43d3153 100644
24 --- a/eclass/kernel-2.eclass
25 +++ b/eclass/kernel-2.eclass
26 @@ -692,7 +692,7 @@ env_setup_xmakeopts() {
27 elif type -p ${CHOST}-ar >/dev/null; then
28 xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
29 fi
30 - xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
31 + xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC) LD=$(tc-getLD) AR=$(tc-getAR) NM=$(tc-getNM) NM=$(tc-getNM) OBOBJCOPY=$(tc-getOBJCOPY) READELF=$(tc-getREADELF) STRIP=$(tc-getSTRIP)"
32 export xmakeopts
33 }
34
35 --
36 2.34.1

Replies