Branch


Log

Author Commit Date CI Message
Martin Storsjö 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__.
Vyacheslav Chigrin 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.
Vyacheslav Chigrin c3a2b657 2025-08-21T11:34:22 Fix test compilation for some Android platforms (#935)
Peter Bergner 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.
Anthony Green e2eda0cf 2025-08-02T08:56:01 feat: Update libffi version to 3.5.2 with wasm64 and DragonFly BSD support
Anthony Green b53b0042 2025-08-02T08:52:25 Fix for systems without O_CLOEXEC
Kohei Tokunaga 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>
Weitian LI 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/
Anthony Green 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
Anthony Green d0f831bc 2025-06-21T16:05:31 feat: add QUESTION to .gail-labels
Anthony Green e28a0d5b 2025-06-10T16:17:58 ci: add fail-if-no-assets option in tarball workflow
Anthony Green 90220e51 2025-06-10T16:03:47 Update version.
Anthony Green 330467d5 2025-06-10T16:01:56 Move new symbols to new symbol versioning.
Anthony Green 517310dd 2025-06-09T19:03:49 ci: update compiler versions in github workflow
Anthony Green d994395c 2025-06-09T18:43:40 ci: update gcc version to 15 in build process
Anthony Green 26d7be77 2025-06-09T18:23:15 ci: update build.sh for Linux build process
Anthony Green a18d4e95 2025-06-09T13:35:29 feat(.github/workflows): add step to wipe old snapshot assets in tarball.yml
Anthony Green b9b83785 2025-06-09T13:29:03 fix(github-actions): correct regex in version extraction
Anthony Green 7ac6f145 2025-06-09T13:08:02 ci: change packages installed during workflow
Anthony Green ceab352d 2025-06-09T13:01:50 ci: add installation of necessary tools to tarball workflow
Anthony Green 1f73aa50 2025-06-09T12:56:19 refactor(.github/workflows/tarball): remove repeated job blocks
Anthony Green 7f5375d7 2025-06-09T12:55:09 chore(workflows): update snapshot release description in tarball.yml
Anthony Green 2a5195bb 2025-06-09T12:54:55 chore(.github/workflows): update tarball.yml indentation
Anthony Green 2f535b8f 2025-06-09T12:52:43 chore(ci): update tarball workflow in GitHub Actions
Anthony Green 172bfb41 2025-06-09T12:22:35 chore(.github/workflows): update tarball workflow to use softprops/action-gh-release
Anthony Green 0947743f 2025-06-09T11:53:15 Make tarballs (#924) * Create tarballs in CI
Kleis Auke Wolthuizen 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
Anthony Green 40a76827 2025-06-09T09:49:00 Improve CI test coverage (#923) Add CI testing on Windows with both gcc and clang.
Anthony Green 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
Anthony Green d2c78d2e 2025-06-08T08:16:42 feat(testsuite): exclude wasm from pthreads testing in libffi
Anthony Green 668e2162 2025-06-08T08:00:36 refactor(threads): don't run tests on windows
Anthony Green 5be311be 2025-06-08T07:56:37 refactor: add POSIX barriers to libffi.threads testsuite
Anthony Green 70b34efe 2025-06-08T07:53:00 feat(testsuite): add -lpthread flag for wasm32 targets
Anthony Green f530522c 2025-06-08T07:52:25 chore: disable color diagnostics in libffi tests
Anthony Green 5fd81214 2025-06-08T07:47:04 chore: update documentation date and add test files to Makefile
Anthony Green a5d46502 2025-06-08T07:40:39 feat(testsuite): add new threading tests to libffi test suite
Anthony Green 074c423f 2025-06-08T07:30:54 feat: Add ffi_get_default_abi and ffi_get_closure_size functions
Anthony Green b14d4379 2025-06-08T06:53:12 Update version
Anthony Green c8225fb0 2025-06-08T06:51:58 chore: update libffi version to 3.5.0
Anthony Green cb424c6d 2025-06-08T06:50:47 docs: Update README with release details for version 3.5.0
JupiterRider 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
Anthony Green 8b30fe51 2025-06-07T08:51:52 ci: add user configuration for DejaGNU tests in ppc64le container
Anthony Green 58f91790 2025-06-07T08:48:41 ci: add diffutils and gawk to ppc64le container dependencies
Anthony Green d796b1ba 2025-06-07T08:47:04 feat(.ci): add libtool to ppc64le container setup
Anthony Green 024cbc25 2025-06-07T08:35:15 feat(.ci): add Containerfile for ppc64le architecture
JupiterRider 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
Anthony Green 9bb21f1d 2025-06-06T13:48:25 fix: correct path in LDFLAGS line of build.yml workflow
Anthony Green c2ae66fc 2025-06-06T13:41:56 fix(build): change version.o to version.obj in build.yml
Anthony Green d326a4c0 2025-06-05T09:35:47 refactor: simplify versioning in .github/workflows/build.yml
Anthony Green d241e510 2025-06-05T09:22:10 chore(build): update build script to use object file for versioning
Anthony Green c07b0c4d 2025-06-05T08:52:41 fix(github workflows): correct LDFLAGS path in build.yml
Anthony Green ec22d0fe 2025-06-05T08:44:36 build(.github/workflows): include build number in version info
Anthony Green e133ee84 2025-06-05T07:42:52 chore(build): add command to log version information in build script
Anthony Green c8d929fc 2025-06-05T07:33:57 ci: add version logging in build workflow
Anthony Green d6029210 2025-06-05T07:11:43 ci: refactor version retrieval in build workflow
Anthony Green 49c70cab 2025-06-05T06:57:20 fix(build): correct variables for FILEVERSION and PRODUCTVERSION
Anthony Green 27f93a70 2025-06-05T06:50:12 feat(build): add version information resource to build script and update documentation version
Anthony Green 1b6b176a 2025-06-05T06:17:56 Update README.md to mention SH targets
Anthony Green 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
Anthony Green 3c54639e 2025-06-04T19:20:37 refactor(ci): improve wget retry logic in .ci/install.sh (#915)
Anthony Green d6b1f342 2025-06-04T11:24:11 refactor: move and modify unix-noexec.exp and site.exp files
Anthony Green d38abaf9 2025-06-04T07:57:21 feat(testsuite): add Emscripten support to libffi.closures tests
Anthony Green 2d8868ac 2025-06-04T07:04:53 Update generate-darwin-source-and-headers.py (#914)
Anthony Green 5ad529fb 2025-06-03T19:12:49 Many CI testing fixes and improvements. (#913)
Anthony Green 2529b40d 2025-06-02T20:42:47 chore: update version to 3.5.0-rc0 in documentation and configuration files
Anthony Green 3ee0dc41 2025-06-02T20:41:27 chore: update version to 3.5.0-pre0 in version.texi
Anthony Green 55d84b0c 2025-06-02T20:40:44 docs: update README with new libffi release information
Anthony Green 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.
JupiterRider 022929b1 2025-06-01T13:30:51 doc now shows the correct calculation for version number (#911)
Anthony Green dcc9e93b 2025-05-28T14:32:02 Add Issue labeler Action
Anthony Green 9ee7341d 2025-05-26T08:19:32 feat(README): add details for next version release in history section
Anthony Green 4094362f 2025-05-26T08:19:15 refactor: enhance assembler pseudo-ops and compiler flag checking
Anthony Green be4e59e3 2025-05-26T08:19:00 chore: update version to 3.5.0 and libtool version to 10:0:2
Anthony Green dc9b1332 2025-05-26T08:18:40 chore: update Makefile.am configurations
Anthony Green c9a3a06f 2025-05-26T08:18:13 feat(libffi): upgrade to version 3.5.0 and add version API
Anthony Green 64d5e122 2025-05-25T16:09:59 docs: update required installations in README.md
Anthony Green 5b253476 2025-05-25T13:33:51 chore(testsuite): remove mingw64-align.c from Makefile and delete file
Anthony Green f9c60855 2025-05-24T08:11:37 Add custom github issue labels for gail
Anthony Green c6f16105 2025-04-27T08:59:12 feat(testsuite): add mingw64-align.c to test alignment in structs
Anthony Green 571177ad 2025-04-27T08:30:35 feat(testsuite): add longjmp test to Makefile and implement longjmp test code
David Tenty 562cb53b 2025-04-25T05:07:57 Add initializer (#904)
Peter Bergner 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.
Sam James 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
Sam James 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
Anthony Green bfb5b005 2025-04-09T10:32:42 feat: Update version of libffi to 3.4.8 with various fixes and enhancements
Peter Bergner 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.
mikulas-patocka 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>
mikulas-patocka 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>
Nikita Samusev 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
fossdd 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
Bill Roberts 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>
Anthony Green 1716f81e 2025-02-08T11:32:05 feat: remove nios2 support Acked-by: Anthony Green <green@moxielogic.com>
Anthony Green 252c0f46 2025-02-08T09:37:31 chore: Bump version to 3.4.7 and update change log
Kleis Auke Wolthuizen 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`
Matthew Flatt 2f34cf63 2025-01-31T13:40:40 x86 Darwin returns structs of size 1, 2, 4, and 8 in registers (#876)
zye2-sc 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
Satadru Pramanik, DO, MPH, MEng 593cb01a 2024-12-13T05:37:15 Add mold linker to linker checks. (#866) Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Icenowy Zheng 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>
Eddy S. 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