Gentoo Archives: gentoo-dev

From: James Beddek <telans@××××××.de>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables
Date: Thu, 16 Dec 2021 23:13:38
Message-Id: 2805381.e9J7NaK4W3@desktop
In Reply to: Re: [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables by Adrian Ratiu
1 On Friday, 17 December 2021 8:29:18 AM NZDT Adrian Ratiu wrote:
2 > Hi Andrew,
3 >
4 > On Thu, 16 Dec 2021, Andrew Savchenko <bircoph@g.o> wrote:
5 > > On Thu, 16 Dec 2021 03:32:10 +0300 Andrew Savchenko wrote:
6 > >> On Wed, 15 Dec 2021 16:58:26 +0200 Adrian Ratiu wrote:
7 > >> > Starting with kernel>=v5.7 the build system can override the
8 > >> > tools vars by setting LLVM=1 [1], but older kernels still use
9 > >> > the default GNU tools, so to be able to use a full LLVM/Clang
10 > >> > build, CC should be set together with AR to the portage set
11 > >> > values. Doing this avoids situations like building the
12 > >> > kernel with clang (using the set HOSTCC) but using gcc/gnu-ar
13 > >> > for headers. [1] a0d1c951ef08 kbuild: support LLVM=1 to
14 > >> > switch the default tools to Clang/LLVM Co-authored-by: Manoj
15 > >> > Gupta <manojgupta@××××××××.org> Signed-off-by: Adrian Ratiu
16 > >> > <adrian.ratiu@×××××××××.com> ---
17 > >> >
18 > >> > eclass/kernel-2.eclass | 2 +- 1 file changed, 1
19 > >> > insertion(+), 1 deletion(-)
20 > >> > diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
21 > >> >
22 > >> > index adc1425bc2e..caeec86ff59 100644 ---
23 > >> > a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@
24 > >> > -692,7 +692,7 @@ env_setup_xmakeopts() {
25 > >> >
26 > >> > elif type -p ${CHOST}-ar >/dev/null; then
27 > >> >
28 > >> > xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-" fi
29 > >> >
30 > >> > - xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)" +
31 > >> > xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)
32 > >> > CC=$(tc-getCC) AR=$(tc-getAR)"
33 > >>
34 > >> OBJDUMP should be exported as well (e.g. used by
35 > >>
36 > >> scripts/Makefile.build)
37 > >
38 > > And LD as well.
39 >
40 > Thank you very much for the suggestions!
41 >
42 > I only set CC and AR because there were the two which failed in my
43 > testing, but yes, it is a good idea to be prudent and set them all
44 > if nobody is oopposed to it.
45 >
46
47 I assume by set them all you're referring to what the kernel makefile uses? I
48 think CC, LD, AR, NM, OBJCOPY, OBJDUMP, READELF, and STRIP is the exhaustive
49 list for the kernel. (would match the new clang profile feature too)
50
51 Thanks
52
53 > I will leave this patch on the ML a bit in case there is more
54 > feedback (it is also EoY season so people might be busy), then I
55 > will send a v3 with the new variables included.
56 >
57 > Thanks again,
58 > Adrian
59 >
60 > >> > export xmakeopts
61 > >> >
62 > >> > }
63 > >>
64 > >> Best regards,
65 > >> Andrew Savchenko
66 > >
67 > > Best regards,
68 > > Andrew Savchenko

Attachments

File name MIME type
signature.asc application/pgp-signature