1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

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.
This commit is contained in:
Gunnar Beutner 2021-05-07 11:08:41 +02:00 committed by Andreas Kling
parent 224755e6ef
commit dd39bb7784
4 changed files with 9 additions and 198 deletions

View file

@ -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/)