Browse Source

Meta: Remove empty LibSystem library and references

Timothy Flynn 1 năm trước cách đây
mục cha
commit
126cbce632

+ 0 - 1
Documentation/QtCreatorConfiguration.md

@@ -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/

+ 1 - 7
Meta/Lagom/CMakeLists.txt

@@ -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)

+ 1 - 5
Meta/gn/secondary/Userland/Libraries/LibCore/BUILD.gn

@@ -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",
   ]

+ 0 - 3
Meta/gn/secondary/Userland/Libraries/LibSystem/BUILD.gn

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

+ 0 - 1
Userland/Libraries/CMakeLists.txt

@@ -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)

+ 2 - 3
Userland/Libraries/LibCore/CMakeLists.txt

@@ -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)

+ 0 - 12
Userland/Libraries/LibCore/SessionManagement.cpp

@@ -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)

+ 0 - 1
Userland/Libraries/LibCore/System.cpp

@@ -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>