[triton] New version with no boost dependencies (#24081)

* update Triton version

* add vcpkg versioning
This commit is contained in:
Alberto Garcia Illera 2022-04-20 02:38:20 +10:00 committed by GitHub
parent 37ebb4419b
commit d34bda3300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 117 deletions

View File

@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8bbe47..966ded8 100644
index c8da1610..106fdb8b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -99,9 +99,9 @@ list(APPEND CMAKE_MODULE_PATH "${TRITON_ROOT}/CMakeModules/")
@@ -103,9 +103,9 @@ list(APPEND CMAKE_MODULE_PATH "${TRITON_ROOT}/CMakeModules/")
# Find Z3
if(Z3_INTERFACE)
message(STATUS "Compiling with Z3 SMT solver")
@ -15,28 +15,16 @@ index a8bbe47..966ded8 100644
# Find bitwuzla
diff --git a/src/libtriton/Config.cmake.in b/src/libtriton/Config.cmake.in
index 683b5f2..5df941e 100644
index 90cf6bfe..33f27d23 100644
--- a/src/libtriton/Config.cmake.in
+++ b/src/libtriton/Config.cmake.in
@@ -19,6 +19,9 @@ message(STATUS "Found Triton: ${CMAKE_CURRENT_LIST_DIR}/tritonConfig.cmake (foun
@@ -47,8 +47,7 @@ endif()
include(CMakeFindDependencyMacro)
find_dependency(Boost)
+if (@Z3_INTERFACE@)
# Z3 include directories
if (TRITON_Z3_INTERFACE)
- include_directories("@Z3_INCLUDE_DIRS@")
- link_directories(BEFORE "@Z3_LIB_DIR@")
+ find_dependency(Z3 CONFIG)
+endif()
# Triton include
include_directories("@CMAKE_INSTALL_PREFIX@/include")
@@ -37,11 +40,6 @@ if (TRITON_LLVM_INTERFACE)
include_directories("@LLVM_INCLUDE_DIRS@")
endif()
-# Z3 include directories
-if (TRITON_Z3_INTERFACE)
- include_directories("@Z3_INCLUDE_DIRS@")
-endif()
-
# Bitwuzla include directories
if (TRITON_BITWUZLA_INTERFACE)
include_directories("@BITWUZLA_INCLUDE_DIRS@")

View File

@ -1,60 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 966ded8..199a3ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,8 +129,8 @@ endif()
# Find Capstone
message(STATUS "Compiling with Capstone")
-find_package(CAPSTONE REQUIRED)
-include_directories(${CAPSTONE_INCLUDE_DIRS})
+find_package(CAPSTONE CONFIG REQUIRED)
+set(CAPSTONE_LIBRARIES capstone::capstone)
# Find boost
message(STATUS "Compiling with Boost headers")
diff --git a/src/libtriton/Config.cmake.in b/src/libtriton/Config.cmake.in
index 5df941e..23c5a27 100644
--- a/src/libtriton/Config.cmake.in
+++ b/src/libtriton/Config.cmake.in
@@ -19,6 +19,7 @@ message(STATUS "Found Triton: ${CMAKE_CURRENT_LIST_DIR}/tritonConfig.cmake (foun
include(CMakeFindDependencyMacro)
find_dependency(Boost)
+find_dependency(capstone CONFIG)
if (@Z3_INTERFACE@)
find_dependency(Z3 CONFIG)
endif()
@@ -26,9 +27,6 @@ endif()
# Triton include
include_directories("@CMAKE_INSTALL_PREFIX@/include")
-# Capstone include
-include_directories("@CAPSTONE_INCLUDE_DIRS@")
-
# Python include directories
if (TRITON_PYTHON_BINDINGS)
include_directories("@PYTHON_INCLUDE_DIRS@")
diff --git a/src/libtriton/includes/triton/externalLibs.hpp b/src/libtriton/includes/triton/externalLibs.hpp
index 65678a0..d055f88 100644
--- a/src/libtriton/includes/triton/externalLibs.hpp
+++ b/src/libtriton/includes/triton/externalLibs.hpp
@@ -29,14 +29,10 @@ namespace triton {
* \addtogroup extlibs
* @{
*/
- #if defined(__unix__) || defined(__APPLE__)
- #include <capstone/arm64.h>
- #include <capstone/arm.h>
- #include <capstone/capstone.h>
- #include <capstone/x86.h>
- #elif _WIN32
- #include <capstone.h>
- #endif
+ #include <capstone/arm64.h>
+ #include <capstone/arm.h>
+ #include <capstone/capstone.h>
+ #include <capstone/x86.h>
/*! @} End of capstone namespace */
};

View File

@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8da1610..40ab12c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,6 @@ if(PYTHON_BINDINGS)
find_package(PythonInterp ${PYTHON_VERSION} REQUIRED)
find_package(PythonLibs ${PYTHON_VERSION} REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
- add_definitions("-DPYTHON_LIBRARIES=\"${PYTHON_LIBRARIES}\"")
cmake_path(GET PYTHON_LIBRARY PARENT_PATH PYTHON_LIB_DIR)
cmake_path(GET PYTHON_LIBRARY STEM LAST_ONLY PYTHON_LIB_NAME)
string(REGEX REPLACE "^lib" "" PYTHON_LIB_NAME ${PYTHON_LIB_NAME})
diff --git a/src/libtriton/CMakeLists.txt b/src/libtriton/CMakeLists.txt
index 7101cce8..a052b066 100644
--- a/src/libtriton/CMakeLists.txt
+++ b/src/libtriton/CMakeLists.txt
@@ -330,9 +330,9 @@ if(PYTHON_BINDINGS)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sysconfig import get_path; print(get_path('platlib'))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/triton${PYTHON_SUFFIX} DESTINATION ${PYTHON_SITE_PACKAGES})
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CONFIG_NAME}/triton${PYTHON_SUFFIX} DESTINATION share/triton)
else()
- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/triton${PYTHON_SUFFIX} DESTINATION ${PYTHON_SITE_PACKAGES})
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/triton${PYTHON_SUFFIX} DESTINATION share/triton)
endif()
else()
execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import version_info; print(f'lib/python{version_info[0]}.{version_info[1]}/site-packages')" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)

