From 4afea46ec03ef2af045a6a3714a36b61d9dd53c7 Mon Sep 17 00:00:00 2001 From: Thomas A Date: Fri, 19 May 2023 12:37:39 -0700 Subject: [PATCH] Build kxld And libsystem_kernel From XNU Repo. Remove LKM From Build Scripts. --- cmake/use_ld64.cmake | 4 ++-- src/CMakeLists.txt | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmake/use_ld64.cmake b/cmake/use_ld64.cmake index 61087c1ac..0982f7a76 100644 --- a/cmake/use_ld64.cmake +++ b/cmake/use_ld64.cmake @@ -17,7 +17,7 @@ FUNCTION(use_ld64 target) -Wl,-sdk_version,${CMAKE_OSX_DEPLOYMENT_TARGET} \ -Wl,-dylib_file,/usr/lib/system/libsystem_c.dylib:${CMAKE_BINARY_DIR}/src/external/libc/libsystem_c_firstpass.dylib \ -Wl,-dylib_file,/usr/lib/system/libsystem_darwin.dylib:${CMAKE_BINARY_DIR}/src/external/libc/libdarwin/libsystem_darwin.dylib \ --Wl,-dylib_file,/usr/lib/system/libsystem_kernel.dylib:${CMAKE_BINARY_DIR}/src/kernel/libsystem_kernel_firstpass.dylib \ +-Wl,-dylib_file,/usr/lib/system/libsystem_kernel.dylib:${CMAKE_BINARY_DIR}/src/external/xnu/darling/src/libsystem_kernel/libsystem_kernel_firstpass.dylib \ -Wl,-dylib_file,/usr/lib/system/libunwind.dylib:${CMAKE_BINARY_DIR}/src/external/libunwind/libunwind_firstpass.dylib \ -Wl,-dylib_file,/usr/lib/system/libsystem_m.dylib:${CMAKE_BINARY_DIR}/src/libm/libsystem_m_firstpass.dylib \ -Wl,-dylib_file,/usr/lib/system/libcompiler_rt.dylib:${CMAKE_BINARY_DIR}/src/external/compiler-rt/lib/builtins/libcompiler_rt_firstpass.dylib \ @@ -126,7 +126,7 @@ FUNCTION(use_ld64 target) -Wl,-dylib_file,/System/Library/Frameworks/LocalAuthentication.framework/Versions/A/LocalAuthentication:${CMAKE_BINARY_DIR}/src/frameworks/LocalAuthentication/LocalAuthentication \ -Wl,-dylib_file,/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo:${CMAKE_BINARY_DIR}/src/frameworks/CoreVideo/CoreVideo \ -Wl,-dylib_file,/System/Library/PrivateFrameworks/FMDB.framework/Versions/A/FMDB:${CMAKE_BINARY_DIR}/src/external/fmdb/FMDB \ --Wl,-dylib_file,/usr/lib/system/libkxld.dylib:${CMAKE_BINARY_DIR}/src/external/lkm/libkern/kxld/libkxld.dylib \ +-Wl,-dylib_file,/usr/lib/system/libkxld.dylib:${CMAKE_BINARY_DIR}/src/external/xnu/libkern/kxld/libkxld.dylib \ -Wl,-dylib_file,/usr/lib/libcrypto.44.dylib:${CMAKE_BINARY_DIR}/src/external/libressl-2.8.3/libcrypto.44.dylib \ -Wl,-dylib_file,/usr/lib/libssl.46.dylib:${CMAKE_BINARY_DIR}/src/external/libressl-2.8.3/libssl.46.dylib \ -Wl,-dylib_file,/usr/lib/libMobileGestalt.dylib:${CMAKE_BINARY_DIR}/src/libMobileGestalt/libMobileGestalt.dylib \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e10427b64..0f09c6225 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -136,7 +136,7 @@ add_subdirectory(libsimple "${CMAKE_CURRENT_BINARY_DIR}/libsimple-darling") add_subdirectory(external/libkqueue) # needs to come before libplatform because it generates mig headers that libplatform needs -add_subdirectory(kernel) +add_subdirectory(external/xnu/darling/src/libsystem_kernel) add_subdirectory(external/libplatform) add_subdirectory(external/libpthread) @@ -304,7 +304,7 @@ if (COMPONENT_cli OR COMPONENT_dev_gui_common) add_subdirectory(external/sqlite) add_subdirectory(external/openpam) add_subdirectory(external/energytrace) - add_subdirectory(external/lkm/libkern/kxld) + add_subdirectory(external/xnu/libkern/kxld) add_subdirectory(external/IOKitUser) add_subdirectory(external/xar) add_subdirectory(libpmenergy) @@ -406,9 +406,6 @@ add_subdirectory(tools) add_subdirectory(frameworks) add_subdirectory(private-frameworks) -# TODO: get rid of this; we really only need its headers right now -add_subdirectory(external/lkm) - # /Applications #add_subdirectory(external/TextEdit)