From 091f07423abf94d6eac51587dc4cee3882254e5a Mon Sep 17 00:00:00 2001 From: mintsuki Date: Mon, 5 Sep 2022 06:42:29 +0200 Subject: [PATCH] ZealBooter: Update to Limine 4.x --- build/build-iso.sh | 2 +- zealbooter/GNUmakefile | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build/build-iso.sh b/build/build-iso.sh index a7f9d433..8f464625 100755 --- a/build/build-iso.sh +++ b/build/build-iso.sh @@ -79,7 +79,7 @@ echo "Building Distro ISO ..." qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 -device isa-debug-exit if [ ! -d "limine" ]; then - git clone https://github.com/limine-bootloader/limine.git --branch=v3.0-branch-binary --depth=1 + git clone https://github.com/limine-bootloader/limine.git --branch=v4.x-branch-binary --depth=1 make -C limine fi diff --git a/zealbooter/GNUmakefile b/zealbooter/GNUmakefile index 2c865310..073a4881 100644 --- a/zealbooter/GNUmakefile +++ b/zealbooter/GNUmakefile @@ -21,7 +21,7 @@ $(eval $(call DEFAULT_VAR,CC,cc)) $(eval $(call DEFAULT_VAR,LD,ld)) # User controllable CFLAGS. -CFLAGS ?= -O2 -g -Wall -Wextra -pipe +CFLAGS ?= -g -O2 -pipe -Wall -Wextra # User controllable preprocessor flags. We set none by default. CPPFLAGS ?= @@ -34,14 +34,13 @@ LDFLAGS ?= # Internal C flags that should not be changed by the user. override CFLAGS += \ - -I. \ -std=gnu11 \ -ffreestanding \ -fno-stack-protector \ -fno-stack-check \ + -fno-lto \ -fno-pie \ -fno-pic \ - -Wno-address-of-packed-member \ -m64 \ -march=x86-64 \ -mabi=sysv \ @@ -51,15 +50,22 @@ override CFLAGS += \ -mno-sse2 \ -mno-red-zone \ -mcmodel=kernel \ - -MMD + -MMD \ + -I. # Internal linker flags that should not be changed by the user. override LDFLAGS += \ -nostdlib \ -static \ + -m elf_x86_64 \ -z max-page-size=0x1000 \ -T linker.ld +# Check if the linker supports -no-pie and enable it if it does +ifeq ($(shell $(LD) --help 2>&1 | grep 'no-pie' >/dev/null 2>&1; echo $$?),0) + override LDFLAGS += -no-pie +endif + # Internal nasm flags that should not be changed by the user. override NASMFLAGS += \ -f elf64