Browse Source

remove crt0 out of gblibc

greatbridf 2 năm trước cách đây
mục cha
commit
15f53c60ab
2 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 4 1
      gblibc/CMakeLists.txt
  2. 1 1
      user-space-program/CMakeLists.txt

+ 4 - 1
gblibc/CMakeLists.txt

@@ -5,7 +5,6 @@ add_library(gblibc STATIC
     src/stdio.c
     src/arithmetic.c
     src/string.c
-    src/crt0.s
     src/fcntl.c
     src/unistd.c
     src/wait.c
@@ -14,6 +13,10 @@ add_library(gblibc STATIC
     src/ctype.c
 )
 
+add_library(crt0 OBJECT
+    src/crt0.s
+)
+
 file(GLOB_RECURSE GBLIBC_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 target_include_directories(gblibc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include

+ 1 - 1
user-space-program/CMakeLists.txt

@@ -4,7 +4,7 @@ project(user_space_program C ASM)
 set(CMAKE_C_FLAGS "-nostdlib -nostdinc -static -m32 -W -Wall -Wextra -Werror -mstack-protector-guard=global")
 set(CMAKE_ASM_FLAGS "-nostdlib -m32 -static -mstack-protector-guard=global -g0")
 
-link_libraries(gblibc)
+link_libraries(gblibc crt0)
 
 set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "")
 set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")