Commit 79d75d752717fb4106ec49abaddbd7744c775a35

Authored by Masahiro Yamada
Committed by Albert ARIBAUD
1 parent d8bafe1310

ARM: move -march=* and -mtune= options to arch/arm/Makefile

My main motivations for this commit are:

[1] Follow the arch/arm/Makefile style of Linux Kernel

[2] Maintain compiler options systematically
  Currently, we give -march=* and -mtune=* options inconsistently:
  Only some of the CPUs pass -march=* and -mtune=* options.
  By collecting such options into the single place arch/arm/Makefile
  we can tell which options are missing at a glance.

[3] Prepare for deprecating arch/*/cpu/*/config.mk

Note:
  This commit just moves the compiler options so as not to change
  the behavior at all.  It does not care about the correctness of
  the given options.  Fox example, "-march=armv5te" might be better
  than "-march=armv4" for ARM946EJS, but it is beyond the scope this
  commit.  Also, filling the missing -march=* and -tune=* is left
  to follow-up patches.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Stefan Roese <sr@denx.de>

Showing 11 changed files with 32 additions and 69 deletions Side-by-side Diff

... ... @@ -2,6 +2,38 @@
2 2 # SPDX-License-Identifier: GPL-2.0+
3 3 #
4 4  
  5 +# This selects which instruction set is used.
  6 +arch-$(CONFIG_CPU_ARM720T) =-march=armv4
  7 +arch-$(CONFIG_CPU_ARM920T) =-march=armv4
  8 +arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te
  9 +arch-$(CONFIG_CPU_ARM946ES) =-march=armv4
  10 +arch-$(CONFIG_CPU_SA1100) =-march=armv4
  11 +arch-$(CONFIG_CPU_PXA) =
  12 +arch-$(CONFIG_CPU_ARM1136) =-march=armv5
  13 +arch-$(CONFIG_CPU_ARM1176) =-march=armv5t
  14 +arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, -march=armv5)
  15 +arch-$(CONFIG_ARM64) =-march=armv8-a
  16 +
  17 +# Evaluate arch cc-option calls now
  18 +arch-y := $(arch-y)
  19 +
  20 +# This selects how we optimise for the processor.
  21 +tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
  22 +tune-$(CONFIG_CPU_ARM920T) =
  23 +tune-$(CONFIG_CPU_ARM926EJS) =
  24 +tune-$(CONFIG_CPU_ARM946ES) =
  25 +tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
  26 +tune-$(CONFIG_CPU_PXA) =-mcpu=xscale
  27 +tune-$(CONFIG_CPU_ARM1136) =
  28 +tune-$(CONFIG_CPU_ARM1176) =
  29 +tune-$(CONFIG_CPU_V7) =
  30 +tune-$(CONFIG_ARM64) =
  31 +
  32 +# Evaluate tune cc-option calls now
  33 +tune-y := $(tune-y)
  34 +
  35 +PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
  36 +
5 37 # Machine directory name. This list is sorted alphanumerically
6 38 # by CONFIG_* macro name.
7 39 machine-$(CONFIG_ARCH_AT91) += at91
arch/arm/cpu/arm1136/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
4   -#
5   -# SPDX-License-Identifier: GPL-2.0+
6   -#
7   -
8   -# Make ARMv5 to allow more compilers to work, even though its v6.
9   -PLATFORM_CPPFLAGS += -march=armv5
arch/arm/cpu/arm1176/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
4   -#
5   -# SPDX-License-Identifier: GPL-2.0+
6   -#
7   -
8   -# Make ARMv5 to allow more compilers to work, even though its v6.
9   -PLATFORM_CPPFLAGS += -march=armv5t
arch/arm/cpu/arm720t/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4   -# Marius Groeger <mgroeger@sysgo.de>
5   -#
6   -# SPDX-License-Identifier: GPL-2.0+
7   -#
8   -
9   -PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
arch/arm/cpu/arm920t/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
4   -#
5   -# SPDX-License-Identifier: GPL-2.0+
6   -#
7   -
8   -PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/arm926ejs/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
4   -#
5   -# SPDX-License-Identifier: GPL-2.0+
6   -#
7   -
8   -PLATFORM_CPPFLAGS += -march=armv5te
arch/arm/cpu/arm946es/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
4   -#
5   -# SPDX-License-Identifier: GPL-2.0+
6   -#
7   -
8   -PLATFORM_CPPFLAGS += -march=armv4
arch/arm/cpu/armv7/config.mk
... ... @@ -5,11 +5,6 @@
5 5 # SPDX-License-Identifier: GPL-2.0+
6 6 #
7 7  
8   -# If armv7-a is not supported by GCC fall-back to armv5, which is
9   -# supported by more tool-chains
10   -PF_CPPFLAGS_ARMV7 := $(call cc-option, -march=armv7-a, -march=armv5)
11   -PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
12   -
13 8 # On supported platforms we set the bit which causes us to trap on unaligned
14 9 # memory access. This is the opposite of what the compiler expects to be
15 10 # the default so we must pass in -mno-unaligned-access so that it is aware
arch/arm/cpu/armv8/config.mk
... ... @@ -6,8 +6,6 @@
6 6 #
7 7 PLATFORM_RELFLAGS += -fno-common -ffixed-x18
8 8  
9   -PF_CPPFLAGS_ARMV8 := $(call cc-option, -march=armv8-a)
10 9 PF_NO_UNALIGNED := $(call cc-option, -mstrict-align)
11   -PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV8)
12 10 PLATFORM_CPPFLAGS += $(PF_NO_UNALIGNED)
arch/arm/cpu/pxa/config.mk
... ... @@ -6,8 +6,6 @@
6 6 # SPDX-License-Identifier: GPL-2.0+
7 7 #
8 8  
9   -PLATFORM_CPPFLAGS += -mcpu=xscale
10   -
11 9 #
12 10 # !WARNING!
13 11 # The PXA's OneNAND SPL uses .text.0 and .text.1 segments to allow booting from
arch/arm/cpu/sa1100/config.mk
1   -#
2   -# (C) Copyright 2002
3   -# Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4   -# Marius Groeger <mgroeger@sysgo.de>
5   -#
6   -# SPDX-License-Identifier: GPL-2.0+
7   -#
8   -
9   -PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100