boot/arm-trusted-firmware: fix SSP disable in v2.2

ATF version 2.2 and older does not disable SSP when
ENABLE_STACK_PROTECTOR is not set. This is because the compiler enables
SSP by default, and ATF does not pass -fno-stack-protector to the
compiler. Upstream commit 7af195e29a42 ("Disable stack protection
explicitly") fixed the issue for v2.3 and newer.

Add -fno-stack-protector in CFLAGS when
BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP is not set to fix older ATF
versions.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/3301821171

Cc: Dick Olsson <hi@senzilla.io>
Cc: Sergey Matyukevich <geomatsi@gmail.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Baruch Siach 2022-11-13 21:09:54 +02:00 committed by Thomas Petazzoni
parent a0d1c6288a
commit 5e330ff030

View File

@ -67,11 +67,17 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP),y)
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
ENABLE_STACK_PROTECTOR=$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL))
else
ARM_TRUSTED_FIRMWARE_CFLAGS += -fno-stack-protector
endif
ifeq ($(BR2_PIC_PIE),y)
ARM_TRUSTED_FIRMWARE_CFLAGS += -fno-PIE
endif
ARM_TRUSTED_FIRMWARE_MAKE_ENV += \
$(TARGET_MAKE_ENV) \
$(if $(BR2_PIC_PIE),CFLAGS="-fno-PIE")
CFLAGS="$(ARM_TRUSTED_FIRMWARE_CFLAGS)"
ifeq ($(BR2_ARM_CPU_ARMV7A),y)
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARM_ARCH_MAJOR=7