Re: [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables

2021-12-16 Thread James Beddek
On Friday, 17 December 2021 8:29:18 AM NZDT Adrian Ratiu wrote:
> Hi Andrew,
> 
> On Thu, 16 Dec 2021, Andrew Savchenko  wrote:
> > On Thu, 16 Dec 2021 03:32:10 +0300 Andrew Savchenko wrote:
> >> On Wed, 15 Dec 2021 16:58:26 +0200 Adrian Ratiu wrote:
> >> > Starting with kernel>=v5.7 the build system can override the
> >> > tools vars by setting LLVM=1 [1], but older kernels still use
> >> > the default GNU tools, so to be able to use a full LLVM/Clang
> >> > build, CC should be set together with AR to the portage set
> >> > values.   Doing this avoids situations like building the
> >> > kernel with clang (using the set HOSTCC) but using gcc/gnu-ar
> >> > for headers.   [1] a0d1c951ef08 kbuild: support LLVM=1 to
> >> > switch the default tools to Clang/LLVM  Co-authored-by: Manoj
> >> > Gupta  Signed-off-by: Adrian Ratiu
> >> >  ---
> >> > 
> >> >  eclass/kernel-2.eclass | 2 +- 1 file changed, 1
> >> >  insertion(+), 1 deletion(-)
> >> >  diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
> >> > 
> >> > index adc1425bc2e..caeec86ff59 100644 ---
> >> > a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@
> >> > -692,7 +692,7 @@ env_setup_xmakeopts() {
> >> > 
> >> >  elif type -p ${CHOST}-ar >/dev/null; then
> >> >  
> >> >  xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-" fi
> >> > 
> >> > -xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)" +
> >> > xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)
> >> > CC=$(tc-getCC) AR=$(tc-getAR)"
> >>  
> >>  OBJDUMP should be exported as well (e.g. used by
> >> 
> >> scripts/Makefile.build)
> > 
> > And LD as well.
> 
> Thank you very much for the suggestions!
> 
> I only set CC and AR because there were the two which failed in my
> testing, but yes, it is a good idea to be prudent and set them all
> if nobody is oopposed to it.
> 

I assume by set them all you're referring to what the kernel makefile uses? I 
think CC, LD, AR, NM, OBJCOPY, OBJDUMP, READELF, and STRIP is the exhaustive 
list for the kernel. (would match the new clang profile feature too)

Thanks

> I will leave this patch on the ML a bit in case there is more
> feedback (it is also EoY season so people might be busy), then I
> will send a v3 with the new variables included.
> 
> Thanks again,
> Adrian
> 
> >> >  export xmakeopts
> >> >  
> >> >  }
> >> 
> >> Best regards,
> >> Andrew Savchenko
> > 
> > Best regards,
> > Andrew Savchenko



signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables

2021-12-16 Thread Adrian Ratiu

Hi Andrew,

On Thu, 16 Dec 2021, Andrew Savchenko  wrote:
On Thu, 16 Dec 2021 03:32:10 +0300 Andrew Savchenko wrote: 
On Wed, 15 Dec 2021 16:58:26 +0200 Adrian Ratiu wrote: 
> Starting with kernel>=v5.7 the build system can override the 
> tools vars by setting LLVM=1 [1], but older kernels still use 
> the default GNU tools, so to be able to use a full LLVM/Clang 
> build, CC should be set together with AR to the portage set 
> values.   Doing this avoids situations like building the 
> kernel with clang (using the set HOSTCC) but using gcc/gnu-ar 
> for headers.   [1] a0d1c951ef08 kbuild: support LLVM=1 to 
> switch the default tools to Clang/LLVM  Co-authored-by: Manoj 
> Gupta  Signed-off-by: Adrian Ratiu 
>  --- 
>  eclass/kernel-2.eclass | 2 +- 1 file changed, 1 
>  insertion(+), 1 deletion(-) 
>  diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass 
> index adc1425bc2e..caeec86ff59 100644 --- 
> a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ 
> -692,7 +692,7 @@ env_setup_xmakeopts() { 
>  	elif type -p ${CHOST}-ar >/dev/null; then 
>  xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-" fi 
> -	xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)" + 
> xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) 
> CC=$(tc-getCC) AR=$(tc-getAR)" 
 OBJDUMP should be exported as well (e.g. used by 
scripts/Makefile.build) 


And LD as well. 
  


Thank you very much for the suggestions!

I only set CC and AR because there were the two which failed in my 
testing, but yes, it is a good idea to be prudent and set them all 
if nobody is oopposed to it.


