diff options
author | Itamar <itamar8910@gmail.com> | 2020-12-20 22:32:10 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-24 21:46:35 +0100 |
commit | bbedd320b5d0bc75bb736ce12711ae283fbe2a77 (patch) | |
tree | 2051683ee931c7cbd73cdfb9abad269fc60864a3 /Userland | |
parent | 6990d629775f2554f4747dc71c51433ca8d45ff3 (diff) | |
download | serenity-bbedd320b5d0bc75bb736ce12711ae283fbe2a77.zip |
Toolchain+LibC: Fix usage of crt files
We now configure the gcc spec files to use a different crt files for
static & PIE binaries.
This relieves us from the need to explicitly specify the desired crt0
file in cmake scripts.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Userland/Tests/Kernel/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Userland/Tests/LibC/CMakeLists.txt | 1 |
3 files changed, 0 insertions, 4 deletions
diff --git a/Userland/CMakeLists.txt b/Userland/CMakeLists.txt index 1ca0fe9afc..537180a29c 100644 --- a/Userland/CMakeLists.txt +++ b/Userland/CMakeLists.txt @@ -5,13 +5,11 @@ foreach(CMD_SRC ${CMD_SOURCES}) get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE) if (CMD_NAME IN_LIST SPECIAL_TARGETS) add_executable("${CMD_NAME}-bin" ${CMD_SRC}) - target_sources("${CMD_NAME}-bin" PRIVATE ${CMAKE_SOURCE_DIR}/Libraries/LibC/crt0_shared.cpp) target_link_libraries("${CMD_NAME}-bin" LibCore) install(TARGETS "${CMD_NAME}-bin" RUNTIME DESTINATION bin) install(CODE "execute_process(COMMAND mv ${CMD_NAME}-bin ${CMD_NAME} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)") else () add_executable(${CMD_NAME} ${CMD_SRC}) - target_sources("${CMD_NAME}" PRIVATE ${CMAKE_SOURCE_DIR}/Libraries/LibC/crt0_shared.cpp) target_link_libraries(${CMD_NAME} LibCore) install(TARGETS ${CMD_NAME} RUNTIME DESTINATION bin) endif() diff --git a/Userland/Tests/Kernel/CMakeLists.txt b/Userland/Tests/Kernel/CMakeLists.txt index c18d364cab..cd9438dc4a 100644 --- a/Userland/Tests/Kernel/CMakeLists.txt +++ b/Userland/Tests/Kernel/CMakeLists.txt @@ -3,7 +3,6 @@ file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp") foreach(CMD_SRC ${CMD_SOURCES}) get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE) add_executable(${CMD_NAME} ${CMD_SRC}) - target_sources("${CMD_NAME}" PRIVATE ${CMAKE_SOURCE_DIR}/Libraries/LibC/crt0_shared.cpp) target_link_libraries(${CMD_NAME} LibCore) install(TARGETS ${CMD_NAME} RUNTIME DESTINATION usr/Tests/Kernel) endforeach() diff --git a/Userland/Tests/LibC/CMakeLists.txt b/Userland/Tests/LibC/CMakeLists.txt index 8ce9b5c2b9..799dfa9ff4 100644 --- a/Userland/Tests/LibC/CMakeLists.txt +++ b/Userland/Tests/LibC/CMakeLists.txt @@ -3,7 +3,6 @@ file(GLOB CMD_SOURCES CONFIGURE_DEPENDS "*.cpp") foreach(CMD_SRC ${CMD_SOURCES}) get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE) add_executable(${CMD_NAME} ${CMD_SRC}) - target_sources("${CMD_NAME}" PRIVATE ${CMAKE_SOURCE_DIR}/Libraries/LibC/crt0_shared.cpp) target_link_libraries(${CMD_NAME} LibCore) install(TARGETS ${CMD_NAME} RUNTIME DESTINATION usr/Tests/LibC) endforeach() |