:: commit 07d9f7d7eed275c6ef022266507fd266ffcc8ed3

mintsuki <mintsuki@protonmail.com> — 2021-05-04 11:56

parents: b401d07f8f

build: Bump GCC to 11.1.0, misc fixes

diff --git a/scripts/make_toolchain.sh b/scripts/make_toolchain.sh
index 0c1a5526..b989201d 100755
--- a/scripts/make_toolchain.sh
+++ b/scripts/make_toolchain.sh
@@ -5,7 +5,7 @@ set -x
 
 TARGET=x86_64-elf
 BINUTILSVERSION=2.36.1
-GCCVERSION=10.3.0
+GCCVERSION=11.1.0
 
 CFLAGS="-O2 -pipe"
 
diff --git a/stage23/Makefile b/stage23/Makefile
index 5d82f335..399a15b5 100644
--- a/stage23/Makefile
+++ b/stage23/Makefile
@@ -110,10 +110,7 @@ ifeq ($(TARGET), uefi)
 		-march=x86-64 \
 		-fpie \
 		-Wl,-melf_x86_64 \
-		-Wl,-static \
-		-Wl,-pie \
-		-Wl,--no-dynamic-linker \
-		-z text \
+		-Wl,-static,-pie,--no-dynamic-linker,-ztext \
 		-static-pie
 endif
 
@@ -177,7 +174,7 @@ $(BUILDDIR)/limine.sys: $(BUILDDIR)/limine.elf
 
 $(BUILDDIR)/limine_stage2only.elf: $(OBJ)
 	$(TOOLCHAIN_CC) $^ $(LDFLAGS) $(INTERNAL_LDFLAGS) -Tlinker_stage2only.ld -o $@ || \
-		( echo "This error means that stage 2 was trying to use stage 3 symbols before loading stage 3" && \
+		( echo "This error may mean that stage 2 was trying to use stage 3 symbols before loading stage 3" && \
 		  false )
 
 $(BUILDDIR)/limine_nomap.elf: $(OBJ) $(BUILDDIR)/font.o $(BUILDDIR)/sys/smp_trampoline.o $(BUILDDIR)/stage2.map.o
diff --git a/stage23/lib/libgcc.s2.asm b/stage23/lib/libgcc.s2.asm
index f4856825..743f11f8 100644
--- a/stage23/lib/libgcc.s2.asm
+++ b/stage23/lib/libgcc.s2.asm
@@ -45,7 +45,7 @@ __udivmoddi4:
     xor edx, edx
     ret
 
-global __udivmoddi4
+global __divmoddi4
 __divmoddi4:
     mov eax, dword [esp+4]
     mov edx, dword [esp+8]
tab: 248 wrap: offon