Skip to content

Commit 23c12b7

Browse files
dbkinderjren1
authored andcommitted
makefile: adjust linker path in Makefile
As mentioned in https://github.com/projectacrn/acrn-documentation/pull/38 on some operating systems, the ``gnu-efi`` package installs the linker under a ``gnuefi`` folder in ``${LIBDIR}``. This is the case in Fedora for example. Check if the gnuefi folder is there and use it if it is in the path to the linker. This PR fixes the Makefile rather than documenting how to edit it yourself. Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
1 parent 7d8803f commit 23c12b7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hypervisor/bsp/uefi/efi/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ endif
5555
INCDIR := /usr/include
5656

5757
# gnuefi sometimes installs these under a gnuefi/ directory, and sometimes not
58-
CRT0 := $(LIBDIR)/crt0-efi-$(ARCH).o
59-
LDSCRIPT := $(LIBDIR)/elf_$(ARCH)_efi.lds
58+
ifneq ("$(wildcard $(LIBDIR)/gnuefi/crt0-efi-$(ARCH).o)","")
59+
CRT0 := $(LIBDIR)/gnuefi/crt0-efi-$(ARCH).o
60+
LDSCRIPT := $(LIBDIR)/gnuefi/elf_$(ARCH)_efi.lds
61+
else
62+
CRT0 := $(LIBDIR)/crt0-efi-$(ARCH).o
63+
LDSCRIPT := $(LIBDIR)/elf_$(ARCH)_efi.lds
64+
endif
65+
66+
6067

6168
CFLAGS=-I. -I.. -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
6269
-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \

0 commit comments

Comments
 (0)