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

[lief/mbedtls] Update to 0.12.1 and 3.1.0 #22957

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ffb9649
[mbedtls] update to 3.0.0
JonLiu1993 Oct 20, 2021
ecc5dc9
update version
JonLiu1993 Oct 20, 2021
d4b5d57
update version
JonLiu1993 Oct 21, 2021
351ec99
[lief] Add new port for lief-project/LIEF
BehroozAbbassi Nov 5, 2021
ff0d91d
[lief] Add new port for lief-project/LIEF
BehroozAbbassi Nov 5, 2021
52c7b78
Update ports/lief/portfile.cmake
BehroozAbbassi Nov 20, 2021
735dd5b
Update ports/lief/portfile.cmake
BehroozAbbassi Nov 20, 2021
6b428c3
Update ports/lief/portfile.cmake
BehroozAbbassi Nov 20, 2021
dca0802
Update ports/lief/portfile.cmake
BehroozAbbassi Nov 20, 2021
2960f30
Update ports/lief/vcpkg.json
BehroozAbbassi Nov 20, 2021
6de3b34
Update ports/lief/vcpkg.json
BehroozAbbassi Nov 20, 2021
66e3201
Update portfile.cmake
BehroozAbbassi Nov 20, 2021
a51156a
Update CI baseline
BehroozAbbassi Nov 20, 2021
f5d9218
Update portfile.cmake
BehroozAbbassi Nov 20, 2021
44e4de6
Update portfile.cmake
BehroozAbbassi Nov 20, 2021
ec0933d
update version
JonLiu1993 Nov 22, 2021
528e217
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
JonLiu1993 Jan 6, 2022
71eb6f3
[mbedtls] update to 3.1.0
JonLiu1993 Jan 6, 2022
7992465
update version
JonLiu1993 Jan 6, 2022
b9a9286
fix configure_file error
JonLiu1993 Jan 6, 2022
3eb3c2f
update version
JonLiu1993 Jan 6, 2022
cff4f3b
fix configure_file error
JonLiu1993 Jan 6, 2022
6ebf844
update version
JonLiu1993 Jan 6, 2022
e28701c
fix configure_file error
JonLiu1993 Jan 6, 2022
c056c4d
upadte version
JonLiu1993 Jan 6, 2022
b1870ee
fix configure_file error
JonLiu1993 Jan 6, 2022
eddc931
update version
JonLiu1993 Jan 6, 2022
213d49e
fix configure_file error
JonLiu1993 Jan 6, 2022
4ca6491
update version
JonLiu1993 Jan 6, 2022
620ced7
Merge branch 'microsoft:master' into master
BehroozAbbassi Jan 12, 2022
654dc76
Add MSVC specific variables to the LIEF_USE_CRT_RELEASE
BehroozAbbassi Jan 12, 2022
00005e1
add lief:x64-windows-static-md=fail to the ci.baseline.txt
BehroozAbbassi Jan 12, 2022
6fdad13
Update version database
BehroozAbbassi Jan 12, 2022
595baf8
update ci.baseline.txt
BehroozAbbassi Jan 12, 2022
e621fe0
Update scripts/ci.baseline.txt
BehroozAbbassi Jan 13, 2022
9625f72
Update scripts/ci.baseline.txt
BehroozAbbassi Jan 13, 2022
ad44909
Add supports platforms/triplets to the vcpkg.json
BehroozAbbassi Jan 13, 2022
294a989
Update version database
BehroozAbbassi Jan 13, 2022
cbc7934
Update ci.baseline.txt
BehroozAbbassi Jan 13, 2022
7ffc538
Update version database
BehroozAbbassi Jan 13, 2022
71525da
Update ports/lief/portfile.cmake
BehroozAbbassi Jan 14, 2022
cee387f
Update ports/lief/vcpkg.json
BehroozAbbassi Jan 14, 2022
2a4fb4e
Update version database
BehroozAbbassi Jan 14, 2022
12cd9aa
Some fixes for LIEF and mbedtls
ekilmer Feb 1, 2022
8d7ebb2
Merge branch 'master' into more-lief
ekilmer Feb 5, 2022
f6209c0
Fix some Windows compilation errors
ekilmer Feb 5, 2022
4f97fdb
Add version
ekilmer Feb 5, 2022
b029fbe
Fix Windows linking
ekilmer Feb 6, 2022
6551b43
Merge remote-tracking branch 'JonLiu1993/dev/Jon/mbedtls' into more-lief
ekilmer Feb 6, 2022
97eb98a
Version update
ekilmer Feb 6, 2022
9c42a62
Remove mbedtls vcpkg-cmake-wrapper for pthreads
ekilmer Feb 6, 2022
2bbe524
Update version
ekilmer Feb 6, 2022
d7ac27e
LIEF fails on windows arm64
ekilmer Feb 7, 2022
047453d
Update to follow maintainer guidelines
ekilmer Feb 7, 2022
fb11b6f
Update versions
ekilmer Feb 7, 2022
9d0c38f
Update to latest commit on master
ekilmer Feb 10, 2022
f9b3b0e
Update version
ekilmer Feb 10, 2022
5512a7e
Fixup patch to build on Windows
ekilmer Feb 10, 2022
ec80fe3
Update version
ekilmer Feb 10, 2022
af73691
Update windows patch
ekilmer Feb 10, 2022
5958dc3
Update version
ekilmer Feb 10, 2022
b728824
Update to latest master
ekilmer Feb 12, 2022
9fa05d1
Update version
ekilmer Feb 12, 2022
ab77d3b
Update LIEF to latest master. Add tcb/span dependency
ekilmer Feb 15, 2022
6d195b8
Update versions
ekilmer Feb 15, 2022
8d8fa8e
Rename span to tcb-span - same as Conan
ekilmer Feb 15, 2022
17f8437
Update versions
ekilmer Feb 15, 2022
3fba70f
Merge branch 'master' into more-lief
ekilmer Feb 15, 2022
3656bef
Update LIEF to master commit and simplify patch
ekilmer Feb 21, 2022
594a2c6
Update version
ekilmer Feb 21, 2022
b1d5b33
Upgrade ixwebsocket for MbedTLSv3 support
ekilmer Feb 21, 2022
5c6234a
Add ixwebsocket version
ekilmer Feb 21, 2022
b2d2afc
Use patches from PR branches
ekilmer Feb 25, 2022
9ffbecf
Add version
ekilmer Feb 25, 2022
465753e
Update LIEF to latest master
ekilmer Mar 2, 2022
a2352a4
Add version
ekilmer Mar 2, 2022
205e031
Merge branch 'master' into more-lief
ekilmer Mar 2, 2022
0ec03e2
Tagged Release candidate 0.12.0-rc.1
ekilmer Mar 14, 2022
edcc2c6
Update version
ekilmer Mar 14, 2022
cc8c5a7
Merge branch 'master' into more-lief
ekilmer Mar 14, 2022
1dc3237
Update patch for installation path of Windows DLL
ekilmer Mar 14, 2022
6953c65
Update version
ekilmer Mar 14, 2022
558f302
Merge branch 'master' into more-lief
ekilmer Mar 26, 2022
713dfe2
Update to official 0.12.0 release
ekilmer Mar 26, 2022
dcf8bb4
Update version
ekilmer Mar 26, 2022
27ec728
Merge branch 'master' into more-lief
ekilmer Apr 12, 2022
97e461c
Update to LIEF 0.12.1
ekilmer Apr 12, 2022
a3767d3
Update version
ekilmer Apr 12, 2022
579845c
Fix frozen feature
ekilmer Apr 12, 2022
9c49449
Update version
ekilmer Apr 12, 2022
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
45 changes: 45 additions & 0 deletions ports/lief/0001-Support-vcpkg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 426d8167648fff0ad79832a701223b8171dad096 Mon Sep 17 00:00:00 2001
From: Eric Kilmer <[email protected]>
Date: Tue, 12 Apr 2022 10:42:27 -0400
Subject: [PATCH] Support vcpkg

