From: Dimitri John Ledkov Date: Tue, 4 May 2021 17:03:04 +0000 (+0100) Subject: boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub X-Git-Tag: v249-rc1~242^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7840d7af221944adaa9560ee749d4681106d3586;p=thirdparty%2Fsystemd.git boot/efi: install ELF linux.elf.stub in addition to PE linux.efi.stub 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. --- diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index ab5530bec17..547d918a786 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -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],