|
2835f72c
|
2025-08-22T11:24:57
|
|
arm: Fix compilation for Windows ARM targets (#936)
The .arch directive is only relevant for ELF targets, it is
unsupported for COFF and MachO targets.
Before 170bab47c90626a33cd08f2169034600cfd9589c, this was
not an issue as the directive was filtered out by the
ifndef __clang__.
|
|
170bab47
|
2025-08-21T11:36:06
|
|
Fix compilation for Cortex-A53 (#934)
When cross-compiling with clang and flags "--target=armv7-linux-gnueabihf -mcpu=cortex-a53"
compilation failed on instructions, used coprocessor.
|
|
c3a2b657
|
2025-08-21T11:34:22
|
|
Fix test compilation for some Android platforms (#935)
|
|
c9b2a8a4
|
2025-08-07T06:40:35
|
|
riscv: Add static trampoline support (#931) (#933)
Add static trampoline support to riscv32 and riscv64 Linux ABIs.
The implementation follows the s390x and powerpc implementations
which does not introduce a ffi_closure_*_alt function, but rather
jumps directly to the ffi_closure_asm function itself.
|
|
e2eda0cf
|
2025-08-02T08:56:01
|
|
feat: Update libffi version to 3.5.2 with wasm64 and DragonFly BSD support
|
|
b53b0042
|
2025-08-02T08:52:25
|
|
Fix for systems without O_CLOEXEC
|
|
20eacb22
|
2025-08-02T15:28:46
|
|
Emscripten: Add wasm64 target (#927)
* src/wasm32: Allow building with Emscripten with 64bit support
MEMORY64 enables 64bit pointers so this commit updates the accessors for the
libffi data structures accordingly.
Each JS functions in ffi.c receives pointers as BigInt (i64) values and with
casts them to Numer (i53) using bigintToI53Checked. While memory64 supports
64bit addressing, the maximum memory size is currently limited to 16GiB
[1]. Therefore, we can assume that the passed pointers are within the
Number's range.
[1] https://webassembly.github.io/memory64/js-api/#limits
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
* Add wasm64 target to the build scripts
This commit adds support for the wasm64 target via the configure
script. Emscripten supports two modes of the -sMEMORY64 flag[1] so the
script allows users specifying the value through a configuration variable.
Additionally, "src/wasm32" directory has been renamed to the more generic
"src/wasm" because it's now shared between both 32bit and 64bit builds.
[1] https://emscripten.org/docs/tools_reference/settings_reference.html#memory64
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
* GitHub Actions: Add wasm64 tests
This commit adds a test matrix for wasm32, wasm64 and wasm64 with the
-sMEMORY64=2 flag, using the latest version of Emscripten. -Wno-main is
added to suppress the following warning in unwindtest.cc and
unwindtest_ffi_call.cc.
> FAIL: libffi.closures/unwindtest_ffi_call.cc -W -Wall -O2 (test for excess errors)
> Excess errors:
> ./libffi.closures/unwindtest_ffi_call.cc:20:5: warning: 'main' should not be 'extern "C"' [-Wmain]
> 20 | int main (void)
> | ^
> 1 warning generated.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
* testsuite: Fix types of main function
test_libffi.py calls each test's main function without arguments, but some
tests define the main function with parameters. This signature mismatch
causes a runtime error with the recent version of Emscripten.
This commit resolves this issue by updating the function signatures to match
the way they are called.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
* README: Add document about WASM64
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
---------
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
|
|
b7885ace
|
2025-08-02T14:27:51
|
|
fix: enable FFI_MMAP_EXEC_WRIT for DragonFly BSD (#930)
Similar to PR #265 [1], we need to enable FFI_MMAP_EXEC_WRIT to use
explicit write+exec mapping on DragonFly BSD.
Without this fix, we were having segfaults with Meld [2]; it would crash
with SIGSEGV after 5 diff operations. The crash was caused by it
attempting to execute code from non-execute memory region. Moreover, if
we set the `machdep.pmap_nx_enable=2` tunable (i.e., strict NX mode),
Meld would crash upon the first diff operation.
Fix the `configure.ac` script to enable `FFI_MMAP_EXEC_WRIT` for
DragonFly BSD. In addition, add it to the supported platforms table.
[1] https://github.com/libffi/libffi/pull/265
[2] https://meldmerge.org/
|
|
60671187
|
2025-07-11T03:17:18
|
|
fix(tramp): ensure file descriptor is closed on exec. Thanks to Florian Weimer.
c# Please enter the commit message for your changes. Lines starting
|
|
d0f831bc
|
2025-06-21T16:05:31
|
|
feat: add QUESTION to .gail-labels
|
|
e28a0d5b
|
2025-06-10T16:17:58
|
|
ci: add fail-if-no-assets option in tarball workflow
|
|
90220e51
|
2025-06-10T16:03:47
|
|
Update version.
|
|
330467d5
|
2025-06-10T16:01:56
|
|
Move new symbols to new symbol versioning.
|
|
517310dd
|
2025-06-09T19:03:49
|
|
ci: update compiler versions in github workflow
|
|
d994395c
|
2025-06-09T18:43:40
|
|
ci: update gcc version to 15 in build process
|
|
26d7be77
|
2025-06-09T18:23:15
|
|
ci: update build.sh for Linux build process
|
|
a18d4e95
|
2025-06-09T13:35:29
|
|
feat(.github/workflows): add step to wipe old snapshot assets in tarball.yml
|
|
b9b83785
|
2025-06-09T13:29:03
|
|
fix(github-actions): correct regex in version extraction
|
|
7ac6f145
|
2025-06-09T13:08:02
|
|
ci: change packages installed during workflow
|
|
ceab352d
|
2025-06-09T13:01:50
|
|
ci: add installation of necessary tools to tarball workflow
|
|
1f73aa50
|
2025-06-09T12:56:19
|
|
refactor(.github/workflows/tarball): remove repeated job blocks
|
|
7f5375d7
|
2025-06-09T12:55:09
|
|
chore(workflows): update snapshot release description in tarball.yml
|
|
2a5195bb
|
2025-06-09T12:54:55
|
|
chore(.github/workflows): update tarball.yml indentation
|
|
2f535b8f
|
2025-06-09T12:52:43
|
|
chore(ci): update tarball workflow in GitHub Actions
|
|
172bfb41
|
2025-06-09T12:22:35
|
|
chore(.github/workflows): update tarball workflow to use softprops/action-gh-release
|
|
0947743f
|
2025-06-09T11:53:15
|
|
Make tarballs (#924)
* Create tarballs in CI
|
|
a46977da
|
2025-06-09T15:55:02
|
|
Downgrade Autoconf requirement to version 2.68 (#922)
* Downgrade Autoconf requirement to version 2.68
* CI: remove redundant Autoconf install scripts
|
|
40a76827
|
2025-06-09T09:49:00
|
|
Improve CI test coverage (#923)
Add CI testing on Windows with both gcc and clang.
|
|
64a42f61
|
2025-06-08T16:59:58
|
|
More CI testing (#921)
* ci: add new build configuration in GitHub Actions
* ci: add Windows clang build workflow
* ci: add additional packages to GitHub workflows build
* ci: optimize build workflow and improve commenting
* ci: remove unused MSVC dev command from build workflow
* ci: modify build workflow to support multiple compilers
* build(github-actions): use matrix.compiler for CC and CXX variables
|
|
d2c78d2e
|
2025-06-08T08:16:42
|
|
feat(testsuite): exclude wasm from pthreads testing in libffi
|
|
668e2162
|
2025-06-08T08:00:36
|
|
refactor(threads): don't run tests on windows
|
|
5be311be
|
2025-06-08T07:56:37
|
|
refactor: add POSIX barriers to libffi.threads testsuite
|
|
70b34efe
|
2025-06-08T07:53:00
|
|
feat(testsuite): add -lpthread flag for wasm32 targets
|
|
f530522c
|
2025-06-08T07:52:25
|
|
chore: disable color diagnostics in libffi tests
|
|
5fd81214
|
2025-06-08T07:47:04
|
|
chore: update documentation date and add test files to Makefile
|
|
a5d46502
|
2025-06-08T07:40:39
|
|
feat(testsuite): add new threading tests to libffi test suite
|
|
074c423f
|
2025-06-08T07:30:54
|
|
feat: Add ffi_get_default_abi and ffi_get_closure_size functions
|
|
b14d4379
|
2025-06-08T06:53:12
|
|
Update version
|
|
c8225fb0
|
2025-06-08T06:51:58
|
|
chore: update libffi version to 3.5.0
|
|
cb424c6d
|
2025-06-08T06:50:47
|
|
docs: Update README with release details for version 3.5.0
|
|
8b0eab28
|
2025-06-08T12:16:38
|
|
Update License date and improve rcedit DLL metadata (#919)
* rcedit add architecture and original filename
* Update LICENSE to 2025
|
|
8b30fe51
|
2025-06-07T08:51:52
|
|
ci: add user configuration for DejaGNU tests in ppc64le container
|
|
58f91790
|
2025-06-07T08:48:41
|
|
ci: add diffutils and gawk to ppc64le container dependencies
|
|
d796b1ba
|
2025-06-07T08:47:04
|
|
feat(.ci): add libtool to ppc64le container setup
|
|
024cbc25
|
2025-06-07T08:35:15
|
|
feat(.ci): add Containerfile for ppc64le architecture
|
|
e3cbebff
|
2025-06-06T22:40:40
|
|
use rcedit to add metainfo to DLL (#918)
* use rcedit to add metainfo to DLL
* remove trailing backslash in build.yml
* build.yml: add rcedit execute permission
* build.yml: cd to the right directory
|
|
9bb21f1d
|
2025-06-06T13:48:25
|
|
fix: correct path in LDFLAGS line of build.yml workflow
|
|
c2ae66fc
|
2025-06-06T13:41:56
|
|
fix(build): change version.o to version.obj in build.yml
|
|
d326a4c0
|
2025-06-05T09:35:47
|
|
refactor: simplify versioning in .github/workflows/build.yml
|
|
d241e510
|
2025-06-05T09:22:10
|
|
chore(build): update build script to use object file for versioning
|
|
c07b0c4d
|
2025-06-05T08:52:41
|
|
fix(github workflows): correct LDFLAGS path in build.yml
|
|
ec22d0fe
|
2025-06-05T08:44:36
|
|
build(.github/workflows): include build number in version info
|
|
e133ee84
|
2025-06-05T07:42:52
|
|
chore(build): add command to log version information in build script
|
|
c8d929fc
|
2025-06-05T07:33:57
|
|
ci: add version logging in build workflow
|
|
d6029210
|
2025-06-05T07:11:43
|
|
ci: refactor version retrieval in build workflow
|
|
49c70cab
|
2025-06-05T06:57:20
|
|
fix(build): correct variables for FILEVERSION and PRODUCTVERSION
|
|
27f93a70
|
2025-06-05T06:50:12
|
|
feat(build): add version information resource to build script and update documentation version
|
|
1b6b176a
|
2025-06-05T06:17:56
|
|
Update README.md to mention SH targets
|
|
bac99f2f
|
2025-06-05T06:12:10
|
|
Release candidate 1 for 3.5.0. Windows build fixes. (#916)
* refactor(ci): improve wget retry logic in .ci/install.sh
* build(github-actions): use static runtime library in build
* refactor(ffi.h.in): export version API
* chore: update libffi version to 3.5.0-rc1
|
|
3c54639e
|
2025-06-04T19:20:37
|
|
refactor(ci): improve wget retry logic in .ci/install.sh (#915)
|
|
d6b1f342
|
2025-06-04T11:24:11
|
|
refactor: move and modify unix-noexec.exp and site.exp files
|
|
d38abaf9
|
2025-06-04T07:57:21
|
|
feat(testsuite): add Emscripten support to libffi.closures tests
|
|
2d8868ac
|
2025-06-04T07:04:53
|
|
Update generate-darwin-source-and-headers.py (#914)
|
|
5ad529fb
|
2025-06-03T19:12:49
|
|
Many CI testing fixes and improvements. (#913)
|
|
2529b40d
|
2025-06-02T20:42:47
|
|
chore: update version to 3.5.0-rc0 in documentation and configuration files
|
|
3ee0dc41
|
2025-06-02T20:41:27
|
|
chore: update version to 3.5.0-pre0 in version.texi
|
|
55d84b0c
|
2025-06-02T20:40:44
|
|
docs: update README with new libffi release information
|
|
854ce7be
|
2025-06-02T20:18:46
|
|
Make 3.5.0-pre0 release. Build and publish Windows binaries. Clean up testing. (#912)
This commit removes many platforms from the testing workflow.
They will be added back in future commits.
|
|
022929b1
|
2025-06-01T13:30:51
|
|
doc now shows the correct calculation for version number (#911)
|
|
dcc9e93b
|
2025-05-28T14:32:02
|
|
Add Issue labeler Action
|
|
9ee7341d
|
2025-05-26T08:19:32
|
|
feat(README): add details for next version release in history section
|
|
4094362f
|
2025-05-26T08:19:15
|
|
refactor: enhance assembler pseudo-ops and compiler flag checking
|
|
be4e59e3
|
2025-05-26T08:19:00
|
|
chore: update version to 3.5.0 and libtool version to 10:0:2
|
|
dc9b1332
|
2025-05-26T08:18:40
|
|
chore: update Makefile.am configurations
|
|
c9a3a06f
|
2025-05-26T08:18:13
|
|
feat(libffi): upgrade to version 3.5.0 and add version API
|
|
64d5e122
|
2025-05-25T16:09:59
|
|
docs: update required installations in README.md
|
|
5b253476
|
2025-05-25T13:33:51
|
|
chore(testsuite): remove mingw64-align.c from Makefile and delete file
|
|
f9c60855
|
2025-05-24T08:11:37
|
|
Add custom github issue labels for gail
|
|
c6f16105
|
2025-04-27T08:59:12
|
|
feat(testsuite): add mingw64-align.c to test alignment in structs
|
|
571177ad
|
2025-04-27T08:30:35
|
|
feat(testsuite): add longjmp test to Makefile and implement longjmp test code
|
|
562cb53b
|
2025-04-25T05:07:57
|
|
Add initializer (#904)
|
|
aea22de2
|
2025-04-18T10:09:45
|
|
powerpc: Fix closures on powerpc64-linux when statically linking (#900) (#902)
Closures on powerpc64-linux using static trampolines do not work when
statically linking libffi. The problem is the usage of tramp_globals.text
in libffi assumes it contains the entry point address of the first trampoline.
Powerpc's ffi_tramp_arch code returns &trampoline_code_table which for ABIs
that use function descriptors, ends up returning trampoline_code_table's
function descriptor address instead of its entry point address. Update
the code to always return the entry point address for all ABIs.
|
|
a431b478
|
2025-04-15T10:30:27
|
|
pa: add .note.GNU-stack marker to linux.S (#899)
Similarly to f515eac04cf8e5f594d5d9dee5fb7dfc3a186a4c, add a .note.GNU-stack
marker to pa/linux.S as it doesn't need an executable stack. Absence of the
note means that GNU Binutils will consider it as needing an executable stack
and mark it as such automatically.
When building libffi on HPPA with `-Wl,--warn-warn-execstack`, we get:
```
ld: warning: src/pa/.libs/linux.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
```
That becomes more problematic with glibc-2.41 which forbids dlopen()
of a library with an executable stack, and libffi is commonly dlopen()'d,
especially by Python.
I suspect the reason it didn't show up on Debian is that since February,
Debian has been building Binutils with --disable-default-execstack.
Bug: https://bugs.gentoo.org/953805
Bug: https://github.com/libffi/libffi/issues/898
|
|
6a99edb8
|
2025-04-10T03:44:45
|
|
testsuite: add two tests to Makefile.am (#893)
* Add libffi.call/overread.c and libffi.call/x32.c to Makefile.am
so they're included in dist tarballs
* Fix indentation and rewrap
|
|
bfb5b005
|
2025-04-09T10:32:42
|
|
feat: Update version of libffi to 3.4.8 with various fixes and enhancements
|
|
3429ed6b
|
2025-04-08T05:52:37
|
|
powerpc: Add static trampoline support (#894) (#895)
Add static trampoline support to all three powerpc Linux ABIs, specifically
powerpc-linux (32-bit SYSV BE), powerpc64-linux (64-bit ELFv1 BE) and
powerpc64le-linux (64-bit ELFv2 LE). This follows the s390x implementation
and does not introduce a ffi_closure_*_alt function, but rather jumps
directly to the ffi_closure_* function itself. If compiling with
--with-gcc-arch=power10 and pc-relative is enabled, we use a simpler and
smaller trampoline that utilizes Power10's new pc-relative load instructions.
|
|
bb1a84ed
|
2025-03-30T12:07:59
|
|
Add the "ABI_ATTR" attribute to called functions (#891) (#892)
I accidentally omitted the "ABI_ATTR" attribute, so that the testsuite
fails when testing the Microsoft ABI.
Fixes: fe203ffbb2bd ("Fix bugs in the x86-64 and x32 target (#887) (#889)")
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
|
|
fe203ffb
|
2025-03-27T01:31:49
|
|
Fix bugs in the x86-64 and x32 target (#887) (#889)
This commit fixes two bugs in ffi in the x86-64 target. The bugs were
introduced by the commit d21881f55ed4a44d464c9091871e69b0bb47611a ("Fix
x86/ffi64 calls with 6 gp and some sse registers").
The first bug is that when we pass an argument with less than 8 bytes,
ffi will read memory beyond argument end, causing a crash if the argument
is located just before the end of the mapped region.
The second bug is in the x32 ABI - pointers in x32 are 4-byte, but GCC
assumes that the pointer values in the registers are zero-extended. ffi
doesn't respect this assumption, causing crashes in the called library.
For example, when we compile this function for x32:
int fn(int *a)
{
if (a)
return *a;
return -1;
}
we get this code:
fn:
testq %rdi, %rdi
je .L3
movl (%edi), %eax
ret
.L3:
movl $-1, %eax
ret
When we call this function using ffi with the argument NULL, the function
crashes because top 4 bytes of the RDI register are not cleared.
Fixes: d21881f55ed4 ("Fix x86/ffi64 calls with 6 gp and some sse registers (#848)")
Signed-off-by: Mikulas Patocka <mikulas@twibright.com>
|
|
cf69efab
|
2025-03-08T14:41:02
|
|
Update the Simple Example to fix a compile error (#886)
Fixes the following error:
candidate function not viable: no known conversion from 'int (const char *)' to 'void (*)()' for 2nd argument
|
|
89c99d73
|
2025-02-28T22:10:10
|
|
MIPS: Dont import asm/sgidefs.h on linux (#885)
Removed from Linux since Linux 3.7
Ref: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=61730c538f8281efa7ac12596da9f3f9a31b9272
|
|
5ceddf40
|
2025-02-20T04:25:21
|
|
aarch64: add PAC to GNU Notes (#882)
While PAC was enabled, the bit to indicate support in the GNU Notes
section of the ELF was missing.
Before:
readelf -n ./aarch64-unknown-linux-gnu/.libs/libffi.so
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI
This was caused by this file not having PAC indicated in GNU Notes and
the linker discarding it:
File: ./aarch64-unknown-linux-gnu/src/aarch64/sysv.o
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI
Now it has it:
File: ./aarch64-unknown-linux-gnu/src/aarch64/sysv.o
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI, PAC
As well as the output shared object:
readelf -n ./aarch64-unknown-linux-gnu/.libs/libffi.so
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI, PAC
Fixes: #881
Signed-off-by: Bill Roberts <bill.roberts@arm.com>
|
|
1716f81e
|
2025-02-08T11:32:05
|
|
feat: remove nios2 support
Acked-by: Anthony Green <green@moxielogic.com>
|
|
252c0f46
|
2025-02-08T09:37:31
|
|
chore: Bump version to 3.4.7 and update change log
|
|
adfe4489
|
2025-01-31T21:41:56
|
|
Emscripten: remove support for `-sWASM_BIGINT=0` (#874)
* Emscripten: cleanup
* Emscripten: remove support for `-sWASM_BIGINT=0`
* Emscripten: remove redundant CircleCI config
* Emscripten: modernize CI
* Ensure test helper methods are static
Similar to #644.
* Fix test failures in `cls_multi_{s,u}shortchar`
|
|
2f34cf63
|
2025-01-31T13:40:40
|
|
x86 Darwin returns structs of size 1, 2, 4, and 8 in registers (#876)
|
|
a0d8074a
|
2025-01-31T21:40:00
|
|
Disable go closures on Android (#877)
* x18 register shouldn't be used on Android due to the shadow call stack feature in llvm
* https://source.android.com/docs/security/test/shadow-call-stack
|
|
d77b9fef
|
2024-12-13T18:38:01
|
|
Fix config.sub on Apple platforms (#860)
* update config.sub
* update config.sub
|
|
593cb01a
|
2024-12-13T05:37:15
|
|
Add mold linker to linker checks. (#866)
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
|
|
f515eac0
|
2024-12-13T18:36:02
|
|
MIPS: add .note.GNU-stack section to assembly sources (#872)
To build ELF shared libraries that do not require executable stack on
MIPS, every object file linked should have a .note.GNU-stack section,
otherwise the linker defaults to executable stack.
As libffi shouldn't require executable stack, add the .note.GNU-stack
section to the assembly source files under src/mips, like other
architectures.
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
|
|
458b2ae2
|
2024-11-16T13:03:24
|
|
Add static trampoline support for s390 (#862)
* added static trampoline support for s390
* enable static tramp only for s390x 64bit
|