From 07c446f2930d26f2647f4ba1f23dd86e969d4bb9 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Fri, 2 Sep 2022 11:01:13 +0200 Subject: [PATCH] build: Updates for new limine-efi --- common/GNUmakefile | 26 +++++++++++--------------- decompressor/GNUmakefile | 1 - 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/common/GNUmakefile b/common/GNUmakefile index 136dce2b..5746c3cb 100644 --- a/common/GNUmakefile +++ b/common/GNUmakefile @@ -32,6 +32,8 @@ E9_OUTPUT ?= false override S2CFLAGS := -Os +override BASE_CFLAGS := $(CROSS_CFLAGS) + override CROSS_CFLAGS += \ -g \ -std=gnu11 \ @@ -60,7 +62,6 @@ ifeq ($(TARGET),bios) -fno-pic \ -m32 \ -march=i686 \ - -mtune=generic \ -mabi=sysv \ -mno-80387 \ -DBIOS @@ -71,7 +72,6 @@ ifeq ($(TARGET),uefi-x86-64) -fpie \ -m64 \ -march=x86-64 \ - -mtune=generic \ -mabi=sysv \ -mno-80387 \ -mno-mmx \ @@ -89,11 +89,9 @@ ifeq ($(TARGET),uefi-ia32) -fpie \ -m32 \ -march=i686 \ - -mtune=generic \ -mabi=sysv \ -mno-80387 \ -DUEFI \ - -DGNU_EFI_USE_MS_ABI \ -I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \ -I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/ia32' endif @@ -101,10 +99,8 @@ endif ifeq ($(TARGET),uefi-aarch64) override CROSS_CFLAGS += \ -fpie \ - -mtune=generic \ -mgeneral-regs-only \ -DUEFI \ - -DGNU_EFI_USE_MS_ABI \ -I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \ -I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/aarch64' endif @@ -296,9 +292,9 @@ $(call MKESCAPE,$(BUILDDIR))/BOOTX64.EFI: $(call MKESCAPE,$(BUILDDIR))/limine.el $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_x86_64.o: $(call MKESCAPE,$(BUILDDIR))/limine-efi unset CPPFLAGS; \ $(MAKE) -C '$(call SHESCAPE,$(BUILDDIR))/limine-efi/gnuefi' \ - CC="$(CROSS_CC) -m64 -march=x86-64 -mtune=generic" \ - CFLAGS='-nostdinc' \ - INCDIR='-I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ + CC="$(CROSS_CC)" \ + CFLAGS="$(BASE_CFLAGS)" \ + CPPFLAGS='-nostdinc -I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ ARCH=x86_64 $(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_x86_64.ld.in @@ -337,9 +333,9 @@ $(call MKESCAPE,$(BUILDDIR))/BOOTAA64.EFI: $(call MKESCAPE,$(BUILDDIR))/limine.e $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-aarch64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_aarch64.o: $(call MKESCAPE,$(BUILDDIR))/limine-efi unset CPPFLAGS; \ $(MAKE) -C '$(call SHESCAPE,$(BUILDDIR))/limine-efi/gnuefi' \ - CC="$(CROSS_CC) -mtune=generic" \ - CFLAGS='-nostdinc' \ - INCDIR='-I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ + CC="$(CROSS_CC)" \ + CFLAGS="$(BASE_CFLAGS)" \ + CPPFLAGS='-nostdinc -I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ ARCH=aarch64 $(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_aarch64.ld.in @@ -377,9 +373,9 @@ $(call MKESCAPE,$(BUILDDIR))/BOOTIA32.EFI: $(call MKESCAPE,$(BUILDDIR))/limine.e $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/reloc_ia32.o: $(call MKESCAPE,$(BUILDDIR))/limine-efi unset CPPFLAGS; \ $(MAKE) -C '$(call SHESCAPE,$(BUILDDIR))/limine-efi/gnuefi' \ - CC="$(CROSS_CC) -m32 -march=i686 -mtune=generic" \ - CFLAGS='-nostdinc' \ - INCDIR='-I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ + CC="$(CROSS_CC)" \ + CFLAGS="$(BASE_CFLAGS)" \ + CPPFLAGS='-nostdinc -I$(call SHESCAPE,$(SRCDIR))/../freestanding-headers' \ ARCH=ia32 $(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_ia32.ld.in diff --git a/decompressor/GNUmakefile b/decompressor/GNUmakefile index e60ee72a..0684c47e 100644 --- a/decompressor/GNUmakefile +++ b/decompressor/GNUmakefile @@ -26,7 +26,6 @@ override CROSS_CFLAGS += \ -fno-pic \ -m32 \ -march=i686 \ - -mtune=generic \ -mabi=sysv \ -mno-80387 \ -Wshadow \