public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Andrew Savchenko <bircoph@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables
Date: Thu, 16 Dec 2021 03:32:10 +0300	[thread overview]
Message-ID: <20211216033210.4386092027a68457079e92b2@gentoo.org> (raw)
In-Reply-To: <20211215145826.761816-1-adrian.ratiu@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

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 <manojgupta@chromium.org>
> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> ---
>  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)

>  	export xmakeopts
>  }
>  


Best regards,
Andrew Savchenko

[-- Attachment #2: Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-12-16  0:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 14:58 [gentoo-dev] [PATCH v2] kernel-2.eclass: Respect portage CC & AR variables Adrian Ratiu
2021-12-15 21:36 ` James Beddek
2021-12-15 21:44   ` Manoj Gupta
2021-12-16 19:25   ` Adrian Ratiu
2021-12-16  0:32 ` Andrew Savchenko [this message]
2021-12-16  0:37   ` Andrew Savchenko
2021-12-16 19:29     ` Adrian Ratiu
2021-12-16 23:13       ` James Beddek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216033210.4386092027a68457079e92b2@gentoo.org \
    --to=bircoph@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox