buildroot/boot
Christoph Müllner 7b3fcbcdaa boot/arm-trusted-firmware: Forward stack protection configuration
TF-A supports stack smashing protection (-fstack-protector-*).
However, that feature is currently silently disabled because
ENABLE_STACK_PROTECTOR is not set during build time.

As documented in the TF-A user guide, the flag ENABLE_STACK_PROTECTOR
is required to enable stack protection support. When enabled the symbols
for the stack protector (e.g. __stack_chk_guard) are built.
This needs to be done because TF-A does not link against an external
library that provides that symbols (e.g. libc).

So in case we see that BR2_SSP_* is enabled, let's enable the corresponding
ENABLE_STACK_PROTECTOR build flag for TF-A as documented in the TF-A user guide.

This patch also fixes a the following linker errors with older TF-A versions
if BR2_SSP_* is enabled (i.e. -fstack-protector-* is used as compiler flag)
and ENABLE_STACK_PROTECTOR is not set, which are caused by the missing
stack protector symbols:

  [...]
  params_setup.c:(.text.params_early_setup+0xc): undefined reference to `__stack_chk_guard'
  aarch64-none-linux-gnu-ld: params_setup.c:(.text.params_early_setup+0x14): undefined reference to `__stack_chk_guard'
  aarch64-none-linux-gnu-ld: params_setup.c:(.text.params_early_setup+0x104): undefined reference to `__stack_chk_guard'
  aarch64-none-linux-gnu-ld: params_setup.c:(.text.params_early_setup+0x118): undefined reference to `__stack_chk_fail'
  aarch64-none-linux-gnu-ld: ./build/px30/release/bl31/pmu.o: in function `rockchip_soc_sys_pwr_dm_suspend':
  pmu.c:(.text.rockchip_soc_sys_pwr_dm_suspend+0xc): undefined reference to `__stack_chk_guard'
  [...]

TF-A releases after Nov 2019, that include 7af195e29a4, will circumvent
these issue by explicitliy and silently disabling the stack protector
by appending '-fno-stack-protector' to the compiler flags in case
ENABLE_STACK_PROTECTOR is not set.

Tested on a Rockchip PX30 based system (TF-A v2.2 and upstream/master).

Signed-off-by: Christoph Müllner <christoph.muellner@theobroma-systems.com>
Reviewed-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2020-12-15 21:24:48 +01:00
..
afboot-stm32 boot/afboot-stm32: fix build with gcc 10 2020-09-10 20:26:27 +02:00
arm-trusted-firmware boot/arm-trusted-firmware: Forward stack protection configuration 2020-12-15 21:24:48 +01:00
at91bootstrap packages: use new $($PKG)_DL_DIR) variable 2018-04-02 15:53:53 +02:00
at91bootstrap3 boot/at91bootstrap3: bump version to 3.9.3 2020-08-07 12:00:32 +02:00
at91dataflashboot boot/*/Config.in: fix attributes order 2018-04-01 08:06:37 +02:00
barebox boot/barebox: fix target bareboxenv command compile 2020-10-04 21:30:36 +02:00
binaries-marvell binaries-marvell: bump version and switch to common firmware 2019-09-21 18:31:26 +02:00
boot-wrapper-aarch64 boot/boot-wrapper-aarch64: add gicv3 support 2019-12-12 21:22:27 +01:00
grub2 boot/grub2: Backport Boothole securify fixes 2020-08-03 13:38:49 +02:00
gummiboot boot/gummiboot: fix linking for non-host compatible targets 2019-03-26 18:53:47 +01:00
lpc32xxcdl boot/*/Config.in: fix attributes order 2018-04-01 08:06:37 +02:00
mv-ddr-marvell package/m*: add license file hashes 2020-02-03 14:45:35 +01:00
mxs-bootlets boot/*/Config.in: fix attributes order 2018-04-01 08:06:37 +02:00
opensbi boot/opensbi: bump to version 0.8 2020-06-24 21:29:18 +02:00
optee-os boot/optee-os: bump to version 3.11.0 2020-10-31 22:58:17 +01:00
s500-bootloader boot: add s500-bootloader package 2016-05-26 10:35:34 +02:00
shim boot/shim: new package 2019-01-12 17:38:25 +01:00
syslinux boot/syslinux: fix build of efi part with gnu-efi 3.0.10 2020-04-04 23:07:29 +02:00
uboot boot/uboot: fix custom repo error message 2020-11-16 21:30:56 +01:00
vexpress-firmware boot/vexpress-firmware: add upstream URL in Config.in help text 2018-09-20 21:40:03 +02:00
common.mk Fix build reproducibility in Make 3.82 2013-09-06 23:27:42 +02:00
Config.in boot/riscv-pk: Remove obselete bootloader 2019-10-11 22:52:19 +02:00