From 18e2bc635fe8f19483b781893fc77180181de1b6 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 23 Oct 2022 22:52:06 +0000 Subject: [PATCH] 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. --- Userland/Libraries/LibCore/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/CMakeLists.txt b/Userland/Libraries/LibCore/CMakeLists.txt index 6170c3f5df..0b5aa8db7d 100644 --- a/Userland/Libraries/LibCore/CMakeLists.txt +++ b/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)