efi_loader: use freestanding library for efi apps
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 20 Jan 2019 07:20:31 +0000 (08:20 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2019 08:40:06 +0000 (09:40 +0100)
GCC requires that freestanding programs provide memcpy(), memmove(),
memset(), and memcmp().

Add the library functions when building a *.efi files.

The EFI selftests might use other compilation flags. So use a symbolic
link to provide lib/efi_selftest/efi_freestanding.c and compile it
separately.

Reported-by: Alexander Graf <agraf@suse.de>
Fixes: 5be444d14b38 ("efi_loader: consistent build flags for EFI applications")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_selftest/efi_freestanding.c [new symlink]
scripts/Makefile.lib

diff --git a/lib/efi_selftest/efi_freestanding.c b/lib/efi_selftest/efi_freestanding.c
new file mode 120000 (symlink)
index 0000000..4b7edd5
--- /dev/null
@@ -0,0 +1 @@
+../efi_loader/efi_freestanding.c
\ No newline at end of file
index a5b57fc6b98a7c16116fd89d4bde9f32de7b3a29..4facb76aceb7f736445f6697427ad030fd4872fd 100644 (file)
@@ -389,7 +389,7 @@ $(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcoun
        $(call cmd,force_checksrc)
        $(call if_changed_rule,cc_o_c)
 
-$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o
+$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
        $(call cmd,efi_ld)
 
 # ACPI