Remove msvccrt choosing and fix install paths on Windows
---
CMakeLists.txt | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b89d0522..9ca50c35 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,9 +11,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_CROSSCOMPILING)
endif()


-if(WIN32 OR ${IS_WIN_CROSS_COMPILE})
- include(ChooseMSVCCRT)
-endif()
include(CheckCXXCompilerFlag)
include(CheckCCompilerFlag)
include(ExternalProject)
@@ -667,7 +664,7 @@ endif()
# Installation
# ======================

-if(UNIX)
+if(1)
include(GNUInstallDirs)
set(CMAKE_INSTALL_LIBDIR "lib")
else()
@@ -688,7 +685,7 @@ install(
EXPORT LIEFExport
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libraries
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(
--
2.35.1

87 changes: 87 additions & 0 deletions ports/lief/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lief-project/LIEF
REF 0.12.1
SHA512 833a04ece5ff7365717aee3408a2d522756319e43cf4ff795047021c46b48d5d525c2a56cdafd04259ddfcf6888972d19655924f999460ce05f52a32ac7e8bca
HEAD_REF master
PATCHES
0001-Support-vcpkg.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"tests" LIEF_TESTS # Enable tests
"c-api" LIEF_C_API # C API
"examples" LIEF_EXAMPLES # Build LIEF C++ examples
"force32" LIEF_FORCE32 # Force build LIEF 32 bits version
"coverage" LIEF_COVERAGE # Perform code coverage
"use-ccache" LIEF_USE_CCACHE # Use ccache to speed up compilation
"extra-warnings" LIEF_EXTRA_WARNINGS # Enable extra warning from the compiler
"logging" LIEF_LOGGING # Enable logging
"logging-debug" LIEF_LOGGING_DEBUG # Enable debug logging
"enable-json" LIEF_ENABLE_JSON # Enable JSON-related APIs

"elf" LIEF_ELF # Build LIEF with ELF module
"pe" LIEF_PE # Build LIEF with PE module
"macho" LIEF_MACHO # Build LIEF with MachO module

"oat" LIEF_OAT # Build LIEF with OAT module
"dex" LIEF_DEX # Build LIEF with DEX module
"vdex" LIEF_VDEX # Build LIEF with VDEX module
"art" LIEF_ART # Build LIEF with ART module

# Sanitizer
"asan" LIEF_ASAN # Enable Address sanitizer
"lsan" LIEF_LSAN # Enable Leak sanitizer
"tsan" LIEF_TSAN # Enable Thread sanitizer
"usan" LIEF_USAN # Enable undefined sanitizer

# Fuzzer
"fuzzing" LIEF_FUZZING # Fuzz LIEF

# Profiling
"profiling" LIEF_PROFILING # Enable performance profiling

INVERTED_FEATURES
"enable-frozen" LIEF_DISABLE_FROZEN # Disable Frozen even if it is supported
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"

OPTIONS
${FEATURE_OPTIONS}

-DLIEF_PYTHON_API=OFF
-DLIEF_USE_CCACHE=OFF

# Build with external vcpkg dependencies
-DLIEF_OPT_MBEDTLS_EXTERNAL=ON
-DLIEF_OPT_UTFCPP_EXTERNAL=ON
-DLIEF_EXTERNAL_SPDLOG=ON
-DLIEF_OPT_NLOHMANN_JSON_EXTERNAL=ON
-DLIEF_OPT_FROZEN_EXTERNAL=ON
-DLIEF_OPT_EXTERNAL_LEAF=ON
"-DLIEF_EXTERNAL_LEAF_DIR=${CURRENT_INSTALLED_DIR}/include"
-DLIEF_OPT_EXTERNAL_SPAN=ON
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(CONFIG_PATH share/LIEF/cmake)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# Check if all-caps directory is empty (it won't be on case-insensitive filesystems).
# These files could have been moved during vcpkg_cmake_config_fixup
file(GLOB dir_files "${CURRENT_PACKAGES_DIR}/share/LIEF/*")
list(LENGTH dir_files dir_files_len)
if(dir_files_len EQUAL 0)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/LIEF")
endif()

# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
116 changes: 116 additions & 0 deletions ports/lief/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"name": "lief",
"version-semver": "0.12.1",
"description": "LIEF - Library to Instrument Executable Formats",
"homepage": "https://lief.quarkslab.com",
"license": "Apache-2.0",
"supports": "!uwp",
"dependencies": [
"boost-leaf",
"mbedtls",
"spdlog",
"tcb-span",
"utfcpp",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"art",
"c-api",
"dex",
"elf",
"enable-frozen",
"enable-json",
"logging",
"macho",
"oat",
"pe",
"vdex"
],
"features": {
"art": {
"description": "Build LIEF with ART module"
},
"asan": {
"description": "Enable Address sanitizer"
},
"c-api": {
"description": "C API"
},
"coverage": {
"description": "Perform code coverage"
},
"dex": {
"description": "Build LIEF with DEX module"
},
"elf": {
"description": "Build LIEF with ELF module"
},
"enable-frozen": {
"description": "Enable Frozen",
"dependencies": [
"frozen"
]
},
"enable-json": {
"description": "Enable JSON-related APIs",
"dependencies": [
"nlohmann-json"
]
},
"examples": {
"description": "Build LIEF C++ examples"
},
"extra-warnings": {
"description": "Enable extra warning from the compiler"
},
"force32": {
"description": "Force build LIEF 32 bits version"
},
"fuzzing": {
"description": "Fuzz LIEF"
},
"logging": {
"description": "Enable logging"
},
"logging-debug": {
"description": "Enable debug logging"
},
"lsan": {
"description": "Enable Leak sanitizer"
},
"macho": {
"description": "Build LIEF with MachO module"
},
"oat": {
"description": "Build LIEF with OAT module"
},
"pe": {
"description": "Build LIEF with PE module"
},
"profiling": {
"description": "Enable performance profiling"
},
"tests": {
"description": "Enable tests"
},
"tsan": {
"description": "Enable Thread sanitizer"
},
"usan": {
"description": "Enable undefined sanitizer"
},
"use-ccache": {
"description": "Use ccache to speed up compilation"
},
"vdex": {
"description": "Build LIEF with VDEX module"
}
}
}
80 changes: 36 additions & 44 deletions ports/mbedtls/enable-pthread.patch
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8833246..f68ab02 100644
index 6debe35..64e0674 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,7 @@ set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})

