kumquat-buildroot/support/testing/tests/boot/test_edk2.py
Romain Naour e3d97f52bf support/testing: test_edk2: bump ATF version to 2.9 for binutils 2.39+ support
Following the toolchain-external-arm-aarch64 bump to version 12.2-rel1
by commit [1], binutils 2.39 is now provided by the toolchain.

This new binutils version break the ATF build due to new linker warnings as
reported by the EDK2 test:

  ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions

From [2]
"Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
 of a new warning when linking the bl*.elf in the form:

   ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
   ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
   ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
   ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions

 These new warnings are enbaled by default to secure elf binaries:
  - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
  - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b4500c9277a8e9d0f07e6774
"

Bump the ATF custom version to 2.9 for binutils 2.39+ support.

[1] 90404e84c1
[2] 1f49db5f25

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

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-07-12 12:02:24 +02:00

48 lines
1.9 KiB
Python

import os
import infra.basetest
class TestEdk2(infra.basetest.BRTest):
config = \
"""
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/aarch64-sbsa/assemble-flash-images support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/qemu/aarch64-sbsa/genimage.cfg"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.34"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="support/testing/tests/boot/test_edk2/linux.config"
BR2_TARGET_EDK2=y
BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_ARM64_EFI=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.9"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu_sbsa"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_MTOOLS=y
"""
def test_run(self):
hda = os.path.join(self.builddir, "images", "disk.img")
flash0 = os.path.join(self.builddir, "images", "SBSA_FLASH0.fd")
flash1 = os.path.join(self.builddir, "images", "SBSA_FLASH1.fd")
self.emulator.boot(arch="aarch64",
options=["-M", "sbsa-ref",
"-cpu", "cortex-a57",
"-m", "512M",
"-pflash", flash0,
"-pflash", flash1,
"-hda", hda])
self.emulator.login()