]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub
authorDimitri John Ledkov <xnox@ubuntu.com>
Tue, 4 May 2021 17:03:04 +0000 (18:03 +0100)
committerDimitri John Ledkov <xnox@ubuntu.com>
Mon, 10 May 2021 08:35:59 +0000 (09:35 +0100)
Binutils for non-x86 architectures currently does not support PE binaries. Thus
linux.efi.stub is useless on those, as one cannot use any tooling to add
linux/cmdline/splash sections to it. In addition to PE linux.efi.stub also
install ELF linux.elf.stub, such that one can use objcopy ELF target to copy in
linux/cmdline/splash sections and then convert the result to a PE binary.

src/boot/efi/meson.build

index ab5530bec17ab6a112dca818a6fd02131a36939a..547d918a78670a27be82672c58faa4cdde813ba3 100644 (file)
@@ -254,18 +254,21 @@ if have_gnu_efi
 
         libgcc_file_name = run_command(efi_cc + ['-print-libgcc-file-name']).stdout().strip()
         systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME)
+        stub_elf_name = 'linux@0@.elf.stub'.format(EFI_MACHINE_TYPE_NAME)
         stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
         no_undefined_symbols = find_program('no-undefined-symbols.sh')
 
-        foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects],
-                         ['stub.so', stub_efi_name, stub_objects]]
+        foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects, 'systemd_boot.so', false],
+                         ['stub.so', stub_efi_name, stub_objects, stub_elf_name, true]]
                 so = custom_target(
                         tuple[0],
                         input : tuple[2],
-                        output : tuple[0],
+                        output : tuple[3],
                         command : [efi_ld, '-o', '@OUTPUT@'] +
                                   efi_ldflags + tuple[2] +
-                                  ['-lefi', '-lgnuefi', libgcc_file_name])
+                                  ['-lefi', '-lgnuefi', libgcc_file_name],
+                        install : tuple[4],
+                        install_dir : bootlibdir)
 
                 if want_tests != 'false'
                         test('no-undefined-symbols-' + tuple[0],