From ef4e014cb3f2f8dcd0d5a5d45e3f592544e92056 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Tue, 21 Jun 2022 08:47:48 +0200 Subject: [PATCH] build: Use libgcc-binaries --- GNUmakefile.in | 4 ++-- bootstrap | 2 +- common/GNUmakefile | 14 +++++++------- common/linker_bios.ld.in | 6 +++--- decompressor/GNUmakefile | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index 0da8c650..734a2a16 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -191,7 +191,7 @@ dist: cd '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)" && git checkout . cd '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)" && ./bootstrap rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/freestanding_headers/.git" - rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/libgcc-blobs-i386/.git" + rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/libgcc-binaries/.git" rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/limine-efi/.git" rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/.git" rm -rf '$(call SHESCAPE,$(BUILDDIR))'/"limine-$(LIMINE_VERSION)/autom4te.cache" @@ -208,7 +208,7 @@ distclean: clean .PHONY: maintainer-clean maintainer-clean: distclean - cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf freestanding_headers libgcc-blobs-i386 limine-efi configure build-aux *'~' autom4te.cache *.tar.xz *.tar.gz + cd '$(call SHESCAPE,$(SRCDIR))' && rm -rf freestanding_headers libgcc-binaries limine-efi configure build-aux *'~' autom4te.cache *.tar.xz *.tar.gz cd '$(call SHESCAPE,$(SRCDIR))'/toolchain-detect && rm -rf configure *'~' autom4te.cache .PHONY: common-uefi-x86-64 diff --git a/bootstrap b/bootstrap index 1256a6a4..d6aa11d3 100755 --- a/bootstrap +++ b/bootstrap @@ -8,7 +8,7 @@ test -z "$srcdir" && srcdir=. cd "$srcdir" [ -d freestanding_headers ] || git clone https://github.com/mintsuki/freestanding_headers.git -[ -d libgcc-blobs-i386 ] || git clone https://github.com/mintsuki/libgcc-blobs-i386.git +[ -d libgcc-binaries ] || git clone https://github.com/mintsuki/libgcc-binaries.git [ -d limine-efi ] || git clone https://github.com/limine-bootloader/limine-efi.git automake_libdir="$(automake --print-libdir)" diff --git a/common/GNUmakefile b/common/GNUmakefile index a0f201eb..0c91a236 100644 --- a/common/GNUmakefile +++ b/common/GNUmakefile @@ -224,7 +224,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker_stage2only.ld: linker_bios.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef -DLINKER_STAGE2ONLY linker_bios.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_stage2only.ld' -$(call MKESCAPE,$(BUILDDIR))/limine_stage2only.elf: $(OBJ) ../libgcc-blobs-i386/*.o +$(call MKESCAPE,$(BUILDDIR))/limine_stage2only.elf: $(OBJ) ../libgcc-binaries/libgcc-i686.a $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_stage2only.ld' $(LIMINE_LD) '$(call OBJESCAPE,$^)' $(LIMINE_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker_stage2only.ld' -o '$(call SHESCAPE,$@)' || \ ( echo "This error may mean that stage 2 was trying to use stage 3 symbols before loading stage 3" && \ @@ -234,7 +234,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_bios.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_bios.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' -$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(OBJ) ../libgcc-blobs-i386/*.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/stage2.map.o +$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/stage2.map.o $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' $(LIMINE_LD) '$(call OBJESCAPE,$^)' $(LIMINE_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' -o '$(call SHESCAPE,$@)' $(LIMINE_OBJCOPY) -O binary --only-section=.note.gnu.build-id '$(call SHESCAPE,$@)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s2.bin' @@ -249,7 +249,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_bios.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef linker_bios.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld' -$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(OBJ) ../libgcc-blobs-i386/*.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/stage2.map.o $(call MKESCAPE,$(BUILDDIR))/full.map.o +$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/stage2.map.o $(call MKESCAPE,$(BUILDDIR))/full.map.o $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld' $(LIMINE_LD) '$(call OBJESCAPE,$^)' $(LIMINE_LDFLAGS) $(INTERNAL_LDFLAGS) -T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' -o '$(call SHESCAPE,$@)' $(LIMINE_OBJCOPY) -O binary --only-section=.note.gnu.build-id '$(call SHESCAPE,$@)' '$(call SHESCAPE,$(BUILDDIR))/build-id.s2.bin' @@ -297,7 +297,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_x86_64.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi_x86_64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' -$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o +$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) ../libgcc-binaries/libgcc-x86_64-no-red-zone.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' $(LIMINE_LD) \ -T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' \ @@ -307,7 +307,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi_x86_64.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef linker_uefi_x86_64.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld' -$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/full.map.o +$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-x86_64.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) ../libgcc-binaries/libgcc-x86_64-no-red-zone.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/full.map.o $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld' $(LIMINE_LD) \ -T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' \ @@ -346,7 +346,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker_nomap.ld: linker_uefi_ia32.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef -DLINKER_NOMAP linker_uefi_ia32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' -$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) ../libgcc-blobs-i386/*.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o +$(call MKESCAPE,$(BUILDDIR))/limine_nomap.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' $(LIMINE_LD) \ -T'$(call SHESCAPE,$(BUILDDIR))/linker_nomap.ld' \ @@ -356,7 +356,7 @@ $(call MKESCAPE,$(BUILDDIR))/linker.ld: linker_uefi_ia32.ld.in mkdir -p '$(call SHESCAPE,$(BUILDDIR))' $(LIMINE_CC) -x c -E -P -undef linker_uefi_ia32.ld.in -o '$(call SHESCAPE,$(BUILDDIR))/linker.ld' -$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) ../libgcc-blobs-i386/*.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/full.map.o +$(call MKESCAPE,$(BUILDDIR))/limine.elf: $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/crt0-efi-ia32.o $(call MKESCAPE,$(BUILDDIR))/limine-efi/gnuefi/libgnuefi.a $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(call MKESCAPE,$(BUILDDIR))/font.o $(call MKESCAPE,$(BUILDDIR))/sys/smp_trampoline.o $(call MKESCAPE,$(BUILDDIR))/full.map.o $(MAKE) '$(call SHESCAPE,$(BUILDDIR))/linker.ld' $(LIMINE_LD) \ -T'$(call SHESCAPE,$(BUILDDIR))/linker.ld' \ diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in index 5bdb0d9c..b0c34a43 100644 --- a/common/linker_bios.ld.in +++ b/common/linker_bios.ld.in @@ -18,7 +18,7 @@ SECTIONS *(.entry) *(.realmode) *.s2.o(.text .text.*) - *libgcc*.o(.text .text.*) + *libgcc*.a:*(.text .text.*) } :text_s2 .data.stage2 : { @@ -28,10 +28,10 @@ SECTIONS *.s2.o(.no_unwind) s2_data_begin = .; *.s2.o(.data .data.*) - *libgcc*.o(.data .data.*) + *libgcc*.a:*(.data .data.*) s2_data_end = .; *.s2.o(.rodata .rodata.*) - *libgcc*.o(.rodata .rodata.*) + *libgcc*.a:*(.rodata .rodata.*) #ifdef LINKER_STAGE2ONLY /* stage2 missing symbols overrides */ stage2_map = .; diff --git a/decompressor/GNUmakefile b/decompressor/GNUmakefile index ff753ec5..31b18377 100644 --- a/decompressor/GNUmakefile +++ b/decompressor/GNUmakefile @@ -56,7 +56,7 @@ override HEADER_DEPS := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c= .PHONY: all all: $(call MKESCAPE,$(BUILDDIR))/decompressor.bin -$(call MKESCAPE,$(BUILDDIR))/decompressor.bin: $(OBJ) $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o +$(call MKESCAPE,$(BUILDDIR))/decompressor.bin: $(OBJ) ../libgcc-binaries/libgcc-i686.a $(call MKESCAPE,$(BUILDDIR))/tinf/tinfgzip.o $(call MKESCAPE,$(BUILDDIR))/tinf/tinflate.o $(LIMINE_LD) '$(call OBJESCAPE,$^)' $(LIMINE_LDFLAGS) $(INTERNAL_LDFLAGS) -o '$(call SHESCAPE,$(BUILDDIR))/decompressor.elf' $(LIMINE_OBJCOPY) -O binary '$(call SHESCAPE,$(BUILDDIR))/decompressor.elf' '$(call SHESCAPE,$@)'