Subject: bug#78251: arm-trusted-firmware for pine64 FTBFS

From: Vagrant Cascadian <[email-masked]>
Date: Mon, 05 May 2025 09:55:58 -0700

On 2025-05-05, Efraim Flashner wrote:
> I was trying to deploy a new generation on my pine64 and the
> arm-trusted-firmware failed to build.  I tried changing the make-flags
> on arm-trusted-firmware to set CFLAGS=-Os but the overflow was still 216
> bytes.  Changing it to -O2 made it 4312 bytes.  Adding DEBUG=0 didn't
> make a difference either.
>
>
> Excerpt from the build log:
>
>   AS      plat/common/aarch64/platform_mp_stack.S
>   PP      bl31/bl31.ld.S
>   AR      /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/lib/libfdt.a
>   AR      /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/lib/libc.a
>   LD      /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf
> ld: address 0x500d8 of /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf section `.data' is not within region `RAM'
> ld: /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf section `.rela.dyn' will not fit in region `RAM'
> ld: address 0x500d8 of /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf section `.data' is not within region `RAM'
> ld: address 0x500d8 of /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf section `.data' is not within region `RAM'
> ld: address 0x500d8 of /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf section `.data' is not within region `RAM'
> ld: address 0x500d8 of /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf section `.data' is not within region `RAM'
> ld: BL31 image has exceeded its limit.
> ld: region `RAM' overflowed by 216 bytes
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:1557: /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.1.drv-0/source/build/sun50i_a64/debug/bl31/bl31.elf] Error 1
> error: in phase 'build': uncaught exception:
> %exception #<&invoke-error program: "make" arguments: ("-j" "4" "PLAT=sun50i_a64" "DEBUG=0" "CC=gcc" "DEBUG=1") exit-status: 2 term-signal: #f stop-signal: #f>
> phase `build' failed after 4.6 seconds
> command "make" "-j" "4" "PLAT=sun50i_a64" "DEBUG=0" "CC=gcc" "DEBUG=1" failed with status 2
> build process 6 exited with status 256
> builder for `/gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv' failed with exit code 1
> @ build-failed /gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv - 1 builder for `/gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv' failed with exit code 1
> derivation '/gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv' offloaded to 'ubuntu.unicorn-typhon.ts.net' failed: build of `/gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv' failed
> build of /gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv failed
> View build log at '/var/log/guix/drvs/9d/5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv'.
> guix build: error: build of `/gnu/store/9d5f5yaqsiagglzlhwak0ywwlv7gfji0-arm-trusted-firmware-sun50i-a64-2.12.1.drv' failed

It also fails to buidl for me on a mnt/reform2 rk3588 running guix
system on aarch64-linux ... Interestingly, it appears to cross-build for
x86_64-linux just fine ...

I do not see any immediately obvious toolchain changes at a cursory
glance...

Might be worth bisecting to see where it started failing (presuming it
ever built natively)? I might give that a whirl...

There is also a 2.12.2 version available now; might be worth updating
just to see if it fixes it...

live well,
  vagrant