I will leave this patch on the ML a bit in case there is more 
feedback (it is also EoY season so people might be busy), then I 
will send a v3 with the new variables included.


Thanks again,
Adrian


>export xmakeopts
>  }
>  



Best regards,
Andrew Savchenko



Best regards,
Andrew Savchenko




Re: [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables

2021-12-16 Thread Adrian Ratiu

Hi James, thank you very much for your feedback!

On Wed, 15 Dec 2021, James Beddek  wrote:
On Thursday, 16 December 2021 3:58:26 AM NZDT Adrian Ratiu 
wrote: 
Starting with kernel>=v5.7 the build system can override the 
tools vars by setting LLVM=1 [1], but older kernels still use 
the default GNU tools, so to be able to use a full LLVM/Clang 
build, CC should be set together with AR to the portage set 
values.   Doing this avoids situations like building the kernel 
with clang (using the set HOSTCC) but using gcc/gnu-ar for 
headers.   [1] a0d1c951ef08 kbuild: support LLVM=1 to switch 
the default tools to Clang/LLVM  Co-authored-by: Manoj Gupta 
 Signed-off-by: Adrian Ratiu 
 --- 
 eclass/kernel-2.eclass | 2 +- 1 file changed, 1 insertion(+), 
 1 deletion(-) 
 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass 
index adc1425bc2e..caeec86ff59 100644 --- 
a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -692,7 
+692,7 @@ env_setup_xmakeopts() { 
 	elif type -p ${CHOST}-ar >/dev/null; then 
 xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-" fi 
-	xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)" + 
xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC) 
AR=$(tc-getAR)" export xmakeopts 
 } 


What's the reason for not using $LLVM here? To preserve building 
with clang  for kernels < 5.7 ? 


That is correct - if Gentoo were to support only kernels >= 5.7 
then we could try to use $LLVM directly, but older long-term 
releases are still supported, the upstream kernel will backport 
patches to v4.14 until Jan 2024 and we would really like to build 
these with Clang too.




I might be missing the point, but wouldn't something along the 
lines of "LLVM=$(! [[ $(tc-getCC) =~ clang ]]; echo $?)" work to 
preserve the correct  compiler tools?


In theory Manoj's argument is correct: this is about respecting CC 
and the tools configuration in general so we should try to avoid 
hardcoding for clang if possible, but...


In practice I'm not aware of people building the kernel with 
something other than GNU or LLVM variants. At least these are the 
only two which receive "first class" support by the upstream 
kernel community.


In addition, hardcoding $LLVM does not fix the problem of older 
kernels.


I thought about backporting $LLVM support to long-term releases 
but I don't think it would be acceptable for inclusion in older 
kernels which should receive only bug fixes.


This is why I think the best solution is to just set the variables 
in this eclass to the values set by portage.


Thanks,
Adrian



Cheers




Re: [gentoo-dev] Last rites: net-dns/pdnsd

2021-12-16 Thread Lars Wendler
On Mon, 13 Dec 2021 20:46:40 +0300 Andrew Savchenko wrote:

>On Mon, 13 Dec 2021 09:34:46 +0100 Lars Wendler wrote:
>> On Sun, 12 Dec 2021 13:35:20 +0300 Andrew Savchenko wrote:
>> 
>> >On Tue, 7 Dec 2021 15:33:34 +0100 Lars Wendler wrote:
>> >> Fails to build with recent kernel headers (bug #801688).
>> >> Upstream is gone for a long time. Masked for removal in 30 days.
>> >> Users should switch over to net-dns/dnsmasq which provides similar
>> >> features.
>> >
>> >Depending on usage profile net-dns/unbound may be a better
>> >replacement. For me a killer feature of pdnsd was the persistent
>> >dns cache, which is very useful on mobile devices. Dnsmasq doesn't
>> >have one, but unbound now has.
>> >
>> >Best regards,
>> >Andrew Savchenko
>> 
>> Feel free to extend the mask message.
>> Although I'm considering to cancel the last rite now that a patch has
>> been submitted to bug #801688.
>
>Yes, keeping package would be the best option since patch is
>available: it has many diverse uses.
>
>Best regards,
>Andrew Savchenko

Last-rite has been canceled:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ce35657f269c3b7016e8940ad36e59cf06e12a4

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a27b0b43f00bfe239f413edaf2da398ce1bf06ec


Cheers
-- 
Lars Wendler
Gentoo package maintainer
GPG: 21CC CF02 4586 0A07 ED93  9F68 498F E765 960E 9B39


pgpo4Jf9AQkl8.pgp
Description: Digitale Signatur von OpenPGP