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