-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update backend of xnu kernel, and macho_ctx_kit
- Loading branch information
Showing
24 changed files
with
123 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,55 @@ | ||
set(SOURCE_FILE_LIST) | ||
|
||
include_directories( | ||
. | ||
) | ||
|
||
if (NOT DEFINED DOBBY_DIR) | ||
message(FATAL_ERROR "DOBBY_DIR must be set!") | ||
endif () | ||
|
||
if (SYSTEM.Darwin AND (NOT DOBBY_BUILD_KERNEL_MODE)) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST} | ||
if (SYSTEM.Darwin) | ||
add_library(macho_ctx_kit | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/macho_ctx.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/macho_ctx.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/shared_cache_ctx.cpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/dobby_symbol_resolver.cc | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/macho_file_symbol_resolver.cpp | ||
) | ||
|
||
${DOBBY_DIR}/source/Backend/UserMode/PlatformUtil/Darwin/ProcessRuntimeUtility.cc | ||
add_library(shared_cache_ctx_kit | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/shared_cache_ctx.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/shared_cache_ctx.cpp | ||
) | ||
endif () | ||
if (SYSTEM.Darwin AND DOBBY_BUILD_KERNEL_MODE) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST} | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/dobby_symbol_resolver.cc | ||
|
||
${DOBBY_DIR}/source/Backend/KernelMode/PlatformUtil/Darwin/ProcessRuntimeUtility.cc | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST} | ||
macho/macho_ctx.cc | ||
macho/dobby_symbol_resolver.cc | ||
) | ||
endif () | ||
if (SYSTEM.Linux OR SYSTEM.Android) | ||
|
||
if (NOT DOBBY_BUILD_KERNEL_MODE) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST} | ||
macho/macho_file_symbol_resolver.cpp | ||
macho/shared_cache_ctx.cpp | ||
${DOBBY_DIR}/source/Backend/UserMode/PlatformUtil/Darwin/ProcessRuntimeUtility.cc | ||
) | ||
endif () | ||
elseif (SYSTEM.Linux OR SYSTEM.Android) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST} | ||
${CMAKE_CURRENT_SOURCE_DIR}/elf/dobby_symbol_resolver.cc | ||
elf/dobby_symbol_resolver.cc | ||
|
||
${DOBBY_DIR}/source/Backend/UserMode/PlatformUtil/Linux/ProcessRuntimeUtility.cc | ||
) | ||
endif () | ||
if (SYSTEM.Windows) | ||
elseif (SYSTEM.Windows) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST} | ||
${CMAKE_CURRENT_SOURCE_DIR}/pe/dobby_symbol_resolver.cc | ||
pe/dobby_symbol_resolver.cc | ||
|
||
${DOBBY_DIR}/source/Backend/UserMode/PlatformUtil/Windows/ProcessRuntimeUtility.cc | ||
) | ||
endif () | ||
|
||
add_library(macho_ctx_kit | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/macho_ctx.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/macho_ctx.cc | ||
) | ||
|
||
add_library(shared_cache_ctx_kit | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/shared_cache_ctx.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/macho/shared_cache_ctx.cpp | ||
) | ||
get_absolute_path_list(SOURCE_FILE_LIST SOURCE_FILE_LIST_) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST_}) | ||
|
||
add_library(dobby_symbol_resolver | ||
${SOURCE_FILE_LIST} | ||
) | ||
|
||
|
||
include_directories( | ||
. | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
# Check files list exist | ||
function(check_files_exist CHECK_FILES) | ||
foreach(file ${CHECK_FILES}) | ||
if(NOT EXISTS "${file}") | ||
message(FATAL_ERROR "${file} NOT EXISTS!") | ||
endif() | ||
endforeach() | ||
foreach (file ${CHECK_FILES}) | ||
if (NOT EXISTS "${file}") | ||
message(FATAL_ERROR "${file} NOT EXISTS!") | ||
endif () | ||
endforeach () | ||
endfunction(check_files_exist CHECK_FILES) | ||
|
||
# Search suffix files | ||
function(search_suffix_files suffix INPUT_VARIABLE OUTPUT_VARIABLE) | ||
set(ResultFiles ) | ||
foreach(filePath ${${INPUT_VARIABLE}}) | ||
# message(STATUS "[*] searching *.${suffix} from ${filePath}") | ||
file(GLOB files ${filePath}/*.${suffix}) | ||
set(ResultFiles ${ResultFiles} ${files}) | ||
endforeach() | ||
set(${OUTPUT_VARIABLE} ${ResultFiles} PARENT_SCOPE) | ||
set(ResultFiles) | ||
foreach (filePath ${${INPUT_VARIABLE}}) | ||
# message(STATUS "[*] searching *.${suffix} from ${filePath}") | ||
file(GLOB files ${filePath}/*.${suffix}) | ||
set(ResultFiles ${ResultFiles} ${files}) | ||
endforeach () | ||
set(${OUTPUT_VARIABLE} ${ResultFiles} PARENT_SCOPE) | ||
endfunction() | ||
|
||
|
||
function(get_absolute_path_list input_list output_list) | ||
set(absolute_list) | ||
foreach (file ${${input_list}}) | ||
get_filename_component(absolute_file ${file} ABSOLUTE) | ||
list(APPEND absolute_list ${absolute_file}) | ||
endforeach () | ||
set(${output_list} ${absolute_list} PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
include_directories(.) | ||
|
||
if(NOT DOBBY_BUILD_KERNEL_MODE) | ||
set(SOURCE_FILE_LIST | ||
${CMAKE_CURRENT_SOURCE_DIR}/logging.cc | ||
set(SOURCE_FILE_LIST | ||
logging.cc | ||
) | ||
else() | ||
|
||
if (DOBBY_BUILD_KERNEL_MODE) | ||
set(SOURCE_FILE_LIST | ||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_logging.cc | ||
logging_kern.cc | ||
) | ||
endif() | ||
endif () | ||
|
||
get_absolute_path_list(SOURCE_FILE_LIST SOURCE_FILE_LIST_) | ||
set(SOURCE_FILE_LIST ${SOURCE_FILE_LIST_}) | ||
|
||
add_library(logging | ||
${SOURCE_FILE_LIST} | ||
${SOURCE_HEADER_LIST} | ||
) | ||
) |
Oops, something went wrong.