Skip to content

Commit

Permalink
Updating libffi to 3.4.4, and adding ARM Windows dispatching
Browse files Browse the repository at this point in the history
  • Loading branch information
ktakashi committed Nov 27, 2023
1 parent c08e6b6 commit bd03e1f
Show file tree
Hide file tree
Showing 130 changed files with 23,880 additions and 15,936 deletions.
4 changes: 2 additions & 2 deletions ext/ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ ELSEIF(WATCOM)
ELSE()
MESSAGE(STATUS "Sagittarius uses bundled libffi")
SET(HAVE_FFI_PREP_CIF_VAR TRUE)
ADD_SUBDIRECTORY(libffi-3.0.13 libffi)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libffi-3.0.13/include)
ADD_SUBDIRECTORY(libffi libffi)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libffi/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/libffi)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/libffi/include)
# since 3.0.13 it's doing proper __declspec for MCVC for DLL
Expand Down
15 changes: 15 additions & 0 deletions ext/ffi/libffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ elseif (${arch} STREQUAL "x86_64")
else ()
set(TARGET "X86_64")
endif()
elseif (${arch} STREQUAL "arm64")
set(TARGETDIR "arm64")
if (APPLE)
set(TARGET "ARM64_DARWIN")
elseif (CYGWIN OR WIN32)
set(TARGET "ARM64_WIN64")
else ()
set(TARGET "ARM64_64")
endif()
endif()

if (${TARGET} STREQUAL "X86_DARWIN")
Expand Down Expand Up @@ -185,6 +194,12 @@ else ()
set(libffi_platform_asm src/x86/unix64.S src/x86/sysv.S)
file(COPY src/x86/ffitarget.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include)
elseif (${TARGET} STREQUAL "ARM64_WIN64")
set(libffi_platform_source src/aarch64/ffi.c)
set(libffi_platform_asm src/aarch64/sysv.S)
set(libffi_platform_asm src/aarch64/win64_armasm.S)
file(COPY src/aarch64/ffitarget.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include)
else()
set(libffi_platform_source src/x86/ffi.c)
set(libffi_platform_asm src/x86/sysv.S)
Expand Down
Loading

0 comments on commit bd03e1f

Please sign in to comment.