View File

@ -1,27 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 966ded8..baf0ec3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,7 +52,6 @@ if(PYTHON_BINDINGS)
find_package(PythonInterp ${PYTHON_VERSION} REQUIRED)
find_package(PythonLibs ${PYTHON_VERSION} REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
- add_definitions("-DPYTHON_LIBRARIES=\"${PYTHON_LIBRARIES}\"")
add_custom_target(test-python
COMMAND ${PYTHONPATH_CMD} ${PYTHON_EXECUTABLE} -m unittest discover ${TRITON_ROOT}/src/testers/unittests
DEPENDS python-triton
diff --git a/src/libtriton/CMakeLists.txt b/src/libtriton/CMakeLists.txt
index 6770b08..701d55b 100644
--- a/src/libtriton/CMakeLists.txt
+++ b/src/libtriton/CMakeLists.txt
@@ -326,8 +326,8 @@ if(PYTHON_BINDINGS)
)
execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sysconfig import get_path; print(get_path('platlib'))" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/triton${PYTHON_SUFFIX} DESTINATION ${PYTHON_SITE_PACKAGES})
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CONFIG_NAME}/triton${PYTHON_SUFFIX} DESTINATION share/triton)
else()
- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/triton${PYTHON_SUFFIX} DESTINATION ${PYTHON_SITE_PACKAGES})
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/triton${PYTHON_SUFFIX} DESTINATION share/triton)
endif()
endif()

View File

@ -1,13 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO JonathanSalwan/Triton
REF 64a2b9b0490c82e41b37e623b1d0da14e2382e7a
SHA512 ff99a270813043df2bc0da765e04aae4b9d5a911d20c6e5ffca1472eae8d6e1fcfff3cd56da023d6a77a647644839430bf72902acd84ec521a0e098f185d275c
REF 243026c9c1e07a5ca834c4aaf628d1079f6a85ea
SHA512 9e46c500203647de545286b78a7d4ae6da1796b8eed30fe7346ae6e51865ef70de1adb858c402c3687c471ad654cc6aefdff8893196f5ef7b45e4cee6dd9c577
PATCHES
001-fix-dependency-z3.patch
002-fix-dependency-capstone.patch
003-fix-capstone-5.patch
004-fix-python.patch
002-fix-capstone-5.patch
003-fix-python.patch
)
string(COMPARE NOTEQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" DYNAMICLIB)
@ -31,6 +30,7 @@ vcpkg_cmake_configure(
OPTIONS
${FEATURE_OPTIONS}
-DZ3_INTERFACE=ON
-DTRITON_BOOST_INTERFACE=OFF
-DBUILD_SHARED_LIBS=${DYNAMICLIB}
-DMSVC_STATIC=${STATICCRT}
-DBUILD_EXAMPLES=OFF

View File

@ -1,15 +1,12 @@
{
"name": "triton",
"version": "0.9",
"port-version": 2,
"port-version": 3,
"description": "Triton is a Dynamic Binary Analysis (DBA) framework. It provides internal components like a Dynamic Symbolic Execution (DSE) engine, a dynamic taint engine, AST representations of the x86, x86-64, ARM32 and AArch64 Instructions Set Architecture (ISA), SMT simplification passes, an SMT solver interface and, the last but not least, Python bindings.",
"homepage": "https://github.com/JonathanSalwan/Triton",
"license": "Apache-2.0",
"supports": "!arm",
"dependencies": [
"boost-math",
"boost-multiprecision",
"boost-numeric-conversion",
{
"name": "capstone",
"default-features": false,

View File

@ -7114,7 +7114,7 @@
},
"triton": {
"baseline": "0.9",
"port-version": 2
"port-version": 3
},
"trompeloeil": {
"baseline": "41",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dd0d283c09ee98abf32a81d0833e81a9e5222028",
"version": "0.9",
"port-version": 3
},
{
"git-tree": "220ce7aa574609f64206fc02906b1bd2eafbc8aa",
"version": "0.9",