option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)
@@ -51,6 +51,7 @@ if(WIN32)
else()
option(GEN_FILES "Generate the auto-generated files as needed" ON)
endif()
+option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF)

option(ENABLE_PROGRAMS "Build mbed TLS programs." ON)

@@ -231,6 +232,8 @@ else()
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
string(REGEX MATCH "GNU" CMAKE_COMPILER_IS_GNU "${CMAKE_C_COMPILER_ID}")
@@ -243,12 +244,26 @@ else()
set(LIB_INSTALL_DIR lib)
endif()

+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
+#include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
+
if(ENABLE_ZLIB_SUPPORT)
find_package(ZLIB)
add_subdirectory(include)

@@ -239,6 +242,17 @@ if(ENABLE_ZLIB_SUPPORT)
endif(ZLIB_FOUND)
endif(ENABLE_ZLIB_SUPPORT)
add_subdirectory(3rdparty)

add_subdirectory(library)

+if(ENABLE_PTHREAD)
+ if(WIN32)
Expand All @@ -34,61 +33,54 @@ index 8833246..f68ab02 100644
+ set(LINK_WITH_PTHREAD ON)
+endif()
+
add_subdirectory(include)

add_subdirectory(3rdparty)
+
#
# The C files in tests/src directory contain test code shared among test suites
# and programs. This shared test code is compiled and linked to test suites and
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 62c0f62..7923202 100644
index e693bc1..7f5216a 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,10 +1,14 @@
@@ -1,9 +1,13 @@
option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)

+configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h)
+#configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h)
+
if(INSTALL_MBEDTLS_HEADERS)

file(GLOB headers "mbedtls/*.h")
file(GLOB psa_headers "psa/*.h")
-
+
+ set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h)
+
+ #set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h)

install(FILES ${headers}
DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index 1e6e052..51c20da 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -24,6 +24,8 @@
diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h
index 0558ee0..d2fd425 100644
--- a/include/mbedtls/mbedtls_config.h
+++ b/include/mbedtls/mbedtls_config.h
@@ -24,6 +24,15 @@
* limitations under the License.
*/

+#include "mbedtls/config_threading.h"
+
#ifndef MBEDTLS_CONFIG_H
#define MBEDTLS_CONFIG_H

diff --git a/include/mbedtls/config_threading.h.in b/include/mbedtls/config_threading.h.in
new file mode 100644
index 0000000..9d5d42e
--- /dev/null
+++ b/include/mbedtls/config_threading.h.in
@@ -0,0 +1,6 @@
+#cmakedefine ENABLE_PTHREAD
+
+
+
+#ifdef ENABLE_PTHREAD
+#define MBEDTLS_THREADING_C
+#define MBEDTLS_THREADING_PTHREAD
+#endif
\ No newline at end of file
+
/**
* This is an optional version symbol that enables comatibility handling of
* config files.
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 33e2cfc..4b99331 100644
index 07599f5..27e426d 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -137,7 +137,11 @@ if(ENABLE_ZLIB_SUPPORT)
endif(ENABLE_ZLIB_SUPPORT)
@@ -189,7 +189,11 @@ if(HAIKU)
endif(HAIKU)

if(LINK_WITH_PTHREAD)
- set(libs ${libs} pthread)
Expand Down
Loading