linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Shuah Khan <shuah@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH 2/3] selftests/nolibc: don't pass CC to toplevel Makefile
Date: Sun, 17 Aug 2025 11:39:05 +0200	[thread overview]
Message-ID: <20250817093905.GA14213@1wt.eu> (raw)
In-Reply-To: <ebb84a9c-8771-4791-8a81-b615cecec7c3@t-8ch.de>

Hi Thomas!

On Sun, Aug 17, 2025 at 10:30:52AM +0200, Thomas Weißschuh wrote:
> Hi Willy,
> 
> On 2025-07-21 04:56:27+0200, Willy Tarreau wrote:
> > On Sat, Jul 19, 2025 at 05:38:28PM +0200, Thomas Weißschuh wrote:
> > > The toplevel Makefile is capable of calculating CC from CROSS_COMPILE
> > > and/or ARCH.
> > > 
> > > Stop passing the unnecessary variable.
> > (...) 
> > >  # Execute the toplevel kernel Makefile
> > > -KBUILD_MAKE = $(MAKE) -C $(srctree) ARCH=$(ARCH) CC=$(CC) CROSS_COMPILE=$(CROSS_COMPILE)
> > > +KBUILD_MAKE = $(MAKE) -C $(srctree) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
> > 
> > Here the goal was not to help the toplevel Makefile figure CC, but rather
> > to permit the user to override it, and it's also listed in "make help",
> > and even used in cc-option.
> > 
> > I understnad that you're trying to avoid forcing CC to clang when
> > building, but in this case, what will CROSS_COMPILE contain ?  My
> > guess is that you intend to make CROSS_COMPILE point to the gcc-based
> > toolchain, and have CC point to clang for userland only. Is this the
> > case ?
> 
> Correct.
> 
> > I think I'd be fine with this, but then we need to make it
> > explicit in the help message and fix the current one, possibly just
> > with this:
> > 
> > -	@echo "  nolibc-test       build the executable (uses \$$CC and \$$CROSS_COMPILE)"
> > +	@echo "  nolibc-test       build the executable (uses \$$CC)"
> 
> I don't think this is correct. $CC itself depends on $CROSS_COMPILE
> through tools/scripts/Makefile.include.

I don't understand what you mean by "depends on" here. CC defaults
to ${CROSS_COMPILE}gcc and may override it if set. So if one sets
CC, CROSS_COMPILE will not be used for it. Or maybe we could change
it to this to indicate a precedence if that's the idea you want to
convey ?

 -	@echo "  nolibc-test       build the executable (uses \$$CC and \$$CROSS_COMPILE)"
 +	@echo "  nolibc-test       build the executable (uses \$$CC or \$$CROSS_COMPILE)"

Willy

  reply	other threads:[~2025-08-17  9:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-19 15:38 [PATCH 0/3] selftests/nolibc: enable qemu-system tests with LLVM builds Thomas Weißschuh
2025-07-19 15:38 ` [PATCH 1/3] selftests/nolibc: deduplicate invocations of toplevel Makefile Thomas Weißschuh
2025-07-19 15:38 ` [PATCH 2/3] selftests/nolibc: don't pass CC to " Thomas Weißschuh
2025-07-21  2:56   ` Willy Tarreau
2025-08-17  8:30     ` Thomas Weißschuh
2025-08-17  9:39       ` Willy Tarreau [this message]
2025-08-18 14:07         ` Thomas Weißschuh
2025-08-19  3:54           ` Willy Tarreau
2025-07-19 15:38 ` [PATCH 3/3] selftests/nolibc: always compile the kernel with GCC Thomas Weißschuh
2025-07-21  2:57 ` [PATCH 0/3] selftests/nolibc: enable qemu-system tests with LLVM builds Willy Tarreau

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=20250817093905.GA14213@1wt.eu \
    --to=w@1wt.eu \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=shuah@kernel.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;
as well as URLs for NNTP newsgroup(s).