Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Cc: James Beddek <telans@××××××.de>, Andrew Savchenko <bircoph@g.o>, Manoj Gupta <manojgupta@××××××××.org>
Subject: Re: [gentoo-dev] [PATCH v3] kernel-2.eclass: Respect portage toolchain variables
Date: Mon, 03 Jan 2022 18:23:42
Message-Id: CAJ0EP42NtVKzr0DHC96gfm7bK5DFrcdMoT-rh_o4YUoZwbw4xQ@mail.gmail.com
In Reply to: [gentoo-dev] [PATCH v3] kernel-2.eclass: Respect portage toolchain variables by Adrian Ratiu
1 On Mon, Jan 3, 2022 at 12:49 PM Adrian Ratiu <adrian.ratiu@×××××××××.com> wrote:
2 >
3 > Starting with kernel>=v5.7 the build system can override the
4 > tools vars by setting LLVM=1 [1], but older kernels still use
5 > the default GNU tools, so to be able to use a full LLVM/Clang
6 > build, CC & co should be set to their respective portage values.
7 >
8 > [1] a0d1c951ef08 kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
9 >
10 > Co-authored-by: Manoj Gupta <manojgupta@××××××××.org>
11 > Signed-off-by: Adrian Ratiu <adrian.ratiu@×××××××××.com>
12 > ---
13 > Changes in v3:
14 > - Add rest of vars used by kernel builds (suggested by James)
15 > - Minor commit msg rewording
16 >
17 > Changes in v2:
18 > - Set AR variable which is also required for linux-headers
19 > - Reword msg for clarity
20 > ---
21 > eclass/kernel-2.eclass | 2 +-
22 > 1 file changed, 1 insertion(+), 1 deletion(-)
23 >
24 > diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
25 > index adc1425bc2e..865c43d3153 100644
26 > --- a/eclass/kernel-2.eclass
27 > +++ b/eclass/kernel-2.eclass
28 > @@ -692,7 +692,7 @@ env_setup_xmakeopts() {
29 > elif type -p ${CHOST}-ar >/dev/null; then
30 > xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
31 > fi
32 > - xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
33 > + 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)"
34 > export xmakeopts
35 > }
36
37 This seems ok to me, at least given the way the eclass currently works.
38
39 At some point, we should really convert xmakeopts into an array. Any
40 of these variables might contain spaces, and that would break the
41 current implementation.

Replies