From 1061ed6c6273e90618b05ddc0cb66be17364da33 Mon Sep 17 00:00:00 2001 From: Kory Maincent Date: Tue, 31 May 2022 10:44:28 +0200 Subject: [PATCH] boot/arm-trusted-firmware: add -fno-PIE to CFLAGS By default the toolchain-wrapper enable -fPIE to the build of all packages. TF-A support Position Independent Executable(PIE) only in few build cases, therefore it should be disable by default. If you still want to enable PIE, TF-A provide a "ENABLE_PIE" build options that will override the cflags for the supported cases. Signed-off-by: Kory Maincent [Peter: Only do so for BR2_PIC_PIE] Signed-off-by: Peter Korsgaard --- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 03fa83b7b5..35a95a7ec2 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -50,6 +50,7 @@ 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)