diff options
author | Arnd Bergmann <arnd@arndb.de> | 2025-02-26 22:37:07 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2025-02-27 11:19:05 +0100 |
commit | fc2d5cbe541032e74a66599ba843803cebbfed0e (patch) | |
tree | 3fc22577c4787836d888b60b9d4b84787d1fb878 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 0abf508675c0dbbca6a387842f90db60756c4af5 (diff) |
x86/build: Rework CONFIG_GENERIC_CPU compiler flags
Building an x86-64 kernel with CONFIG_GENERIC_CPU is documented to
run on all CPUs, but the Makefile does not actually pass an -march=
argument, instead relying on the default that was used to configure
the toolchain.
In many cases, gcc will be configured to -march=x86-64 or -march=k8
for maximum compatibility, but in other cases a distribution default
may be either raised to a more recent ISA, or set to -march=native
to build for the CPU used for compilation. This still works in the
case of building a custom kernel for the local machine.
The point where it breaks down is building a kernel for another
machine that is older the the default target. Changing the default
to -march=x86-64 would make it work reliable, but possibly produce
worse code on distros that intentionally default to a newer ISA.
To allow reliably building a kernel for either the oldest x86-64
CPUs, pass the -march=x86-64 flag to the compiler. This was not
possible in early versions of x86-64 gcc, but works on all currently
supported versions down to at least gcc-5.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250226213714.4040853-4-arnd@kernel.org
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions