1915 Commits

Author SHA1 Message Date
Vyacheslav Chigrin
170bab47c9
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.
2025-08-21 04:36:06 -04:00
Vyacheslav Chigrin
c3a2b65748
Fix test compilation for some Android platforms (#935) 2025-08-21 04:34:22 -04:00
Peter Bergner
c9b2a8a4ce
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.
2025-08-07 13:40:35 +02:00
Anthony Green
e2eda0cf72 feat: Update libffi version to 3.5.2 with wasm64 and DragonFly BSD support v3.5.2 2025-08-02 08:56:01 +02:00
Anthony Green
b53b0042c2 Fix for systems without O_CLOEXEC 2025-08-02 08:52:25 +02:00
Kohei Tokunaga
20eacb22e9
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>
2025-08-02 02:28:46 -04:00
Weitian LI
b7885ace59
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/
2025-08-02 02:27:51 -04:00
Anthony Green
6067118768 fix(tramp): ensure file descriptor is closed on exec. Thanks to Florian Weimer.
c# Please enter the commit message for your changes. Lines starting
2025-07-11 03:17:18 -04:00
Anthony Green
d0f831bca6 feat: add QUESTION to .gail-labels 2025-06-21 16:05:31 -04:00
Anthony Green
e28a0d5b07 ci: add fail-if-no-assets option in tarball workflow v3.5.1 2025-06-10 16:17:58 -04:00
Anthony Green
90220e51bc Update version. 2025-06-10 16:03:47 -04:00
Anthony Green
330467d55c Move new symbols to new symbol versioning. 2025-06-10 16:01:56 -04:00
Anthony Green
517310ddbf ci: update compiler versions in github workflow 2025-06-09 19:03:49 -04:00
Anthony Green
d994395ce7 ci: update gcc version to 15 in build process 2025-06-09 18:43:40 -04:00
Anthony Green
26d7be77cc ci: update build.sh for Linux build process 2025-06-09 18:23:15 -04:00
Anthony Green
a18d4e95d3 feat(.github/workflows): add step to wipe old snapshot assets in tarball.yml 2025-06-09 13:35:29 -04:00
Anthony Green
b9b8378556 fix(github-actions): correct regex in version extraction 2025-06-09 13:29:03 -04:00
Anthony Green
7ac6f14591 ci: change packages installed during workflow v3.5.1-dev 2025-06-09 13:08:02 -04:00
Anthony Green
ceab352dfa ci: add installation of necessary tools to tarball workflow 2025-06-09 13:01:50 -04:00
Anthony Green
1f73aa507e refactor(.github/workflows/tarball): remove repeated job blocks 2025-06-09 12:56:19 -04:00
Anthony Green
7f5375d7c7 chore(workflows): update snapshot release description in tarball.yml 2025-06-09 12:55:09 -04:00
Anthony Green
2a5195bb2a chore(.github/workflows): update tarball.yml indentation 2025-06-09 12:54:55 -04:00
Anthony Green
2f535b8f74 chore(ci): update tarball workflow in GitHub Actions 2025-06-09 12:52:43 -04:00
Anthony Green
172bfb41f4 chore(.github/workflows): update tarball workflow to use softprops/action-gh-release snapshots 2025-06-09 12:22:35 -04:00
Anthony Green
0947743f69
Make tarballs (#924)
* Create tarballs in CI
2025-06-09 11:53:15 -04:00
Kleis Auke Wolthuizen
a46977da50
Downgrade Autoconf requirement to version 2.68 (#922)
* Downgrade Autoconf requirement to version 2.68

* CI: remove redundant Autoconf install scripts
2025-06-09 09:55:02 -04:00
Anthony Green
40a7682705
Improve CI test coverage (#923)
Add CI testing on Windows with both gcc and clang.
2025-06-09 09:49:00 -04:00
Anthony Green
64a42f618d
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
2025-06-08 16:59:58 -04:00
Anthony Green
d2c78d2ebb feat(testsuite): exclude wasm from pthreads testing in libffi v3.5.0 2025-06-08 08:16:42 -04:00
Anthony Green
668e2162e8 refactor(threads): don't run tests on windows 2025-06-08 08:00:36 -04:00
Anthony Green
5be311bed5 refactor: add POSIX barriers to libffi.threads testsuite 2025-06-08 07:56:37 -04:00
Anthony Green
70b34efece feat(testsuite): add -lpthread flag for wasm32 targets 2025-06-08 07:53:00 -04:00
Anthony Green
f530522ce4 chore: disable color diagnostics in libffi tests 2025-06-08 07:52:25 -04:00
Anthony Green
5fd812149e chore: update documentation date and add test files to Makefile 2025-06-08 07:47:04 -04:00
Anthony Green
a5d465029c feat(testsuite): add new threading tests to libffi test suite 2025-06-08 07:40:39 -04:00
Anthony Green
074c423f86 feat: Add ffi_get_default_abi and ffi_get_closure_size functions 2025-06-08 07:30:54 -04:00
Anthony Green
b14d43793a Update version 2025-06-08 06:53:12 -04:00
Anthony Green
c8225fb03d chore: update libffi version to 3.5.0 2025-06-08 06:51:58 -04:00
Anthony Green
cb424c6d41 docs: Update README with release details for version 3.5.0 2025-06-08 06:51:04 -04:00
JupiterRider
8b0eab28cb
Update License date and improve rcedit DLL metadata (#919)
* rcedit add architecture and original filename

* Update LICENSE to 2025
2025-06-08 06:16:38 -04:00
Anthony Green
8b30fe51d4 ci: add user configuration for DejaGNU tests in ppc64le container 2025-06-07 08:51:52 -04:00
Anthony Green
58f9179009 ci: add diffutils and gawk to ppc64le container dependencies 2025-06-07 08:48:41 -04:00
Anthony Green
d796b1ba06 feat(.ci): add libtool to ppc64le container setup 2025-06-07 08:47:04 -04:00
Anthony Green
024cbc252c feat(.ci): add Containerfile for ppc64le architecture 2025-06-07 08:35:15 -04:00
JupiterRider
e3cbebffcc
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
2025-06-06 16:40:40 -04:00
Anthony Green
9bb21f1d29 fix: correct path in LDFLAGS line of build.yml workflow 2025-06-06 13:48:25 -04:00
Anthony Green
c2ae66fc45 fix(build): change version.o to version.obj in build.yml 2025-06-06 13:41:56 -04:00
Anthony Green
d326a4c025 refactor: simplify versioning in .github/workflows/build.yml 2025-06-05 09:35:47 -04:00
Anthony Green
d241e51019 chore(build): update build script to use object file for versioning 2025-06-05 09:22:10 -04:00
Anthony Green
c07b0c4ddc fix(github workflows): correct LDFLAGS path in build.yml 2025-06-05 08:52:41 -04:00