Browse Source

LibCore: Link against LibSystem

Depending on what OS LibCore is being built for (either SerenityOS or
not-SerenityOS), the library does not just wrap functions from LibC,
but it also implements syscalls itself. Therefore, it needs to link
against LibSystem, as that is the only library that is allowed to do
syscalls.

When cross-compiling the OS this is currently not an issue because
LibC links against LibSystem, and CMake passes that dependency through
transitively by accident. However, on Lagom, LibC is just a dummy
INTERFACE library, so the LibSystem dependency is never pulled in,
resulting in undefined symbols whenever we build LibCore on SerenityOS
as a part of Lagom.
Tim Schumacher 2 years ago
parent
commit
18e2bc635f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibCore/CMakeLists.txt

+ 1 - 1
Userland/Libraries/LibCore/CMakeLists.txt

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