public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Adrian Ratiu <adrian.ratiu@collabora.com>
To: gentoo-dev@lists.gentoo.org
Cc: Manoj Gupta <manojgupta@chromium.org>
Subject: [gentoo-dev] [PATCH] kernel-2.eclass: Respect portage CC variable
Date: Mon, 29 Nov 2021 13:30:06 +0200	[thread overview]
Message-ID: <20211129113006.816430-1-adrian.ratiu@collabora.com> (raw)

Starting with kernel >= v5.7 the build system can override this
variable by passing LLVM=1 [1], but for older kernels or in
cases where the LLVM toolchain is setup directly via portage,
CC should be respected to avoid situations like building the
kernel with clang but the headers with gcc.

[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..9a7d96d26c7 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)"
 	export xmakeopts
 }
 
-- 
2.34.0



                 reply	other threads:[~2021-11-29 11:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211129113006.816430-1-adrian.ratiu@collabora.com \
    --to=adrian.ratiu@collabora.com \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=manojgupta@chromium.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