Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zydis] Update version to v4.1.0 #39037

Merged
merged 11 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions ports/zydis/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
vcpkg_download_distfile(
OSX_INTEL_ALIGNMENT_FIX
URLS https://github.com/zyantific/zydis/commit/a605f54580c26d2164530fab323057834569d169.patch?full_index=1
SHA512 15fad10e4880ab2ee494babc0451b96604a6cc00c09c6740c6b97b83718e01d8e117614bf8f9ec8a6777e9baa1336c7f540709b21dcdc9b53f912bd117f1d3c0
FILENAME zydis-intel-alignment-fix-a605f54580c26d2164530fab323057834569d169.patch
)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO zyantific/zydis
REF "v${VERSION}"
SHA512 334284bccfb6ce61cc530fd479d6278db3e4df1fb52b311acd7d21558843c9bf14e74a199cd937041d434260b65c506c07ae1a37243d2240eb9443ae5e56e000
SHA512 e07add4d43768ded02a238911fde6e74d2391abf8df282f774fca1a8c3fca3e97b03e90e0f3c7c0f3c75485fb29c0be4071d5e5b2e23dd5b8b1a864e3b713fbc
HEAD_REF master
PATCHES
zycore.patch
"${OSX_INTEL_ALIGNMENT_FIX}"

)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ZYDIS_BUILD_SHARED_LIB)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DZYAN_SYSTEM_ZYCORE=ON
-DZYDIS_BUILD_SHARED_LIB=${ZYDIS_BUILD_SHARED_LIB}
-DZYDIS_BUILD_DOXYGEN=OFF
-DZYDIS_BUILD_EXAMPLES=OFF
OPTIONS_DEBUG
FrankXie05 marked this conversation as resolved.
Show resolved Hide resolved
-DZYDIS_BUILD_TOOLS=OFF
Expand All @@ -34,7 +30,6 @@ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zydis)
vcpkg_copy_tools(TOOL_NAMES ZydisDisasm ZydisInfo AUTO_CLEAN)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/Zydis/Defines.h" "defined(ZYDIS_STATIC_BUILD)" "1")
endif()

Expand Down
3 changes: 1 addition & 2 deletions ports/zydis/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "zydis",
"version-semver": "4.0.0",
"port-version": 2,
"version-semver": "4.1.0",
"description": "Fast and lightweight x86/x86-64 disassembler library.",
"homepage": "https://zydis.re",
"license": "MIT",
Expand Down
80 changes: 14 additions & 66 deletions ports/zydis/zycore.patch
Original file line number Diff line number Diff line change
@@ -1,66 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e812fb..64c6e97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,8 +78,7 @@ if (ZYAN_SYSTEM_ZYCORE)
find_package(Zycore)
else ()
# Try to initialize the Zycore submodule using Git
- if (NOT EXISTS "${ZYAN_ZYCORE_PATH}/CMakeLists.txt" AND
- "${ZYAN_ZYCORE_PATH}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}/dependencies/zycore")
+ if (0)
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
execute_process(
@@ -89,7 +88,7 @@ else ()
endif()
endif ()

- if (NOT EXISTS "${ZYAN_ZYCORE_PATH}/CMakeLists.txt")
+ if (0)
message(
FATAL_ERROR
"Can't find zycore submodule. Please make sure to clone the repo recursively.\n"
@@ -101,7 +100,7 @@ else ()
)
endif ()

- add_subdirectory(${ZYAN_ZYCORE_PATH} "zycore" EXCLUDE_FROM_ALL)
+ find_package(zycore CONFIG REQUIRED)
endif ()

# =============================================================================================== #
@@ -115,7 +114,7 @@ else ()
target_compile_definitions("Zydis" PUBLIC "ZYDIS_STATIC_BUILD")
endif ()

-target_link_libraries("Zydis" PUBLIC "Zycore")
+target_link_libraries("Zydis" PUBLIC Zycore::Zycore)
target_include_directories("Zydis"
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -383,14 +382,16 @@ if (ZYDIS_BUILD_TOOLS AND NOT ZYAN_NO_LIBC)
target_compile_definitions("ZydisFuzzReEncoding" PRIVATE "ZYDIS_LIBFUZZER")
endif ()

- add_executable("ZydisTestEncoderAbsolute"
- "tools/ZydisTestEncoderAbsolute.c")
- target_link_libraries("ZydisTestEncoderAbsolute" "Zydis")
- set_target_properties("ZydisTestEncoderAbsolute" PROPERTIES FOLDER "Tools")
- target_compile_definitions("ZydisTestEncoderAbsolute" PRIVATE "_CRT_SECURE_NO_WARNINGS")
- zyan_set_common_flags("ZydisTestEncoderAbsolute")
- zyan_maybe_enable_wpo("ZydisTestEncoderAbsolute")
- _maybe_set_emscripten_cfg("ZydisTestEncoderAbsolute")
+ if (NOT ZYDIS_BUILD_SHARED_LIB)
+ add_executable("ZydisTestEncoderAbsolute"
+ "tools/ZydisTestEncoderAbsolute.c")
+ target_link_libraries("ZydisTestEncoderAbsolute" "Zydis")
+ set_target_properties("ZydisTestEncoderAbsolute" PROPERTIES FOLDER "Tools")
+ target_compile_definitions("ZydisTestEncoderAbsolute" PRIVATE "_CRT_SECURE_NO_WARNINGS")
+ zyan_set_common_flags("ZydisTestEncoderAbsolute")
+ zyan_maybe_enable_wpo("ZydisTestEncoderAbsolute")
+ _maybe_set_emscripten_cfg("ZydisTestEncoderAbsolute")
+ endif ()
endif ()

add_executable("ZydisInfo" "tools/ZydisInfo.c")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62d5de6..ee500c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -138,7 +138,8 @@ function (locate_zycore)
)
endfunction ()

-locate_zycore()
+find_package(zycore CONFIG REQUIRED)
+add_library(Zycore ALIAS Zycore::Zycore)
FrankXie05 marked this conversation as resolved.
Show resolved Hide resolved

# =============================================================================================== #
# Library configuration #
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9729,8 +9729,8 @@
"port-version": 0
},
"zydis": {
"baseline": "4.0.0",
"port-version": 2
"baseline": "4.1.0",
"port-version": 0
},
"zyre": {
"baseline": "2019-07-07",
Expand Down
5 changes: 5 additions & 0 deletions versions/z-/zydis.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "71d83e580eddfc8e3106fb399e63d58b71366778",
"version-semver": "4.1.0",
"port-version": 0
},
{
"git-tree": "4057692f573c3990f5767e5e2952fc54a76cb1c9",
"version-semver": "4.0.0",
Expand Down
Loading