From 77aede7c87b3364eb30cce31db421a88321fb0d1 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 2 Dec 2022 03:03:57 +0800 Subject: [PATCH] arm/thumb: outputs an implicit IT block to avoid build break Fix build break on thumb2 mode: opus/celt/arm/celt_pitch_xcorr_arm-gnu.S: Assembler messages: opus/celt/arm/celt_pitch_xcorr_arm-gnu.S:146: Error: thumb conditional instruction should be in IT block -- `movle pc,lr' Reference: https://developer.arm.com/documentation/100067/0612/armclang-Command-line-Options/-mimplicit-it In A32 code, the integrated assembler accepts all conditional instructions without giving an error or warning. In T32 code, the integrated assembler outputs an implicit IT block when there is a conditional instruction without an enclosing IT block. The integrated assembler does not give an error or warning about this. Signed-off-by: chao an --- arch/arm/src/common/Toolchain.defs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs index fa3624d2b05..bb81af0b0e4 100644 --- a/arch/arm/src/common/Toolchain.defs +++ b/arch/arm/src/common/Toolchain.defs @@ -80,6 +80,11 @@ ifeq ($(CONFIG_ARM_THUMB),y) # -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)