From bdfe7dac17ece66fc74ddf4eed20b8a9042717f1 Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 6 Jan 2023 17:59:54 +0100 Subject: [PATCH] libc: Remove crti.o and crtn.o Looks like these are now provided by the compiler. --- libc/CMakeLists.txt | 14 +------------- libc/src/arch/x86_64/crti.S | 13 ------------- libc/src/arch/x86_64/crtn.S | 9 --------- 3 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 libc/src/arch/x86_64/crti.S delete mode 100644 libc/src/arch/x86_64/crtn.S diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index da64b048..cb407399 100644 --- a/libc/CMakeLists.txt +++ b/libc/CMakeLists.txt @@ -22,18 +22,6 @@ add_custom_command( COMMAND "${CMAKE_COMMAND}" -E copy $ ${LUNA_BASE}/usr/lib/crt0.o ) -add_library(crti STATIC src/arch/${ARCH}/crti.S) -add_custom_command( - TARGET crti - COMMAND "${CMAKE_COMMAND}" -E copy $ ${LUNA_BASE}/usr/lib/crti.o -) - -add_library(crtn STATIC src/arch/${ARCH}/crtn.S) -add_custom_command( - TARGET crtn - COMMAND "${CMAKE_COMMAND}" -E copy $ ${LUNA_BASE}/usr/lib/crtn.o -) - add_library(bare_libc STATIC ${SOURCES}) target_link_libraries(bare_libc PUBLIC luna) @@ -52,7 +40,7 @@ add_custom_target(libc COMMAND ${CMAKE_AR} -rcs ${CMAKE_CURRENT_BINARY_DIR}/libc.a *.o COMMAND rm *.o WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS bare_libc luna crti crtn crt0 + DEPENDS bare_libc luna crt0 ) add_custom_command( diff --git a/libc/src/arch/x86_64/crti.S b/libc/src/arch/x86_64/crti.S deleted file mode 100644 index 03ad2f91..00000000 --- a/libc/src/arch/x86_64/crti.S +++ /dev/null @@ -1,13 +0,0 @@ -.section .init -.global _init -_init: - push %rbp - movq %rsp, %rbp - /* gcc will nicely put the contents of crtbegin.o's .init section here. */ - -.section .fini -.global _fini -_fini: - push %rbp - movq %rsp, %rbp - /* gcc will nicely put the contents of crtbegin.o's .fini section here. */ diff --git a/libc/src/arch/x86_64/crtn.S b/libc/src/arch/x86_64/crtn.S deleted file mode 100644 index 762c7f6c..00000000 --- a/libc/src/arch/x86_64/crtn.S +++ /dev/null @@ -1,9 +0,0 @@ -.section .init - /* gcc will nicely put the contents of crtend.o's .init section here. */ - popq %rbp - ret - -.section .fini - /* gcc will nicely put the contents of crtend.o's .fini section here. */ - popq %rbp - ret