浏览代码

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 年之前
父节点
当前提交
18e2bc635f
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)