Fix: Put libraries at end of linker call

This commit is contained in:
Thomas Oltmann 2025-03-10 03:36:32 +01:00
parent b9222eb044
commit f0b9af28fc
2 changed files with 3 additions and 2 deletions

View file

@ -44,7 +44,7 @@ build/$(ARCH)/%.o: $(ARCH)/%.[cS] | build/$(ARCH)
build/visor.so: $(VISOR_OBJECTS) gnuefi/crt0-efi-$(ARCH).o | build
@printf "LD %s\n" $@
@"$(LD)" $(LDFLAGS) -o $@ gnuefi/crt0-efi-$(ARCH).o $(VISOR_OBJECTS)
@"$(LD)" $(LDFLAGS) -o $@ gnuefi/crt0-efi-$(ARCH).o $(VISOR_OBJECTS) $(LIBS)
$(VISOR_TARGET): build/visor.so | build
@printf "ELF->PE %s\n" $@

View file

@ -11,4 +11,5 @@ LD = ld
# Compilation flags
CFLAGS = -std=c17 -Wall -ffreestanding -fpic -nostdlib -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -maccumulate-outgoing-args -mno-sse -mno-mmx -mno-80387
CPPFLAGS = -Ignuefi/inc
LDFLAGS = -shared -Bsymbolic -Lgnuefi -lgnuefi -lefi -Tgnuefi/elf_$(ARCH)_efi.lds -nostdlib
LDFLAGS = -shared -Bsymbolic -Lgnuefi -Tgnuefi/elf_$(ARCH)_efi.lds -nostdlib
LIBS = -lgnuefi -lefi