Re: [PATCH 1/2] x86, Makefile: Move the CPU-specific 64-bit tuning settings to arch/x86/Makefile.cpu

From: Masahiro Yamada
Date: Wed Aug 18 2021 - 10:52:49 EST


On Tue, Aug 17, 2021 at 11:23 PM torvic9 via Clang Built Linux
<clang-built-linux@xxxxxxxxxxxxxxxx> wrote:
>
> In accordance with the FIXME comment in arch/x86/Makefile, move the
> CPU-specific 64-bit tuning settings to arch/x86/Makefile.cpu.
>
> Signed-off-by: Tor Vic <torvic9@xxxxxxxxxxx>
> ---
> arch/x86/Makefile | 11 ++---------
> arch/x86/Makefile.cpu | 12 ++++++++++++
> 2 files changed, 14 insertions(+), 9 deletions(-)
> create mode 100644 arch/x86/Makefile.cpu
>
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 307fd0000a83..94105d7ad22c 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -119,15 +119,8 @@ else
> # Use -mskip-rax-setup if supported.
> KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
>
> - # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
> - cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
> - cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
> -
> - cflags-$(CONFIG_MCORE2) += \
> - $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
> - cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
> - $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
> - cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
> + # CPU-specific tuning (64-bit).
> + include arch/x86/Makefile.cpu




See
https://patchwork.kernel.org/project/linux-kbuild/patch/20210724183556.76680-1-masahiroy@xxxxxxxxxx/





> KBUILD_CFLAGS += $(cflags-y)
>
> KBUILD_CFLAGS += -mno-red-zone
> diff --git a/arch/x86/Makefile.cpu b/arch/x86/Makefile.cpu
> new file mode 100644
> index 000000000000..fb407ae94d90
> --- /dev/null
> +++ b/arch/x86/Makefile.cpu
> @@ -0,0 +1,12 @@
> +# SPDX-License-Identifier: GPL-2.0
> +# CPU tuning section (64-bit) - shared with UML.
> +# Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML.
> +
> +cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
> +cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
> +
> +cflags-$(CONFIG_MCORE2) += \
> + $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
> +cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
> + $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
> +cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
> --
> 2.32.0
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@xxxxxxxxxxxxxxxx.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/269701460.117528.1629210189833%40office.mailbox.org.



--
Best Regards
Masahiro Yamada