diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-07 11:08:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-07 15:35:50 +0200 |
commit | dd39bb77845d880b5e7ed074a4fce63157aeaf3c (patch) | |
tree | e6ec7ca9bff545bc55b8a621c5533670016ec758 /Userland/DynamicLoader/CMakeLists.txt | |
parent | 224755e6efd7021e07d88a2093ef81a195b9f665 (diff) | |
download | serenity-dd39bb77845d880b5e7ed074a4fce63157aeaf3c.zip |
DynamicLoader: Remove math functionality in favor of -lgcc
This links the dynamic linker against libgcc.a instead of having
our own copy of the math functions.
For now we need to specify -fbuilding-libgcc as a hack to work
around a bug with the -nodefaultlibs flag. Once everyone is on
the latest toolchain version this can be removed.
Diffstat (limited to 'Userland/DynamicLoader/CMakeLists.txt')
-rw-r--r-- | Userland/DynamicLoader/CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt index 3ce9836039..dd9cb3dc03 100644 --- a/Userland/DynamicLoader/CMakeLists.txt +++ b/Userland/DynamicLoader/CMakeLists.txt @@ -1,6 +1,5 @@ set(LOADER_SOURCES main.cpp - math.cpp misc.cpp ) @@ -23,11 +22,13 @@ add_definitions(-D_DYNAMIC_LOADER) set(SOURCES ${LOADER_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${LIBC_SOURCES1} ${LIBC_SOURCES2} ${LIBC_SOURCES3} ${LIBSYSTEM_SOURCES}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -nostdlib -pie -fpic -DNO_TLS") +# FIXME: Remove -fbuilding-libgcc after the next toolchain update +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fbuilding-libgcc -fno-rtti -nostdlib -pie -fpic -DNO_TLS") set_source_files_properties (../Libraries/LibC/ssp.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector") add_executable(Loader.so ${SOURCES}) +target_link_libraries(Loader.so gcc) target_link_options(Loader.so PRIVATE LINKER:--no-dynamic-linker) install(TARGETS Loader.so RUNTIME DESTINATION usr/lib/) |