build: Update linker and compiler flags
This commit is contained in:
parent
c528068ac7
commit
44df23c81a
|
@ -34,85 +34,83 @@ override S2CFLAGS := -Os
|
||||||
|
|
||||||
override CROSS_CFLAGS += \
|
override CROSS_CFLAGS += \
|
||||||
-g \
|
-g \
|
||||||
$(WERROR) \
|
|
||||||
-std=gnu11 \
|
-std=gnu11 \
|
||||||
|
-nostdinc \
|
||||||
-ffreestanding \
|
-ffreestanding \
|
||||||
-fno-stack-protector \
|
-fno-stack-protector \
|
||||||
-fno-stack-check \
|
-fno-stack-check \
|
||||||
-fno-omit-frame-pointer \
|
-fno-omit-frame-pointer \
|
||||||
-fno-strict-aliasing \
|
-fno-strict-aliasing \
|
||||||
-fno-lto \
|
-fno-lto \
|
||||||
-nostdinc \
|
|
||||||
-Wshadow \
|
-Wshadow \
|
||||||
-Wvla \
|
-Wvla \
|
||||||
|
$(WERROR) \
|
||||||
-MMD \
|
-MMD \
|
||||||
-DCOM_OUTPUT=$(COM_OUTPUT) \
|
-DCOM_OUTPUT=$(COM_OUTPUT) \
|
||||||
-DE9_OUTPUT=$(E9_OUTPUT) \
|
-DE9_OUTPUT=$(E9_OUTPUT) \
|
||||||
-I../freestanding-headers \
|
-I../freestanding-headers \
|
||||||
|
-I'$(call SHESCAPE,$(BUILDDIR))/tinf' \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/..' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/..' \
|
||||||
-I. \
|
-I. \
|
||||||
-I.. \
|
-I..
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/tinf'
|
|
||||||
|
|
||||||
ifeq ($(TARGET),bios)
|
ifeq ($(TARGET),bios)
|
||||||
override CROSS_CFLAGS += \
|
override CROSS_CFLAGS += \
|
||||||
-Dbios=1 \
|
-fno-pie \
|
||||||
-Duefi=0 \
|
-fno-pic \
|
||||||
-m32 \
|
-m32 \
|
||||||
-march=i686 \
|
-march=i686 \
|
||||||
-mtune=generic \
|
-mtune=generic \
|
||||||
-mabi=sysv \
|
-mabi=sysv \
|
||||||
-fno-pie \
|
|
||||||
-fno-pic
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(TARGET),$(filter $(TARGET),bios uefi-ia32 uefi-x86_64))
|
|
||||||
override CROSS_CFLAGS += \
|
|
||||||
-mno-80387 \
|
-mno-80387 \
|
||||||
-mno-mmx \
|
-Dbios=1 \
|
||||||
-mno-sse \
|
-Duefi=0
|
||||||
-mno-sse2
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET),uefi-x86-64)
|
ifeq ($(TARGET),uefi-x86-64)
|
||||||
override CROSS_CFLAGS += \
|
override CROSS_CFLAGS += \
|
||||||
-Dbios=0 \
|
-fpie \
|
||||||
-Duefi=1 \
|
|
||||||
-m64 \
|
-m64 \
|
||||||
-march=x86-64 \
|
-march=x86-64 \
|
||||||
-mtune=generic \
|
-mtune=generic \
|
||||||
-mabi=sysv \
|
-mabi=sysv \
|
||||||
|
-mno-80387 \
|
||||||
|
-mno-mmx \
|
||||||
|
-mno-sse \
|
||||||
|
-mno-sse2 \
|
||||||
|
-mno-red-zone \
|
||||||
|
-Dbios=0 \
|
||||||
|
-Duefi=1 \
|
||||||
-DGNU_EFI_USE_MS_ABI \
|
-DGNU_EFI_USE_MS_ABI \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/x86_64' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/x86_64'
|
||||||
-fpie \
|
|
||||||
-mno-red-zone
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET),uefi-ia32)
|
ifeq ($(TARGET),uefi-ia32)
|
||||||
override CROSS_CFLAGS += \
|
override CROSS_CFLAGS += \
|
||||||
-Dbios=0 \
|
-fpie \
|
||||||
-Duefi=1 \
|
|
||||||
-m32 \
|
-m32 \
|
||||||
-march=i686 \
|
-march=i686 \
|
||||||
-mtune=generic \
|
-mtune=generic \
|
||||||
-mabi=sysv \
|
-mabi=sysv \
|
||||||
|
-mno-80387 \
|
||||||
|
-Dbios=0 \
|
||||||
|
-Duefi=1 \
|
||||||
-DGNU_EFI_USE_MS_ABI \
|
-DGNU_EFI_USE_MS_ABI \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/ia32' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/ia32'
|
||||||
-fpie
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(TARGET),uefi-aarch64)
|
ifeq ($(TARGET),uefi-aarch64)
|
||||||
override CROSS_CFLAGS += \
|
override CROSS_CFLAGS += \
|
||||||
|
-fpie \
|
||||||
|
-mtune=generic \
|
||||||
|
-mgeneral-regs-only \
|
||||||
-Dbios=0 \
|
-Dbios=0 \
|
||||||
-Duefi=1 \
|
-Duefi=1 \
|
||||||
-mtune=generic \
|
|
||||||
-DGNU_EFI_USE_MS_ABI \
|
-DGNU_EFI_USE_MS_ABI \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/aarch64' \
|
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc/aarch64'
|
||||||
-fpie \
|
|
||||||
-mgeneral-regs-only
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
override CROSS_LDFLAGS += \
|
override CROSS_LDFLAGS += \
|
||||||
|
|
|
@ -15,30 +15,27 @@ endif
|
||||||
override CROSS_CFLAGS += \
|
override CROSS_CFLAGS += \
|
||||||
$(WERROR) \
|
$(WERROR) \
|
||||||
-Os \
|
-Os \
|
||||||
|
-std=gnu11 \
|
||||||
|
-nostdinc \
|
||||||
-m32 \
|
-m32 \
|
||||||
-march=i686 \
|
-march=i686 \
|
||||||
-mtune=generic \
|
-mtune=generic \
|
||||||
-mabi=sysv \
|
-mabi=sysv \
|
||||||
-std=gnu11 \
|
-mno-80387 \
|
||||||
-ffreestanding \
|
-ffreestanding \
|
||||||
-fno-stack-protector \
|
-fno-stack-protector \
|
||||||
-fno-stack-check \
|
-fno-stack-check \
|
||||||
|
-fomit-frame-pointer \
|
||||||
-fno-strict-aliasing \
|
-fno-strict-aliasing \
|
||||||
-fno-lto \
|
-fno-lto \
|
||||||
-fno-pie \
|
-fno-pie \
|
||||||
-fno-pic \
|
-fno-pic \
|
||||||
-fomit-frame-pointer \
|
|
||||||
-nostdinc \
|
|
||||||
-Wshadow \
|
-Wshadow \
|
||||||
-Wvla \
|
-Wvla \
|
||||||
-mno-80387 \
|
|
||||||
-mno-mmx \
|
|
||||||
-mno-sse \
|
|
||||||
-mno-sse2 \
|
|
||||||
-MMD \
|
-MMD \
|
||||||
-I../freestanding-headers \
|
-I../freestanding-headers \
|
||||||
-I. \
|
-I'$(call SHESCAPE,$(BUILDDIR))/tinf' \
|
||||||
-I'$(call SHESCAPE,$(BUILDDIR))/tinf'
|
-I.
|
||||||
|
|
||||||
override CROSS_LDFLAGS += \
|
override CROSS_LDFLAGS += \
|
||||||
-m elf_i386 \
|
-m elf_i386 \
|
||||||
|
|
Loading…
Reference in New Issue