1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 15:17:46 +00:00

Everywhere: Explicitly link all binaries against the LibC target

Even though the toolchain implicitly links against -lc, it does not know
where it should get LibC from except for the sysroot. In the case of
Clang this causes it to pick up the LibC stub instead, which might be
slightly outdated and feature missing symbols.

This is currently not an issue that manifests because we pass through
the dependency on LibC and other libraries by accident, which causes
CMake to link against the LibC target (instead of just the library),
and thus points the linker at the build output directory.

Since we are looking to fix that in the upcoming commits, let's make
sure that everything will still be able to find the proper LibC first.
This commit is contained in:
Tim Schumacher 2022-10-22 15:13:49 +02:00 committed by Linus Groh
parent 39fca21e11
commit 7834e26ddb
39 changed files with 42 additions and 33 deletions

View file

@ -6,4 +6,4 @@ set(SOURCES
)
serenity_lib(LibCards cards)
target_link_libraries(LibCards LibC LibCore LibConfig LibGUI)
target_link_libraries(LibCards LibCore LibConfig LibGUI)

View file

@ -5,4 +5,4 @@ set(SOURCES
)
serenity_lib(LibChess chess)
target_link_libraries(LibChess LibC LibCore)
target_link_libraries(LibChess LibCore)

View file

@ -4,7 +4,6 @@ set(SOURCES
)
serenity_lib(LibCodeComprehension codecomprehension)
target_link_libraries(LibCodeComprehension LibC)
add_subdirectory(Cpp)
add_subdirectory(Shell)

View file

