sd-boot: Add some link flags

These flags are used by gnu-efi. Adding --no-undefined even allows
us to drop the no-undefined-symbols.sh test in favor of immediate
compile time errors.
This commit is contained in:
Jan Janssen
2021-11-01 10:36:12 +01:00
parent 1f6f233f87
commit f8a738bbc0
2 changed files with 3 additions and 16 deletions

View File

@@ -258,6 +258,9 @@ if have_gnu_efi
'-shared',
'-Bsymbolic',
'-nostdlib',
'--no-undefined',
'--warn-common',
'--fatal-warnings',
'-znocombreloc',
'--build-id=sha1',
'-L', efi_libdir,
@@ -292,7 +295,6 @@ if have_gnu_efi
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')
efi_stubs = []
foreach tuple : [['systemd_boot.so', systemd_boot_efi_name, systemd_boot_objects, false],
@@ -326,12 +328,6 @@ if have_gnu_efi
install_dir : bootlibdir)
efi_stubs += [[so, stub]]
if want_tests != 'false'
test('no-undefined-symbols-' + tuple[0],
no_undefined_symbols,
args : so)
endif
endforeach
############################################################

View File

@@ -1,9 +0,0 @@
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eu
set -o pipefail
if nm -D -u "${1:?}" | grep ' U '; then
echo "Undefined symbols detected!"
exit 1
fi