diff mbox series

boot/arm-trusted-firmware: set CFLAGS from environment, not override

Message ID 20220729210444.1787668-1-arnout@mind.be
State Accepted
Headers show
Series boot/arm-trusted-firmware: set CFLAGS from environment, not override | expand

Commit Message

Arnout Vandecappelle July 29, 2022, 9:04 p.m. UTC
Older versions of TF-A don't support setting CFLAGS on the make command
line. They use 'CFLAGS += ...' in the Makefile, which is still
overridden by the CFLAGS on the command line.

Fix this by moving the CFLAGS setting to the environment. Both older and
newer versions of TF-A handle this correctly.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/2781800954
and a large number of other defconfigs

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Kory Maincent <kory.maincent@bootlin.com>
---
v2: updated commit message to show that it's fine for new versions as
well.
---
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yann E. MORIN July 30, 2022, 3:02 p.m. UTC | #1
Arnout, All,

On 2022-07-29 23:04 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:
> Older versions of TF-A don't support setting CFLAGS on the make command
> line. They use 'CFLAGS += ...' in the Makefile, which is still
> overridden by the CFLAGS on the command line.
> 
> Fix this by moving the CFLAGS setting to the environment. Both older and
> newer versions of TF-A handle this correctly.
> 
> Fixes:
> https://gitlab.com/buildroot.org/buildroot/-/jobs/2781800954
> and a large number of other defconfigs
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Cc: Kory Maincent <kory.maincent@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
> v2: updated commit message to show that it's fine for new versions as
> well.
> ---
>  boot/arm-trusted-firmware/arm-trusted-firmware.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> index 6b0405a44a..7c4e7edb00 100644
> --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
> @@ -60,13 +60,13 @@ endif
>  
>  ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
>  	CROSS_COMPILE="$(TARGET_CROSS)" \
> -	$(if $(BR2_PIC_PIE),CFLAGS="-fno-PIE") \
>  	$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
>  	PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) \
>  	TARGET_BOARD=$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD)
>  
>  ARM_TRUSTED_FIRMWARE_MAKE_ENV += \
>  	$(TARGET_MAKE_ENV) \
> +	$(if $(BR2_PIC_PIE),CFLAGS="-fno-PIE") \
>  	ENABLE_STACK_PROTECTOR=$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL))
>  
>  ifeq ($(BR2_ARM_CPU_ARMV7A),y)
> -- 
> 2.35.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Peter Korsgaard Sept. 13, 2022, 2:35 p.m. UTC | #2
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 > Older versions of TF-A don't support setting CFLAGS on the make command
 > line. They use 'CFLAGS += ...' in the Makefile, which is still
 > overridden by the CFLAGS on the command line.

 > Fix this by moving the CFLAGS setting to the environment. Both older and
 > newer versions of TF-A handle this correctly.

 > Fixes:
 > https://gitlab.com/buildroot.org/buildroot/-/jobs/2781800954
 > and a large number of other defconfigs

 > Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 > Cc: Kory Maincent <kory.maincent@bootlin.com>
 > ---
 > v2: updated commit message to show that it's fine for new versions as
 > well.

Committed to 2022.05.x and 2022.02.x, thanks.
diff mbox series

Patch

diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
index 6b0405a44a..7c4e7edb00 100644
--- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk
+++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk
@@ -60,13 +60,13 @@  endif
 
 ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
 	CROSS_COMPILE="$(TARGET_CROSS)" \
-	$(if $(BR2_PIC_PIE),CFLAGS="-fno-PIE") \
 	$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
 	PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) \
 	TARGET_BOARD=$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD)
 
 ARM_TRUSTED_FIRMWARE_MAKE_ENV += \
 	$(TARGET_MAKE_ENV) \
+	$(if $(BR2_PIC_PIE),CFLAGS="-fno-PIE") \
 	ENABLE_STACK_PROTECTOR=$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL))
 
 ifeq ($(BR2_ARM_CPU_ARMV7A),y)