Hi all, On Mon, 18 Oct 2021 14:14:59 -0700 Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote: > > On 10/18/21 2:30 AM, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20211015: > > > > UML (arch=um) with SUBARCH of i386 or x86_64, > using gcc, not clang: > > make[1]: Entering directory '/work/lnx/next/linux-next-20211018/UM64' > ../scripts/Makefile.clang:19: *** Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang. Stop. > make[1]: Leaving directory '/work/lnx/next/linux-next-20211018/UM64' > make: *** [Makefile:226: __sub-make] Error 2 > > > Just use a make target of defconfig: > > make ARCH=um SUBARCH=x86_64 O=UM64 defconfig OK, I missed that. In commit c862c7fee526 ("Kbuild: add Rust support") from the rust tree, these bits should probably not be there: Makefile: @@ -586,13 +628,11 @@ endif # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), # and from include/config/auto.conf.cmd to detect the compiler upgrade. CC_VERSION_TEXT = $(subst $(pound),,$(shell LC_ALL=C $(CC) --version 2>/dev/null | head -n 1)) -ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) include $(srctree)/scripts/Makefile.clang -endif # Include this also for config targets because some architectures need # cc-cross-prefix to determine CROSS_COMPILE. ifdef need-compiler include $(srctree)/scripts/Makefile.compiler in scripts/Makefile.clang the ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) endif pair near the end become unnecessary. So I will apply the following to the merge of the rust tree today: diff --git a/Makefile b/Makefile index b4482fd3a0cc..3d7c777d831f 100644 --- a/Makefile +++ b/Makefile @@ -630,7 +630,9 @@ endif # and from include/config/auto.conf.cmd to detect the compiler upgrade. CC_VERSION_TEXT = $(subst $(pound),,$(shell LC_ALL=C $(CC) --version 2>/dev/null | head -n 1)) +ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) include $(srctree)/scripts/Makefile.clang +endif # Include this also for config targets because some architectures need # cc-cross-prefix to determine CROSS_COMPILE. diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang index 38f555d0cb0d..b8e331f98471 100644 --- a/scripts/Makefile.clang +++ b/scripts/Makefile.clang @@ -40,9 +40,7 @@ TENTATIVE_CLANG_FLAGS += -Werror=ignored-optimization-argument export TENTATIVE_CLANG_FLAGS -ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) CLANG_FLAGS += $(TENTATIVE_CLANG_FLAGS) KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_AFLAGS += $(CLANG_FLAGS) export CLANG_FLAGS -endif Miguel, does that seem reasonable? -- Cheers, Stephen Rothwell
Attachment:
pgp__n7wCSMio.pgp
Description: OpenPGP digital signature