arch/arm: move -mthumb option back to ARCHCPUFLAGS

CONFIG_ARM_TOOLCHAIN_GNU_EABI build got broken when -mthumb option was moved
from ARCHCPUFLAGS to ARCHOPTIMIZATION variable:

arm-none-eabi-ld: error: .../build/nuttx/nuttx uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_fixunsdfdi.o) does not
arm-none-eabi-ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_fixunsdfdi.o)
arm-none-eabi-ld: error: .../build/nuttx/nuttx uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_udivmoddi4.o) does not
arm-none-eabi-ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/5.4.1/libgcc.a(_udivmoddi4.o)
This commit is contained in:
Alexander Lunev 2023-06-29 01:36:46 +08:00 committed by Xiang Xiao
parent d4dc0f6ec7
commit 7af151aa51

View file

@ -74,23 +74,6 @@ ifeq ($(CONFIG_MM_KASAN_ALL),y)
ARCHOPTIMIZATION += -fsanitize=kernel-address
endif
ifeq ($(CONFIG_ARM_THUMB),y)
ARCHOPTIMIZATION += -mthumb
# GCC Manual:
# -mthumb
# ... If you want to force assembler files to be interpreted as Thumb
# code, either add a `.thumb' directive to the source or pass the
# -mthumb option directly to the assembler by prefixing it with -Wa.
ARCHOPTIMIZATION += -Wa,-mthumb
# Outputs an implicit IT block when there is a conditional instruction
# without an enclosing IT block.
ARCHOPTIMIZATION += -Wa,-mimplicit-it=always
endif
ifeq ($(CONFIG_UNWINDER_ARM),y)
ARCHOPTIMIZATION += -funwind-tables -fasynchronous-unwind-tables
endif
@ -144,6 +127,23 @@ endif
ARCHCPUFLAGS += $(TOOLCHAIN_MARCH) $(TOOLCHAIN_MTUNE) $(TOOLCHAIN_MFLOAT)
ifeq ($(CONFIG_ARM_THUMB),y)
ARCHCPUFLAGS += -mthumb
# GCC Manual:
# -mthumb
# ... If you want to force assembler files to be interpreted as Thumb
# code, either add a `.thumb' directive to the source or pass the
# -mthumb option directly to the assembler by prefixing it with -Wa.
ARCHCPUFLAGS += -Wa,-mthumb
# Outputs an implicit IT block when there is a conditional instruction
# without an enclosing IT block.
ARCHCPUFLAGS += -Wa,-mimplicit-it=always
endif
# Clang toolchain
ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)