@ -3,7 +3,7 @@ set(SOURCES
)
serenity_lib(LibCppComprehension cppcomprehension)
target_link_libraries(LibCppComprehension LibCodeComprehension LibC)
target_link_libraries(LibCppComprehension LibCodeComprehension)
serenity_component(
CppComprehensionTests

View file

@ -3,4 +3,4 @@ set(SOURCES
)
serenity_lib(LibShellComprehension shellcomprehension)
target_link_libraries(LibShellComprehension LibCodeComprehension LibC)
target_link_libraries(LibShellComprehension LibCodeComprehension)

View file

@ -7,4 +7,4 @@ set(SOURCES
)
serenity_lib(LibCompress compress)
target_link_libraries(LibCompress LibC LibCrypto)
target_link_libraries(LibCompress LibCrypto)

View file

@ -45,4 +45,4 @@ if (NOT ANDROID AND NOT WIN32)
endif()
serenity_lib(LibCore core)
target_link_libraries(LibCore LibC LibCrypt LibSystem)
target_link_libraries(LibCore LibCrypt LibSystem)

View file

@ -5,4 +5,4 @@ set(SOURCES
)
serenity_lib(LibCoredump coredump)
target_link_libraries(LibCoredump LibC LibCompress LibCore LibDebug)
target_link_libraries(LibCoredump LibCompress LibCore LibDebug)

View file

@ -9,4 +9,4 @@ set(SOURCES
)
serenity_lib(LibCpp cpp)
target_link_libraries(LibCpp LibC LibSyntax LibDiff)
target_link_libraries(LibCpp LibSyntax LibDiff)

View file

@ -11,4 +11,4 @@ set(SOURCES
)
serenity_lib(LibCrypt crypt)
target_link_libraries(LibCrypt LibC LibCryptSHA2)
target_link_libraries(LibCrypt LibCryptSHA2)

View file

@ -33,4 +33,4 @@ set(SOURCES
)
serenity_lib(LibCrypto crypto)
target_link_libraries(LibCrypto LibC LibCore)
target_link_libraries(LibCrypto LibCore)

View file

@ -5,4 +5,4 @@ set(SOURCES
)
serenity_lib(LibDNS dns)
target_link_libraries(LibDNS LibC LibIPC)
target_link_libraries(LibDNS LibIPC)

View file

@ -14,4 +14,4 @@ set(SOURCES
)
serenity_lib(LibDebug debug)
target_link_libraries(LibDebug LibC LibRegex)
target_link_libraries(LibDebug LibRegex)

View file

@ -4,4 +4,4 @@ set(SOURCES
)
serenity_lib(LibDeviceTree DeviceTree)
target_link_libraries(LibDeviceTree LibC LibCore)
target_link_libraries(LibDeviceTree LibCore)

View file

@ -6,4 +6,3 @@ set(SOURCES
)
serenity_lib(LibDiff diff)
target_link_libraries(LibDiff LibC)

View file

@ -8,5 +8,4 @@ set(SOURCES
)
serenity_lib(LibEDID edid)
target_link_libraries(LibEDID LibC)
target_compile_definitions(LibEDID PRIVATE ENABLE_PNP_IDS_DATA=$<BOOL:${ENABLE_PNP_IDS_DOWNLOAD}>)

View file

@ -5,4 +5,4 @@ set(SOURCES
)
serenity_lib(LibIPC ipc)
target_link_libraries(LibIPC LibC LibCore)
target_link_libraries(LibIPC LibCore)

View file

@ -7,4 +7,4 @@ set(SOURCES
)
serenity_lib(LibLine line)
target_link_libraries(LibLine LibC LibCore)
target_link_libraries(LibLine LibCore)

View file

@ -3,4 +3,3 @@ set(SOURCES
)
serenity_lib_static(LibMain main)
target_link_libraries(LibMain LibC)

View file

@ -3,4 +3,3 @@ set(SOURCES
)
serenity_lib(LibPCIDB pcidb)
target_link_libraries(LibPCIDB LibC)

View file

@ -19,4 +19,4 @@ set(SOURCES
)
serenity_lib(LibPDF pdf)
target_link_libraries(LibPDF LibC LibCore LibIPC LibGfx LibTextCodec LibCrypto)
target_link_libraries(LibPDF LibCore LibIPC LibGfx LibTextCodec LibCrypto)

View file

@ -11,4 +11,4 @@ if(SERENITYOS)
endif()
serenity_lib(LibRegex regex)
target_link_libraries(LibRegex LibC LibCore LibUnicode)
target_link_libraries(LibRegex LibCore LibUnicode)

View file

@ -3,4 +3,3 @@ set(SOURCES
)
serenity_lib(LibSyntax syntax)
target_link_libraries(LibSyntax LibC)

View file

@ -6,7 +6,6 @@ set(SOURCES
)
serenity_lib(LibTest test)
target_link_libraries(LibTest LibC)
add_library(LibTestMain OBJECT TestMain.cpp)
add_library(JavaScriptTestRunnerMain OBJECT JavaScriptTestRunnerMain.cpp)

View file

@ -3,4 +3,3 @@ set(SOURCES
)
serenity_lib(LibTextCodec textcodec)
target_link_libraries(LibTextCodec LibC)

View file

@ -4,4 +4,4 @@ set(SOURCES
)
serenity_lib(LibThreading threading)
target_link_libraries(LibThreading LibC LibCore)
target_link_libraries(LibThreading LibCore)

View file

@ -3,4 +3,3 @@ set(SOURCES
)
serenity_lib(LibUSBDB usbdb)
target_link_libraries(LibUSBDB LibC)

View file

@ -11,4 +11,4 @@ set(GENERATED_SOURCES
generate_state_machine(StateMachine.txt EscapeSequenceStateMachine.h)
serenity_lib(LibVT vt)
target_link_libraries(LibVT LibC LibCore LibGUI LibGfx LibDesktop LibConfig)
target_link_libraries(LibVT LibCore LibGUI LibGfx LibDesktop LibConfig)

View file

@ -8,4 +8,4 @@ set(SOURCES
)
serenity_lib(LibWasm wasm)
target_link_libraries(LibWasm LibC LibCore)
target_link_libraries(LibWasm LibCore)

View file

@ -3,4 +3,3 @@ set(SOURCES
)
serenity_lib(LibX86 x86)
target_link_libraries(LibX86 LibC)

View file

@ -4,4 +4,3 @@ set(SOURCES
)
serenity_lib(LibXML xml)
target_link_libraries(LibXML LibC)