Skip to content

Commit 418ace9

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9156/1: drop cc-option fallbacks for architecture selection
Naresh and Antonio ran into a build failure with latest Debian armhf compilers, with lots of output like tmp/ccY3nOAs.s:2215: Error: selected processor does not support `cpsid i' in ARM mode As it turns out, $(cc-option) fails early here when the FPU is not selected before CPU architecture is selected, as the compiler option check runs before enabling -msoft-float, which causes a problem when testing a target architecture level without an FPU: cc1: error: '-mfloat-abi=hard': selected architecture lacks an FPU Passing e.g. -march=armv6k+fp in place of -march=armv6k would avoid this issue, but the fallback logic is already broken because all supported compilers (gcc-5 and higher) are much more recent than these options, and building with -march=armv5t as a fallback no longer works. The best way forward that I see is to just remove all the checks, which also has the nice side-effect of slightly improving the startup time for 'make'. The -mtune=marvell-f option was apparently never supported by any mainline compiler, and the custom Codesourcery gcc build that did support is now too old to build kernels, so just use -mtune=xscale unconditionally for those. This should be safe to apply on all stable kernels, and will be required in order to keep building them with gcc-11 and higher. Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996419 Reported-by: Antonio Terceiro <[email protected]> Reported-by: Naresh Kamboju <[email protected]> Reported-by: Sebastian Andrzej Siewior <[email protected]> Tested-by: Sebastian Reichel <[email protected]> Tested-by: Klaus Kudielka <[email protected]> Cc: Matthias Klose <[email protected]> Cc: [email protected] Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 0d08e7b commit 418ace9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

arch/arm/Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra)
6060
# Note that GCC does not numerically define an architecture version
6161
# macro, but instead defines a whole series of macros which makes
6262
# testing for a specific architecture or later rather impossible.
63-
arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m
64-
arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
65-
arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
63+
arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m
64+
arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -march=armv7-a
65+
arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 -march=armv6
6666
# Only override the compiler option if ARMv6. The ARMv6K extensions are
6767
# always available in ARMv7
6868
ifeq ($(CONFIG_CPU_32v6),y)
69-
arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
69+
arch-$(CONFIG_CPU_32v6K) =-D__LINUX_ARM_ARCH__=6 -march=armv6k
7070
endif
71-
arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
71+
arch-$(CONFIG_CPU_32v5) =-D__LINUX_ARM_ARCH__=5 -march=armv5te
7272
arch-$(CONFIG_CPU_32v4T) =-D__LINUX_ARM_ARCH__=4 -march=armv4t
7373
arch-$(CONFIG_CPU_32v4) =-D__LINUX_ARM_ARCH__=4 -march=armv4
7474
arch-$(CONFIG_CPU_32v3) =-D__LINUX_ARM_ARCH__=3 -march=armv3m
@@ -82,19 +82,19 @@ tune-$(CONFIG_CPU_ARM720T) =-mtune=arm7tdmi
8282
tune-$(CONFIG_CPU_ARM740T) =-mtune=arm7tdmi
8383
tune-$(CONFIG_CPU_ARM9TDMI) =-mtune=arm9tdmi
8484
tune-$(CONFIG_CPU_ARM940T) =-mtune=arm9tdmi
85-
tune-$(CONFIG_CPU_ARM946E) =$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi)
85+
tune-$(CONFIG_CPU_ARM946E) =-mtune=arm9e
8686
tune-$(CONFIG_CPU_ARM920T) =-mtune=arm9tdmi
8787
tune-$(CONFIG_CPU_ARM922T) =-mtune=arm9tdmi
8888
tune-$(CONFIG_CPU_ARM925T) =-mtune=arm9tdmi
8989
tune-$(CONFIG_CPU_ARM926T) =-mtune=arm9tdmi
9090
tune-$(CONFIG_CPU_FA526) =-mtune=arm9tdmi
9191
tune-$(CONFIG_CPU_SA110) =-mtune=strongarm110
9292
tune-$(CONFIG_CPU_SA1100) =-mtune=strongarm1100
93-
tune-$(CONFIG_CPU_XSCALE) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
94-
tune-$(CONFIG_CPU_XSC3) =$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
95-
tune-$(CONFIG_CPU_FEROCEON) =$(call cc-option,-mtune=marvell-f,-mtune=xscale)
96-
tune-$(CONFIG_CPU_V6) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
97-
tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
93+
tune-$(CONFIG_CPU_XSCALE) =-mtune=xscale
94+
tune-$(CONFIG_CPU_XSC3) =-mtune=xscale
95+
tune-$(CONFIG_CPU_FEROCEON) =-mtune=xscale
96+
tune-$(CONFIG_CPU_V6) =-mtune=arm1136j-s
97+
tune-$(CONFIG_CPU_V6K) =-mtune=arm1136j-s
9898

9999
# Evaluate tune cc-option calls now
100100
tune-y := $(tune-y)

0 commit comments

Comments
 (0)