:: commit dc0b19858e229b29f5a99e227ee6708621a01b37

mintsuki <mintsuki@protonmail.com> — 2024-01-22 03:09

parents: 34ce023427

misc: Rename .c files in common/cc-runtime to .s2.c for stage2 inclusion

diff --git a/bootstrap b/bootstrap
index f18f091f..c3f0fa00 100755
--- a/bootstrap
+++ b/bootstrap
@@ -42,9 +42,12 @@ clone_repo_commit() {
 
 clone_repo_commit https://github.com/mintsuki/flanterm.git common/flanterm $FLANTERM_COMMIT_HASH
 clone_repo_commit https://github.com/mintsuki/freestanding-headers.git freestanding-headers $FREESTANDING_HEADERS_COMMIT_HASH
-clone_repo_commit https://github.com/mintsuki/cc-runtime.git common/cc-runtime $CC_RUNTIME_COMMIT_HASH
-rm -rf decompressor/cc-runtime
-cp -rp common/cc-runtime decompressor/
+clone_repo_commit https://github.com/mintsuki/cc-runtime.git decompressor/cc-runtime $CC_RUNTIME_COMMIT_HASH
+rm -rf common/cc-runtime
+cp -rp decompressor/cc-runtime common/
+for f in common/cc-runtime/*.c; do
+    mv "$f" "$(echo "$f" | sed 's/\.c/.s2.c/g')"
+done
 clone_repo_commit https://github.com/limine-bootloader/limine-efi.git limine-efi $LIMINE_EFI_COMMIT_HASH
 clone_repo_commit https://github.com/jibsen/tinf.git tinf $TINF_COMMIT_HASH
 
diff --git a/common/GNUmakefile b/common/GNUmakefile
index 12d0536b..b8944137 100644
--- a/common/GNUmakefile
+++ b/common/GNUmakefile
@@ -207,7 +207,7 @@ ifeq ($(TARGET),bios)
     override ASMB_FILES := $(shell find . -type f -name '*.asm_bios_ia32')
 
     override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASMB_FILES:.asm_bios_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
-    override OBJ_S2 := $(filter %.s2.o,$(OBJ)) $(foreach f,$(OBJ),$(if $(findstring cc-runtime,$(f)),$(f),))
+    override OBJ_S2 := $(filter %.s2.o,$(OBJ))
 endif
 ifeq ($(TARGET),uefi-x86-64)
     override ASMX86_FILES := $(shell find . -type f -name '*.asm_x86')
diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in
index f7fe293e..7a7d024f 100644
--- a/common/linker_bios.ld.in
+++ b/common/linker_bios.ld.in
@@ -20,12 +20,10 @@ SECTIONS
         *(.entry)
         *(.realmode)
         *.s2.o(.text .text.*)
-        *cc-runtime*(.text .text.*)
     } :text_s2
 
     .rodata.stage2 : {
         *.s2.o(.rodata .rodata.*)
-        *cc-runtime*(.rodata .rodata.*)
 
         build_id_s2 = .;
         KEEP(*build-id.s2.o(*))
@@ -57,7 +55,6 @@ SECTIONS
     .data.stage2 : {
         s2_data_begin = .;
         *.s2.o(.data .data.*)
-        *cc-runtime*(.data .data.*)
         s2_data_end = .;
 
         *.s2.o(.no_unwind)
tab: 248 wrap: offon