Do not fail EFI build with newer binutils
authorMichael Biebl <biebl@debian.org>
Wed, 22 Jun 2022 11:11:13 +0000 (13:11 +0200)
committerRaspbian forward porter <root@raspbian.org>
Tue, 9 Aug 2022 18:16:48 +0000 (19:16 +0100)
Newer binutils versions currently trigger the following warnings due to
a bug in gnu-efi

on arm64:
/usr/bin/ld.bfd: warning: src/boot/efi/systemd-bootaa64.elf has a LOAD segment with RWX permissions

on amd64:
/usr/bin/ld.bfd: warning: /usr/lib/crt0-efi-x86_64.o: missing .note.GNU-stack section implies executable stack

This results in a build failure due to --fatal-warnings.
Work around this issue by suppressing those warnings until gnu-efi has
been fixed.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013341

Gbp-Pq: Topic debian
Gbp-Pq: Name Do-not-fail-EFI-build-with-newer-binutils.patch

src/boot/efi/meson.build

index 299a01b9be7eac4e69d39c10e5d0c857c02a462e..dd6a3decf84898f1c8aee7a0eb9cf554a8f14823 100644 (file)
@@ -260,6 +260,13 @@ efi_ldflags = [
         '-z', 'nocombreloc',
         efi_crt0,
 ]
+
+possible_link_flags = [
+        '-Wl,--no-warn-execstack',
+        '-Wl,--no-warn-rwx-segments',
+]
+efi_ldflags += cc.get_supported_link_arguments(possible_link_flags)
+
 if efi_arch[1] in ['aarch64', 'arm', 'riscv64']
         efi_ldflags += ['-shared']
         # Aarch64, ARM32 and 64bit RISC-V don't have an EFI capable objcopy.