From 64bf0c2cada67d4959409d664ca8797e583b7a85 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Wed, 8 Oct 2025 13:46:19 +0200 Subject: [PATCH] armTrustedFirmwareRK3399 fix compilation The failure was introduced by ccc56d1a79ff2a0f528cecf5e36eb76beaacc8c0. --- pkgs/misc/arm-trusted-firmware/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/arm-trusted-firmware/default.nix b/pkgs/misc/arm-trusted-firmware/default.nix index b3b43b9a78c8..c813e6e94b10 100644 --- a/pkgs/misc/arm-trusted-firmware/default.nix +++ b/pkgs/misc/arm-trusted-firmware/default.nix @@ -98,8 +98,19 @@ let hardeningDisable = [ "all" ]; dontStrip = true; - # breaks secondary CPU bringup on at least RK3588, maybe others - env.NIX_CFLAGS_COMPILE = "-fomit-frame-pointer"; + env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [ + # breaks secondary CPU bringup on at least RK3588, maybe others + "-fomit-frame-pointer" + + # Breaks compilation of armTrustedFirmwareRK3399: + # /nix/store/hash-arm-none-eabi-binutils-2.44/bin/arm-none-eabi-ld: /build/source/build/rk3399/release/m0/rk3399m0.elf: error: PHDR segment not covered by LOAD segment + # + # This was caused by ccc56d1a79ff2a0f528cecf5e36eb76beaacc8c0 adding the flag `--enable-default-pie`. + # According to https://trustedfirmware-a.readthedocs.io/en/v2.2/getting_started/user-guide.html, + # Trusted Firmware-A has an option called ENABLE_PIE, which is turned off by default. + # Someone with more knowledge of the implications can try using that option instead. + "-no-pie" + ]; meta = with lib;