diff --git a/kernel/Makefile b/kernel/Makefile index 2b581ea226..68261f40bb 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -96,7 +96,7 @@ $(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o: $(CC) -MD -c $< -o $(BUILDDIR)/$@ $(CFLAGS) .psf.o: - objcopy -O elf64-x86-64 -B i386 -I binary $< $(BUILDDIR)/$@ + objcopy -O $(ELF_FORMAT) -B i386 -I binary $< $(BUILDDIR)/$@ always: mkdir -p $(BUILDDIR)/$(ARCHDIR) diff --git a/kernel/arch/i386/make.config b/kernel/arch/i386/make.config index fa74f25bc4..f50633b446 100644 --- a/kernel/arch/i386/make.config +++ b/kernel/arch/i386/make.config @@ -3,6 +3,8 @@ KERNEL_ARCH_CPPFLAGS= KERNEL_ARCH_LDFLAGS= KERNEL_ARCH_LIBS= +ELF_FORMAT=elf32-i386 + KERNEL_ARCH_OBJS= \ $(ARCHDIR)/boot.o \ $(ARCHDIR)/IDT.o \ diff --git a/kernel/arch/x86_64/make.config b/kernel/arch/x86_64/make.config index e79262b03c..a5d2ceecc4 100644 --- a/kernel/arch/x86_64/make.config +++ b/kernel/arch/x86_64/make.config @@ -3,6 +3,8 @@ KERNEL_ARCH_CPPFLAGS= KERNEL_ARCH_LDFLAGS=-z max-page-size=4096 KERNEL_ARCH_LIBS= +ELF_FORMAT=elf64-x86-64 + KERNEL_ARCH_OBJS= \ $(ARCHDIR)/boot.o \ $(ARCHDIR)/IDT.o \