aboutsummaryrefslogtreecommitdiff
path: root/ports/libffi
diff options
context:
space:
mode:
authordriver1998 <driver1998@foxmail.com>2020-02-08 01:36:39 +0800
committerGitHub <noreply@github.com>2020-02-07 09:36:39 -0800
commit7d4227f02e445b0a29f8c1ce3258b57d60b71cfe (patch)
tree179fcf840bb32edda864d6ec80a5866f56359d3a /ports/libffi
parent8eaa597bba70728c70feb4674566abcbe6feeb5c (diff)
downloadvcpkg-7d4227f02e445b0a29f8c1ce3258b57d60b71cfe.tar.gz
vcpkg-7d4227f02e445b0a29f8c1ce3258b57d60b71cfe.zip
[libffi] Update to v3.3 release (#6119)
* libffi 3.3-rc0 custom port, with arm/arm64 windows support * fix linux build * enable EFI64 in linux x64, should fix build errors in some cases * libffi: move to the arm64 support pr branch * libffi: move to latest upstream master * libffi: update to upstream master * libffi: update to v3.3-rc2 * libffi: update to v3.3 release * libffi: update version in fficonfig.h * libffi: Remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS * [libffi] update portfile.cmake * [libnice] fix Windows ARM64 build * CI: set atk:arm64-windows to fail atk compilation requires running glib(arm64) tools, which is not possible on a x86 system. * CI: libffi:arm64-windows passing * [gdk-pixbuf] fix Windows ARM64 build * [pangomm] show unsupported architecture error on ARM * [pangomm] update portfile.cmake * [libffi] Avoid depending on VCPKG_TARGET_TRIPLET; use native cmake variables instead. Avoid double expansion inside if(). * [libffi] TARGET is a keyword for if() -- use quoted expansion instead. Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'ports/libffi')
-rw-r--r--ports/libffi/CMakeLists.txt98
-rw-r--r--ports/libffi/CONTROL2
-rw-r--r--ports/libffi/auto-define-static-macro.patch14
-rw-r--r--ports/libffi/export-global-data.patch35
-rw-r--r--ports/libffi/fficonfig.h8
-rw-r--r--ports/libffi/portfile.cmake24
6 files changed, 83 insertions, 98 deletions
diff --git a/ports/libffi/CMakeLists.txt b/ports/libffi/CMakeLists.txt
index b645de313..cbaa70b05 100644
--- a/ports/libffi/CMakeLists.txt
+++ b/ports/libffi/CMakeLists.txt
@@ -9,7 +9,7 @@ if(NOT CMAKE_SYSTEM_PROCESSOR)
endif()
# config variables for ffi.h.in
-set(VERSION 3.1)
+set(VERSION 3.3)
set(KNOWN_PROCESSORS x86 x86_64 AMD64 ARM ARM64 i386)
@@ -21,11 +21,15 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM")
set(TARGET ARM)
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(TARGET X86_FREEBSD)
+elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM")
+ set(TARGET ARM_WIN32)
+elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
+ set(TARGET ARM_WIN64)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(TARGET X86_WIN32)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set(TARGET X86_WIN64)
-elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(TARGET X86_DARWIN)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(TARGET X86_64)
@@ -35,43 +39,85 @@ else()
message(FATAL_ERROR "Cannot determine target. Please consult ${CMAKE_CURRENT_SOURCE_DIR}/configure.ac and add your platform to this CMake file.")
endif()
-set(HAVE_LONG_DOUBLE 0)
-set(HAVE_LONG_DOUBLE_VARIANT 0)
+if("${TARGET}" STREQUAL "X86_64")
+ set(HAVE_LONG_DOUBLE 1)
+else()
+ set(HAVE_LONG_DOUBLE 0)
+endif()
set(FFI_EXEC_TRAMPOLINE_TABLE 0)
# mimic layout of original buildsystem
configure_file(include/ffi.h.in ${CMAKE_BINARY_DIR}/include/ffi.h)
file(COPY ${FFI_CONFIG_FILE} DESTINATION ${CMAKE_BINARY_DIR})
-file(COPY src/x86/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
+
+if ("${TARGET}" STREQUAL "ARM_WIN64")
+ file(COPY src/aarch64/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
+elseif ("${TARGET}" STREQUAL "ARM_WIN32")
+ file(COPY src/arm/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
+else()
+ file(COPY src/x86/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
+endif()
include_directories(${CMAKE_BINARY_DIR}/include)
include_directories(${CMAKE_BINARY_DIR})
include_directories(include)
-add_definitions(-DHAVE_CONFIG_H)
add_definitions(-DFFI_BUILDING)
+if(BUILD_SHARED_LIBS AND WIN32)
+ add_definitions(-DFFI_BUILDING_DLL)
+endif()
set(FFI_SOURCES
- src/x86/ffi.c
src/closures.c
- src/java_raw_api.c
src/prep_cif.c
- src/raw_api.c
src/types.c)
+if ("${TARGET}" STREQUAL "ARM_WIN64")
+ set(FFI_SOURCES
+ ${FFI_SOURCES}
+ src/aarch64/ffi.c)
+elseif("${TARGET}" STREQUAL "ARM_WIN32")
+ set(FFI_SOURCES
+ ${FFI_SOURCES}
+ src/arm/ffi.c)
+else()
+ set(FFI_SOURCES
+ ${FFI_SOURCES}
+ src/java_raw_api.c
+ src/raw_api.c)
+ if("${TARGET}" STREQUAL "X86_WIN32" OR "${TARGET}" STREQUAL "X86_DARWIN" OR "${TARGET}" STREQUAL "X86")
+ set(FFI_SOURCES
+ ${FFI_SOURCES}
+ src/x86/ffi.c)
+ elseif("${TARGET}" STREQUAL "X86_WIN64")
+ set(FFI_SOURCES
+ ${FFI_SOURCES}
+ src/x86/ffiw64.c)
+ elseif("${TARGET}" STREQUAL "X86_64")
+ set(FFI_SOURCES
+ ${FFI_SOURCES}
+ src/x86/ffi64.c
+ src/x86/ffiw64.c)
+ endif()
+endif()
+
macro(add_assembly ASMFILE)
get_filename_component(ASMFILE_FULL "${ASMFILE}" ABSOLUTE)
if(MSVC)
- if(CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(ARCH_ASSEMBLER ml /safeseh)
+ if ("${TARGET}" STREQUAL "ARM_WIN64")
+ set(ARCH_ASSEMBLER armasm64)
+ elseif ("${TARGET}" STREQUAL "ARM_WIN32")
+ set(ARCH_ASSEMBLER armasm)
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(ARCH_ASSEMBLER ml /safeseh /c /Zi)
else()
- set(ARCH_ASSEMBLER ml64)
+ set(ARCH_ASSEMBLER ml64 /c /Zi)
endif()
get_filename_component(ARCH_ASM_NAME "${ASMFILE_FULL}" NAME_WE)
execute_process(
- COMMAND ${CMAKE_C_COMPILER} /nologo /EP /I. /Iinclude ${ASMFILE_FULL}
+ COMMAND ${CMAKE_C_COMPILER} /nologo /EP /I. /Iinclude /I${CMAKE_CURRENT_SOURCE_DIR}/include "${ASMFILE_FULL}"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_FILE ${ARCH_ASM_NAME}.asm
)
@@ -81,7 +127,7 @@ macro(add_assembly ASMFILE)
# (even though it didn't report any errors and correctly generated object file)
# which in turn causes MSBUILD to stop.
execute_process(
- COMMAND ${ARCH_ASSEMBLER} /c /Zi ${ARCH_ASM_NAME}.asm
+ COMMAND ${ARCH_ASSEMBLER} ${ARCH_ASM_NAME}.asm
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
@@ -91,25 +137,23 @@ macro(add_assembly ASMFILE)
endif()
endmacro()
-if(${TARGET} STREQUAL "X86")
+if("${TARGET}" STREQUAL "X86")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -m32")
endif()
-if(${TARGET} STREQUAL "X86")
+if("${TARGET}" STREQUAL "X86" OR "${TARGET}" STREQUAL "X86_DARWIN")
add_assembly(src/x86/sysv.S)
- add_assembly(src/x86/win32.S)
-elseif(${TARGET} STREQUAL "X86_64")
- list(APPEND FFI_SOURCES src/x86/ffi64.c)
+elseif("${TARGET}" STREQUAL "X86_64")
add_assembly(src/x86/unix64.S)
- add_assembly(src/x86/sysv.S)
-elseif(${TARGET} STREQUAL "X86_WIN32")
- add_assembly(src/x86/win32.S)
-elseif(${TARGET} STREQUAL "X86_WIN64")
add_assembly(src/x86/win64.S)
-elseif(${TARGET} STREQUAL "X86_DARWIN")
- list(APPEND FFI_SOURCES src/x86/ffi64.c)
- add_assembly(src/x86/darwin.S)
- add_assembly(src/x86/darwin64.S)
+elseif("${TARGET}" STREQUAL "X86_WIN32")
+ add_assembly(src/x86/sysv_intel.S)
+elseif("${TARGET}" STREQUAL "X86_WIN64")
+ add_assembly(src/x86/win64_intel.S)
+elseif("${TARGET}" STREQUAL "ARM_WIN32")
+ add_assembly(src/arm/sysv_msvc_arm32.S)
+elseif("${TARGET}" STREQUAL "ARM_WIN64")
+ add_assembly(src/aarch64/win64_armasm.S)
else()
message(FATAL_ERROR "Target not implemented")
endif()
diff --git a/ports/libffi/CONTROL b/ports/libffi/CONTROL
index 2bc4a093a..50b50a7c9 100644
--- a/ports/libffi/CONTROL
+++ b/ports/libffi/CONTROL
@@ -1,5 +1,5 @@
Source: libffi
-Version: 3.1-7
+Version: 3.3
Homepage: https://github.com/libffi/libffi
Description: Portable, high level programming interface to various calling conventions
Supports: !arm \ No newline at end of file
diff --git a/ports/libffi/auto-define-static-macro.patch b/ports/libffi/auto-define-static-macro.patch
deleted file mode 100644
index 468a2fc36..000000000
--- a/ports/libffi/auto-define-static-macro.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/ffi.h b/ffi.h
-index 8d5eac2..0b0c2f6 100644
---- a/ffi.h
-+++ b/ffi.h
-@@ -174,6 +174,9 @@ typedef struct _ffi_type
- /* of the library, but don't worry about that. Besides, */
- /* as a workaround, they can define FFI_BUILDING if they */
- /* *know* they are going to link with the static library. */
-+
-+#define FFI_BUILDING
-+
- #if defined _MSC_VER && !defined FFI_BUILDING
- #define FFI_EXTERN extern __declspec(dllimport)
- #else
diff --git a/ports/libffi/export-global-data.patch b/ports/libffi/export-global-data.patch
deleted file mode 100644
index 9d965f647..000000000
--- a/ports/libffi/export-global-data.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/types.c b/src/types.c
-index 0de5994..46c8d18 100644
---- a/src/types.c
-+++ b/src/types.c
-@@ -31,6 +31,12 @@
- #include <ffi.h>
- #include <ffi_common.h>
-
-+#ifdef FFI_EXPORT_DATA
-+#define FFI_EXPORT __declspec(dllexport)
-+#else
-+#define FFI_EXPORT
-+#endif
-+
- /* Type definitions */
-
- #define FFI_TYPEDEF(name, type, id) \
-@@ -38,7 +44,7 @@ struct struct_align_##name { \
- char c; \
- type x; \
- }; \
--const ffi_type ffi_type_##name = { \
-+FFI_EXPORT const ffi_type ffi_type_##name = { \
- sizeof(type), \
- offsetof(struct struct_align_##name, x), \
- id, NULL \
-@@ -56,7 +62,7 @@ ffi_type ffi_type_##name = { \
- }
-
- /* Size and alignment are fake here. They must not be 0. */
--const ffi_type ffi_type_void = {
-+FFI_EXPORT const ffi_type ffi_type_void = {
- 1, 1, FFI_TYPE_VOID, NULL
- };
-
diff --git a/ports/libffi/fficonfig.h b/ports/libffi/fficonfig.h
index 044b791c1..2ed4e0199 100644
--- a/ports/libffi/fficonfig.h
+++ b/ports/libffi/fficonfig.h
@@ -23,12 +23,12 @@
#define HAVE_SYS_TYPES_H 1
#define LT_OBJDIR ".libs/"
#define PACKAGE "libffi"
-#define PACKAGE_BUGREPORT "http://github.com/atgreen/libffi/issues"
+#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues"
#define PACKAGE_NAME "libffi"
-#define PACKAGE_STRING "libffi 3.1"
+#define PACKAGE_STRING "libffi 3.3"
#define PACKAGE_TARNAME "libffi"
#define PACKAGE_URL ""
-#define PACKAGE_VERSION "3.1"
+#define PACKAGE_VERSION "3.3"
#define SIZEOF_DOUBLE 8
#define SIZEOF_LONG_DOUBLE 8
#ifndef _WIN64
@@ -42,7 +42,7 @@
#define SYMBOL_UNDERSCORE 1
#endif
#endif
-#define VERSION "3.1"
+#define VERSION "3.3"
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
diff --git a/ports/libffi/portfile.cmake b/ports/libffi/portfile.cmake
index f023521c8..b6549022c 100644
--- a/ports/libffi/portfile.cmake
+++ b/ports/libffi/portfile.cmake
@@ -1,19 +1,9 @@
-include(vcpkg_common_functions)
-
-if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86 AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
- message(FATAL_ERROR "Architecture not supported")
-endif()
-
-vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
-
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libffi/libffi
- REF v3.1
- SHA512 b214e4a876995f44e0a93bad5bf1b3501ea1fbedafbf33ea600007bd08c9bc965a1f0dd90ea870281c3add6c051febd19aa6cdce36f3ee8ba535ba2c0703153c
+ REF v3.3
+ SHA512 62798fb31ba65fa2a0e1f71dd3daca30edcf745dc562c6f8e7126e54db92572cc63f5aa36d927dd08375bb6f38a2380ebe6c5735f35990681878fc78fc9dbc83
HEAD_REF master
- PATCHES
- export-global-data.patch
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
@@ -32,14 +22,14 @@ vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets()
+if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(READ ${CURRENT_PACKAGES_DIR}/include/ffi.h FFI_H)
-string(REPLACE "/* *know* they are going to link with the static library. */"
-"/* *know* they are going to link with the static library. */
+string(REPLACE " *know* they are going to link with the static library. */"
+" *know* they are going to link with the static library. */
#define FFI_BUILDING
-
" FFI_H "${FFI_H}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/ffi.h "${FFI_H}")
+endif()
-file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libffi)
-file(RENAME ${CURRENT_PACKAGES_DIR}/share/libffi/LICENSE ${CURRENT_PACKAGES_DIR}/share/libffi/copyright)
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)