Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
607 changes: 607 additions & 0 deletions deps/libffi/ChangeLog

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions deps/libffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,28 @@ History

See the git log for details at http://github.com/libffi/libffi.

3.8.0 August-8-2026
Add FFI_TYPE_VECTOR (SIMD) type support with libffi-computed
layout, for aarch64 and x86-64 (#1000, closes #773).
Add ffi_call_plan_size to report the total memory a reusable call
plan owns, for embedders that account for the memory held by
long-lived plans.
Add powerpc64 ELFv2 _Complex long double support for both
IBM-128 (double-double) and IEEE-128 formats (#1003, closes #1001).
Fix powerpc64 big-endian ELFv2 closures returning 5-, 6-, or
7-byte structs: missing return jump-table entries produced a
wrong result and leaked a libffi code pointer.
Fix ia64 return-value jump-table desync after the FFI_TYPE_LAST
bump, which corrupted small-struct and HFA returns.
Fix powerpc Darwin closure returns broken by #951 (#1002).
Return small (1, 2, 4 or 8 byte) structs in registers on the i386
FreeBSD and OpenBSD targets, matching the platform ABI and
fixing a segfault on struct returns through ffi_call and closures.
Cache the static trampoline "unsupported" result on hosts whose
page size exceeds the trampoline table mapping, avoiding
redundant re-initialization on every closure allocation
(e.g. 64K-page aarch64).

3.7.1 July-10-2026
Fix aarch64 ffi_call memory corruption when passing many large
structs by value.
Expand Down
28 changes: 14 additions & 14 deletions deps/libffi/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for libffi 3.7.1.
# Generated by GNU Autoconf 2.71 for libffi 3.8.0.
#
# Report bugs to <http://github.com/libffi/libffi/issues>.
#
Expand Down Expand Up @@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libffi'
PACKAGE_TARNAME='libffi'
PACKAGE_VERSION='3.7.1'
PACKAGE_STRING='libffi 3.7.1'
PACKAGE_VERSION='3.8.0'
PACKAGE_STRING='libffi 3.8.0'
PACKAGE_BUGREPORT='http://github.com/libffi/libffi/issues'
PACKAGE_URL=''

Expand Down Expand Up @@ -1417,7 +1417,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libffi 3.7.1 to adapt to many kinds of systems.
\`configure' configures libffi 3.8.0 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1489,7 +1489,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libffi 3.7.1:";;
short | recursive ) echo "Configuration of libffi 3.8.0:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1628,7 +1628,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libffi configure 3.7.1
libffi configure 3.8.0
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2259,7 +2259,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by libffi $as_me 3.7.1, which was
It was created by libffi $as_me 3.8.0, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3233,10 +3233,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers fficonfig.h"


FFI_VERSION_STRING="3.7.1"
ffi_version_major=`echo "3.7.1" | cut -d. -f1`
ffi_version_minor=`echo "3.7.1" | cut -d. -f2 | sed 's/[^0-9].*//'`
ffi_version_micro=`echo "3.7.1" | cut -d. -f3 | sed 's/[^0-9].*//'`
FFI_VERSION_STRING="3.8.0"
ffi_version_major=`echo "3.8.0" | cut -d. -f1`
ffi_version_minor=`echo "3.8.0" | cut -d. -f2 | sed 's/[^0-9].*//'`
ffi_version_micro=`echo "3.8.0" | cut -d. -f3 | sed 's/[^0-9].*//'`
FFI_VERSION_NUMBER=`expr ${ffi_version_major:-0} \* 10000 + ${ffi_version_minor:-0} \* 100 + ${ffi_version_micro:-0}`


Expand Down Expand Up @@ -3986,7 +3986,7 @@ fi

# Define the identity of the package.
PACKAGE='libffi'
VERSION='3.7.1'
VERSION='3.8.0'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -20661,7 +20661,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libffi $as_me 3.7.1, which was
This file was extended by libffi $as_me 3.8.0, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -20729,7 +20729,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
libffi config.status 3.7.1
libffi config.status 3.8.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion deps/libffi/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl Process this with autoconf to create configure

AC_PREREQ([2.68])

AC_INIT([libffi],[3.7.1],[http://github.com/libffi/libffi/issues])
AC_INIT([libffi],[3.8.0],[http://github.com/libffi/libffi/issues])
AC_CONFIG_HEADERS([fficonfig.h])

dnl Derive the version macros from AC_INIT so they cannot drift when the
Expand Down
132 changes: 116 additions & 16 deletions deps/libffi/doc/libffi.info
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ File: libffi.info, Node: Types, Next: Multiple ABIs, Prev: Simple Example, U
* Type Example:: Structure type example.
* Complex:: Complex types.
* Complex Type Example:: Complex type example.
* Vector Types:: Vector (SIMD) types.


File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types
Expand Down Expand Up @@ -660,7 +661,7 @@ functions ‘ffi_prep_cif’ and ‘ffi_prep_args’ abort the program if they
encounter a complex type.


File: libffi.info, Node: Complex Type Example, Prev: Complex, Up: Types
File: libffi.info, Node: Complex Type Example, Next: Vector Types, Prev: Complex, Up: Types

2.3.7 Complex Type Example
--------------------------
Expand Down Expand Up @@ -746,6 +747,92 @@ compilers that support them:
The new type descriptors can then be used like one of the built-in
type descriptors in the previous example.


File: libffi.info, Node: Vector Types, Prev: Complex Type Example, Up: Types

2.3.8 Vector Types
------------------

‘libffi’ can marshal vector (SIMD) types -- the values produced by GCC's
‘__attribute__((vector_size (N)))’ and Clang's ‘ext_vector_type’ -- on
the platforms listed in the support table below. A vector is described
just like a structure, except that every element pointer refers to the
_same_ fundamental scalar type and the number of elements is the number
of vector lanes.

-- Data type: ffi_type
‘size_t size’
This must be set to ‘0’. ‘libffi’ computes the storage size
(see below) from the element type and lane count.

‘unsigned short alignment’
This must be set to ‘0’. ‘libffi’ computes the alignment.

‘unsigned short type’
For a vector type, this must be set to ‘FFI_TYPE_VECTOR’.

‘ffi_type **elements’
This is a ‘NULL’-terminated array of pointers to ‘ffi_type’
objects. Every entry must point to the same scalar element
type, and the number of entries is the vector's lane count N
(N >= 1). The element type must be one of ‘ffi_type_float’,
‘ffi_type_double’, or a fixed-width integer (‘ffi_type_uint8’
through ‘ffi_type_sint64’); ‘long double’ and aggregate
element types are not permitted.

Computed layout
...............

Because the caller leaves ‘size’ and ‘alignment’ at ‘0’, ‘libffi’
derives them so that applications need not encode compiler- or
platform-specific rules:

• ‘size’ is lane\_size \times N rounded _up_ to the next power of
two. This matches Clang's ‘ext_vector_type’ storage -- for example
a three-lane ‘float’ vector occupies 16 bytes and a three-lane
‘double’ vector occupies 32 bytes. GCC's ‘vector_size’ already
requires power-of-two byte totals, so the rule is identical there.

• ‘alignment’ is ‘min(size, 16)’.

If the element list is heterogeneous, empty, or uses a disallowed
element type, ‘ffi_prep_cif’ returns ‘FFI_BAD_TYPEDEF’.

psABI framing
.............

At the call boundary the platform's processor-specific ABI (AAPCS64 on
AArch64, the System V x86-64 psABI on x86-64) decides how a vector is
passed and returned, independently of which compiler produced it. The
historical divergence between GCC's ‘vector_size’ and Clang's
‘ext_vector_type’ concerns only in-memory _layout_ (notably the padding
of odd-lane vectors such as ‘float3’); the power-of-two size rule above
pins that layout down, so a value marshalled by ‘libffi’ matches what a
natively compiled caller or callee expects.

Per-port support
................

Port Vector support
--------------------------------------------------------------------------
AArch64 (AAPCS64) 8- and 16-byte vectors in a single V/Q register;
homogeneous vector aggregates (structs of up to
four identical 8- or 16-byte vectors) in
consecutive V/Q registers. A bare vector larger
than 16 bytes (for example a 32-byte ‘double4’)
has no short-vector register class and is passed
and returned in memory, exactly as AAPCS64 and
current compilers do.
x86-64 (System V 8- and 16-byte vectors in an SSE register (‘%xmm0’
psABI) for returns). A bare vector larger than 16 bytes
needs ‘%ymm’/‘%zmm’ register handling that this
port does not yet implement, so ‘ffi_prep_cif’
returns ‘FFI_BAD_TYPEDEF’ for it.
Other ports Not supported: ‘ffi_prep_cif’ returns
‘FFI_BAD_TYPEDEF’ for any signature that mentions
a vector type, including one nested inside a
struct.


File: libffi.info, Node: Multiple ABIs, Next: Reusable Call Plans, Prev: Types, Up: Using libffi

Expand Down Expand Up @@ -795,6 +882,14 @@ prepared ‘ffi_cif’.
is harmless. The ‘ffi_cif’ the plan was built from is not
affected.

-- Function: size_t ffi_call_plan_size (ffi_call_plan *PLAN)
Returns the total number of bytes ‘libffi’ allocated for PLAN,
including any internal argument-placement data it owns. Returns
zero when PLAN is ‘NULL’. The result does not include the
‘ffi_cif’, which the caller owns. This is intended for embedders
that account for the memory held by long-lived plans and would
otherwise have to guess at the size of an opaque type.


File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Reusable Call Plans, Up: Using libffi

Expand Down Expand Up @@ -1056,6 +1151,7 @@ Index
* ffi_call_plan_alloc: Reusable Call Plans. (line 12)
* ffi_call_plan_free: Reusable Call Plans. (line 32)
* ffi_call_plan_invoke: Reusable Call Plans. (line 22)
* ffi_call_plan_size: Reusable Call Plans. (line 37)
* ffi_closure_alloc: The Closure API. (line 19)
* ffi_closure_free: The Closure API. (line 26)
* FFI_CLOSURES: The Closure API. (line 13)
Expand All @@ -1075,6 +1171,8 @@ Index
* ffi_type <1>: Structures. (line 10)
* ffi_type <2>: Complex. (line 15)
* ffi_type <3>: Complex. (line 15)
* ffi_type <4>: Vector Types. (line 13)
* ffi_type <5>: Vector Types. (line 13)
* ffi_type_complex_double: Primitive Types. (line 82)
* ffi_type_complex_float: Primitive Types. (line 79)
* ffi_type_complex_longdouble: Primitive Types. (line 85)
Expand All @@ -1101,6 +1199,7 @@ Index
* ffi_type_void: Primitive Types. (line 10)
* Foreign Function Interface: Introduction. (line 31)
* size_t: The Basics. (line 125)
* size_t <1>: Reusable Call Plans. (line 37)
* unsigned int: The Basics. (line 122)
* unsigned long: The Basics. (line 117)
* void: The Basics. (line 72)
Expand All @@ -1118,21 +1217,22 @@ Node: Using libffi4569
Node: The Basics5172
Node: Simple Example11346
Node: Types12403
Node: Primitive Types12914
Node: Structures15231
Node: Size and Alignment16342
Node: Arrays Unions Enums18613
Node: Type Example21590
Node: Complex22896
Node: Complex Type Example24410
Node: Multiple ABIs27462
Node: Reusable Call Plans27849
Node: The Closure API29566
Node: Closure Example33908
Node: Thread Safety35552
Node: Memory Usage36385
Node: Missing Features37660
Node: Index38037
Node: Primitive Types12967
Node: Structures15284
Node: Size and Alignment16395
Node: Arrays Unions Enums18666
Node: Type Example21643
Node: Complex22949
Node: Complex Type Example24463
Node: Vector Types27536
Node: Multiple ABIs31575
Node: Reusable Call Plans31962
Node: The Closure API34155
Node: Closure Example38497
Node: Thread Safety40141
Node: Memory Usage40974
Node: Missing Features42249
Node: Index42626

End Tag Table

Expand Down
Binary file modified deps/libffi/doc/libffi.pdf
Binary file not shown.
Loading
Loading