]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-boot: Add some link flags
authorJan Janssen <medhefgo@web.de>
Mon, 1 Nov 2021 09:36:12 +0000 (10:36 +0100)
committerJan Janssen <medhefgo@web.de>
Thu, 4 Nov 2021 17:54:31 +0000 (18:54 +0100)
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.

src/boot/efi/meson.build
src/boot/efi/no-undefined-symbols.sh [deleted file]

index 5108cfa59ebc7f9ff4fca1cc8d2cc1f82e790da6..dd42e20fbd003d9f4a4d6b52652989801a10405e 100644 (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
 
         ############################################################
diff --git a/src/boot/efi/no-undefined-symbols.sh b/src/boot/efi/no-undefined-symbols.sh
deleted file mode 100755 (executable)
index 8bdb16a..0000000
+++ /dev/null
@@ -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