Meta: Remove empty LibSystem library and references

This commit is contained in:
Timothy Flynn 2024-06-03 20:06:42 -04:00 committed by Andreas Kling
parent f5ed7d5d9c
commit 126cbce632
Notes: sideshowbarker 2024-07-17 03:27:40 +09:00
8 changed files with 4 additions and 33 deletions

View file

@ -28,7 +28,6 @@ First, make sure you have a working toolchain and can build and run SerenityOS.
./
Userland/
Userland/Libraries/
Userland/Libraries/LibSystem/
Userland/Services/
Toolchain/Local/x86_64/x86_64-pc-serenity/include/c++/13.1.0
Build/x86_64/

View file

@ -327,18 +327,12 @@ add_lagom_library_install_rules(JSClangPlugin)
# Create mostly empty targets for system libraries we don't need to build for Lagom
add_library(LibC INTERFACE)
add_library(LibCrypt INTERFACE)
add_library(LibSystem INTERFACE)
if (NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" AND NOT HAIKU)
target_link_libraries(LibCrypt INTERFACE crypt) # LibCore::Account uses crypt() but it's not in libcrypt on macOS
endif()
if (SERENITYOS)
# Serenity only allows syscalls from LibSystem, so if someone asks for that on Lagom,
# we need to pass that through to the system's LibSystem.
target_link_libraries(LibSystem INTERFACE system)
endif()
add_library(NoCoverage INTERFACE)
# "install" these special targets to placate CMake
install(TARGETS LibC LibCrypt LibSystem NoCoverage EXPORT LagomTargets)
install(TARGETS LibC LibCrypt NoCoverage EXPORT LagomTargets)
# AK
add_serenity_subdirectory(AK)

View file

@ -31,10 +31,7 @@ shared_library("minimal") {
"Version.h",
]
deps = [
"//AK",
"//Userland/Libraries/LibSystem",
]
deps = [ "//AK" ]
}
source_set("sources") {
@ -170,7 +167,6 @@ shared_library("LibCore") {
":sources",
"//Meta/gn/build/libs/crypt",
"//Meta/gn/build/libs/pthread",
"//Userland/Libraries/LibSystem",
"//Userland/Libraries/LibTimeZone",
"//Userland/Libraries/LibURL",
]

View file

@ -1,3 +0,0 @@
group("LibSystem") {
deps = []
}

View file

@ -29,7 +29,6 @@ add_subdirectory(LibRIFF)
add_subdirectory(LibSanitizer)
add_subdirectory(LibSQL)
add_subdirectory(LibSyntax)
add_subdirectory(LibSystem)
add_subdirectory(LibTest)
add_subdirectory(LibTextCodec)
add_subdirectory(LibThreading)

View file

@ -15,10 +15,9 @@ set(SOURCES
)
serenity_lib(LibCoreMinimal coreminimal)
target_link_libraries(LibCoreMinimal PRIVATE LibSystem)
if (SERENITYOS)
add_library(DynamicLoader_LibCoreArgsParser
add_library(DynamicLoader_LibCoreArgsParser
ArgsParser.cpp
Version.cpp)
target_link_libraries(DynamicLoader_LibCoreArgsParser PUBLIC DynamicLoader_CompileOptions)
@ -93,7 +92,7 @@ if (APPLE OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
endif()
serenity_lib(LibCore core)
target_link_libraries(LibCore PRIVATE LibCrypt LibSystem LibTimeZone LibURL)
target_link_libraries(LibCore PRIVATE LibCrypt LibTimeZone LibURL)
target_link_libraries(LibCore PUBLIC LibCoreMinimal)
if (APPLE)

View file

@ -8,23 +8,11 @@
#include <LibCore/SessionManagement.h>
#include <LibCore/System.h>
#ifdef AK_OS_SERENITY
# include <LibSystem/syscall.h>
#endif
namespace Core::SessionManagement {
ErrorOr<pid_t> root_session_id([[maybe_unused]] Optional<pid_t> force_sid)
{
#ifdef AK_OS_SERENITY
int rc = syscall(SC_get_root_session_id, force_sid.value_or(-1));
if (rc < 0) {
return Error::from_syscall("get_root_session_id"sv, rc);
}
return static_cast<pid_t>(rc);
#else
return 0;
#endif
}
ErrorOr<void> logout(Optional<pid_t> force_sid)

View file

@ -31,7 +31,6 @@
#ifdef AK_OS_SERENITY
# include <Kernel/API/Unveil.h>
# include <LibCore/Account.h>
# include <LibSystem/syscall.h>
# include <serenity.h>
# include <sys/ptrace.h>
# include <sys/sysmacros.h>