* linux-next: build failure after merge of the tip tree
@ 2025-03-24 6:27 Stephen Rothwell
2025-03-24 6:29 ` H. Peter Anvin
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2025-03-24 6:27 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra
Cc: Ingo Molnar, Tor Vic, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 2365 bytes --]
Hi all,
After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
failed like this:
cc1: error: bad value 'native' for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids emeraldrapids alderlake raptorlake meteorlake graniterapids graniterapids-d arrowlake arrowlake-s lunarlake pantherlake bonnell atom silvermont slm goldmont goldmont-plus tremont gracemont sierraforest grandridge clearwaterforest knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 lujiazui yongfeng k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 znver5 btver1 btver2
make[3]: *** [scripts/Makefile.build:203: scripts/mod/empty.o] Error 1
cc1: error: bad value 'native' for '-march=' switch
cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids emeraldrapids alderlake raptorlake meteorlake graniterapids graniterapids-d arrowlake arrowlake-s lunarlake pantherlake bonnell atom silvermont slm goldmont goldmont-plus tremont gracemont sierraforest grandridge clearwaterforest knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 lujiazui yongfeng k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 znver5 btver1 btver2
make[3]: *** [scripts/Makefile.build:98: scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** [Makefile:1276: prepare0] Error 2
Caused by commit
0480bc7e65dc ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")
I have reverted that commit for today.
$ x86_64-linux-gnu-gcc --version
x86_64-linux-gnu-gcc (Debian 14.2.0-12) 14.2.0
cross build - ppc hosted
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: build failure after merge of the tip tree
2025-03-24 6:27 linux-next: build failure after merge of the tip tree Stephen Rothwell
@ 2025-03-24 6:29 ` H. Peter Anvin
2025-03-24 6:41 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2025-03-24 6:29 UTC (permalink / raw)
To: Stephen Rothwell, Thomas Gleixner, Ingo Molnar, Peter Zijlstra
Cc: Ingo Molnar, Tor Vic, Linux Kernel Mailing List,
Linux Next Mailing List
On March 23, 2025 11:27:23 PM PDT, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>Hi all,
>
>After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
>failed like this:
>
>cc1: error: bad value 'native' for '-march=' switch
>cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids emeraldrapids alderlake raptorlake meteorlake graniterapids graniterapids-d arrowlake arrowlake-s lunarlake pantherlake bonnell atom silvermont slm goldmont goldmont-plus tremont gracemont sierraforest grandridge clearwaterforest knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 lujiazui yongfeng k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 znver5 btver1 btver2
>make[3]: *** [scripts/Makefile.build:203: scripts/mod/empty.o] Error 1
>cc1: error: bad value 'native' for '-march=' switch
>cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids emeraldrapids alderlake raptorlake meteorlake graniterapids graniterapids-d arrowlake arrowlake-s lunarlake pantherlake bonnell atom silvermont slm goldmont goldmont-plus tremont gracemont sierraforest grandridge clearwaterforest knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 lujiazui yongfeng k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 znver5 btver1 btver2
>make[3]: *** [scripts/Makefile.build:98: scripts/mod/devicetable-offsets.s] Error 1
>make[2]: *** [Makefile:1276: prepare0] Error 2
>
>Caused by commit
>
> 0480bc7e65dc ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")
>
>I have reverted that commit for today.
>
>$ x86_64-linux-gnu-gcc --version
>x86_64-linux-gnu-gcc (Debian 14.2.0-12) 14.2.0
>
>cross build - ppc hosted
>
Cross compiling?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-next: build failure after merge of the tip tree
2025-03-24 6:29 ` H. Peter Anvin
@ 2025-03-24 6:41 ` Stephen Rothwell
2025-03-24 7:10 ` [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag Ingo Molnar
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2025-03-24 6:41 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Thomas Gleixner, Ingo Molnar, Peter Zijlstra, Ingo Molnar,
Tor Vic, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
Hi,
On Sun, 23 Mar 2025 23:29:20 -0700 "H. Peter Anvin" <hpa@zytor.com> wrote:
>
> >$ x86_64-linux-gnu-gcc --version
> >x86_64-linux-gnu-gcc (Debian 14.2.0-12) 14.2.0
> >
> >cross build - ppc hosted
> >
>
> Cross compiling?
Yes (see above :-))
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag
2025-03-24 6:41 ` Stephen Rothwell
@ 2025-03-24 7:10 ` Ingo Molnar
2025-03-24 8:06 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2025-03-24 7:10 UTC (permalink / raw)
To: Stephen Rothwell
Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar, Peter Zijlstra,
Tor Vic, Linux Kernel Mailing List, Linux Next Mailing List
* Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi,
>
> On Sun, 23 Mar 2025 23:29:20 -0700 "H. Peter Anvin" <hpa@zytor.com> wrote:
> >
> > >$ x86_64-linux-gnu-gcc --version
> > >x86_64-linux-gnu-gcc (Debian 14.2.0-12) 14.2.0
> > >
> > >cross build - ppc hosted
> > >
> >
> > Cross compiling?
>
> Yes (see above :-))
Does the patch below fix the bug?
Thanks,
Ingo
=====================>
From: Ingo Molnar <mingo@kernel.org>
Date: Mon, 24 Mar 2025 08:05:19 +0100
Subject: [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag
Stephen reported this build failure when cross-compiling:
cc1: error: bad value 'native' for '-march=' switch
Test for the availability of the -march=native flag.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Tor Vic <torvic9@mailbox.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250324172723.49fb0416@canb.auug.org.au
---
arch/x86/Kconfig.cpu | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 9d108a54c30a..87bede96e800 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -245,10 +245,14 @@ config MATOM
endchoice
+config CC_HAS_MARCH_NATIVE
+ # This flag might not be available in cross-compilers:
+ def_bool $(cc-option, -march=native)
+
config X86_NATIVE_CPU
bool "Build and optimize for local/native CPU"
depends on X86_64
- default n
+ depends on CC_HAS_MARCH_NATIVE
help
Optimize for the current CPU used to compile the kernel.
Use this option if you intend to build the kernel for your
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag
2025-03-24 7:10 ` [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag Ingo Molnar
@ 2025-03-24 8:06 ` Stephen Rothwell
2025-03-24 8:26 ` Ingo Molnar
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2025-03-24 8:06 UTC (permalink / raw)
To: Ingo Molnar
Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar, Peter Zijlstra,
Tor Vic, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 253 bytes --]
Hi Ingo,
On Mon, 24 Mar 2025 08:10:00 +0100 Ingo Molnar <mingo@kernel.org> wrote:
>
> Does the patch below fix the bug?
Yes, it does. Thanks.
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build test
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag
2025-03-24 8:06 ` Stephen Rothwell
@ 2025-03-24 8:26 ` Ingo Molnar
0 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2025-03-24 8:26 UTC (permalink / raw)
To: Stephen Rothwell
Cc: H. Peter Anvin, Thomas Gleixner, Ingo Molnar, Peter Zijlstra,
Tor Vic, Linux Kernel Mailing List, Linux Next Mailing List
* Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Ingo,
>
> On Mon, 24 Mar 2025 08:10:00 +0100 Ingo Molnar <mingo@kernel.org> wrote:
> >
> > Does the patch below fix the bug?
>
> Yes, it does. Thanks.
>
> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build test
Thank you!
Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-03-24 8:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 6:27 linux-next: build failure after merge of the tip tree Stephen Rothwell
2025-03-24 6:29 ` H. Peter Anvin
2025-03-24 6:41 ` Stephen Rothwell
2025-03-24 7:10 ` [PATCH] x86/kbuild/64: Test for the availability of the -mtune=native compiler flag Ingo Molnar
2025-03-24 8:06 ` Stephen Rothwell
2025-03-24 8:26 ` Ingo Molnar
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).