[libffi] Update to 3.4.6, enable wasm32 (#36876)

This commit is contained in:
Kai Pastor 2024-02-27 09:37:57 +01:00 committed by GitHub
parent 1d20fa46bc
commit 77fbdaf616
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 39 deletions

View File

@ -1,28 +0,0 @@
diff --git a/include/ffi_common.h b/include/ffi_common.h
index 2bd31b0..c53a794 100644
--- a/include/ffi_common.h
+++ b/include/ffi_common.h
@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;
static trampoline. */
int ffi_tramp_is_present (void *closure) FFI_HIDDEN;
+/* Return a file descriptor of a temporary zero-sized file in a
+ writable and executable filesystem. */
+int open_temp_exec_file(void) FFI_HIDDEN;
+
/* Extended cif, used in callback from assembly routine */
typedef struct
{
diff --git a/src/tramp.c b/src/tramp.c
index b9d273a..90efb07 100644
--- a/src/tramp.c
+++ b/src/tramp.c
@@ -39,6 +39,8 @@
#ifdef __linux__
#define _GNU_SOURCE 1
#endif
+#include <ffi.h>
+#include <ffi_common.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

View File

@ -1,23 +1,22 @@
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/libffi/libffi/releases/download/v${VERSION}/libffi-${VERSION}.tar.gz"
FILENAME "libffi-${VERSION}.tar.gz"
SHA512 88680aeb0fa0dc0319e5cd2ba45b4b5a340bc9b4bcf20b1e0613b39cd898f177a3863aa94034d8e23a7f6f44d858a53dcd36d1bb8dee13b751ef814224061889
SHA512 033d2600e879b83c6bce0eb80f69c5f32aa775bf2e962c9d39fbd21226fa19d1e79173d8eaa0d0157014d54509ea73315ad86842356fc3a303c0831c94c6ab39
)
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES
dll-bindir.diff
fix_undefind_func.patch
)
vcpkg_list(SET options)
if(VCPKG_TARGET_IS_WINDOWS)
set(extra_cflags "-DFFI_BUILDING")
set(linkage_flag "-DFFI_STATIC_BUILD")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
string(APPEND extra_cflags " -DFFI_BUILDING_DLL")
set(linkage_flag "-DFFI_BUILDING_DLL")
endif()
vcpkg_list(APPEND options "CFLAGS=\${CFLAGS} ${extra_cflags}")
vcpkg_list(APPEND options "CFLAGS=\${CFLAGS} ${linkage_flag}")
endif()
set(ccas_options "")
@ -42,9 +41,14 @@ vcpkg_add_to_path("${ccas_dir}")
cmake_path(GET ccas FILENAME ccas_command)
vcpkg_list(APPEND options "CCAS=${ccas_command}${ccas_options}")
set(configure_triplets DETERMINE_BUILD_TRIPLET)
if(VCPKG_TARGET_IS_EMSCRIPTEN)
set(configure_triplets BUILD_TRIPLET "--host=wasm32-unknown-emscripten --build=\$(\$SHELL \"${SOURCE_PATH}/config.guess\")")
endif()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
DETERMINE_BUILD_TRIPLET
${configure_triplets}
USE_WRAPPERS
OPTIONS
--enable-portable-binary
@ -58,7 +62,7 @@ vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ffi.h" "!defined FFI_BUILDING" "0")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ffi.h" "defined(FFI_STATIC_BUILD)" "1")
endif()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

View File

@ -1,7 +1,6 @@
{
"name": "libffi",
"version": "3.4.4",
"port-version": 6,
"version": "3.4.6",
"description": "Portable, high level programming interface to various calling conventions",
"homepage": "https://github.com/libffi/libffi",
"license": "MIT",

View File

@ -4329,8 +4329,8 @@
"port-version": 2
},
"libffi": {
"baseline": "3.4.4",
"port-version": 6
"baseline": "3.4.6",
"port-version": 0
},
"libfido2": {
"baseline": "1.13.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0ad381012102db5da196161ba7fc0a03a4dcb982",
"version": "3.4.6",
"port-version": 0
},
{
"git-tree": "982248d325407b09d26ad0d929f67fd0b873f984",
"version": "3.4.4",