lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-EFSKxiqbGPT9CQ@gmail.com>
Date: Mon, 24 Mar 2025 08:10:00 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Stephen Rothwell <sfr@...b.auug.org.au>
Cc: "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Tor Vic <torvic9@...lbox.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: [PATCH] x86/kbuild/64: Test for the availability of the
 -mtune=native compiler flag


* Stephen Rothwell <sfr@...b.auug.org.au> wrote:

> Hi,
> 
> On Sun, 23 Mar 2025 23:29:20 -0700 "H. Peter Anvin" <hpa@...or.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@...nel.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@...b.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: Tor Vic <torvic9@...lbox.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Juergen Gross <jgross@...e.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Kees Cook <keescook@...omium.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