1876 Commits

Author SHA1 Message Date
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
Anthony Green
ec22d0fe7b build(.github/workflows): include build number in version info 2025-06-05 08:44:36 -04:00
Anthony Green
e133ee847d chore(build): add command to log version information in build script 2025-06-05 07:42:52 -04:00
Anthony Green
c8d929fc45 ci: add version logging in build workflow 2025-06-05 07:33:57 -04:00
Anthony Green
d6029210d7 ci: refactor version retrieval in build workflow 2025-06-05 07:11:43 -04:00
Anthony Green
49c70cab94 fix(build): correct variables for FILEVERSION and PRODUCTVERSION 2025-06-05 06:57:20 -04:00
Anthony Green
27f93a7038 feat(build): add version information resource to build script and update documentation version 2025-06-05 06:50:12 -04:00
Anthony Green
1b6b176a28
Update README.md to mention SH targets v3.5.0-rc1 2025-06-05 06:17:56 -04:00
Anthony Green
bac99f2f3f
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
2025-06-05 06:12:10 -04:00
Anthony Green
3c54639eb8
refactor(ci): improve wget retry logic in .ci/install.sh (#915) 2025-06-04 19:20:37 -04:00
Anthony Green
d6b1f34232 refactor: move and modify unix-noexec.exp and site.exp files 2025-06-04 11:24:11 -04:00
Anthony Green
d38abaf9db feat(testsuite): add Emscripten support to libffi.closures tests 2025-06-04 07:57:21 -04:00
Anthony Green
2d8868ace7
Update generate-darwin-source-and-headers.py (#914) 2025-06-04 07:04:53 -04:00
Anthony Green
5ad529fb0d
Many CI testing fixes and improvements. (#913) 2025-06-03 19:12:49 -04:00
Anthony Green
2529b40dbd chore: update version to 3.5.0-rc0 in documentation and configuration files v3.5.0-rc0 2025-06-02 20:42:47 -04:00
Anthony Green
3ee0dc41b6 chore: update version to 3.5.0-pre0 in version.texi 2025-06-02 20:41:27 -04:00
Anthony Green
55d84b0cb9 docs: update README with new libffi release information 2025-06-02 20:40:44 -04:00
Anthony Green
854ce7be85
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.
2025-06-02 20:18:46 -04:00
JupiterRider
022929b1fc
doc now shows the correct calculation for version number (#911) 2025-06-01 07:30:51 -04:00
Anthony Green
dcc9e93b8a Add Issue labeler Action 2025-05-28 14:32:02 -04:00
Anthony Green
9ee7341dba feat(README): add details for next version release in history section 2025-05-26 08:19:32 -04:00
Anthony Green
4094362f54 refactor: enhance assembler pseudo-ops and compiler flag checking 2025-05-26 08:19:15 -04:00
Anthony Green
be4e59e399 chore: update version to 3.5.0 and libtool version to 10:0:2 2025-05-26 08:19:00 -04:00
Anthony Green
dc9b1332f7 chore: update Makefile.am configurations 2025-05-26 08:18:40 -04:00
Anthony Green
c9a3a06f9b feat(libffi): upgrade to version 3.5.0 and add version API 2025-05-26 08:18:13 -04:00
Anthony Green
64d5e122f7 docs: update required installations in README.md 2025-05-25 16:09:59 -04:00
Anthony Green
5b253476d1 chore(testsuite): remove mingw64-align.c from Makefile and delete file 2025-05-25 13:33:51 -04:00
Anthony Green
f9c60855da Add custom github issue labels for gail 2025-05-24 08:11:37 -04:00
Anthony Green
c6f1610509 feat(testsuite): add mingw64-align.c to test alignment in structs 2025-04-27 08:59:12 -04:00
Anthony Green
571177adcb feat(testsuite): add longjmp test to Makefile and implement longjmp test code 2025-04-27 08:30:35 -04:00
David Tenty
562cb53b5d
Add initializer (#904) 2025-04-25 05:07:57 -04:00
Peter Bergner
aea22de28e
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.
2025-04-18 11:09:45 -04:00
Sam James
a431b47822
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
2025-04-15 05:30:27 -04:00
Sam James
6a99edb808
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
v3.4.8
2025-04-09 22:44:45 -04:00
Anthony Green
bfb5b005a0 feat: Update version of libffi to 3.4.8 with various fixes and enhancements 2025-04-09 10:32:42 -04:00
Peter Bergner
3429ed6b94
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.
2025-04-08 06:52:37 -04:00
mikulas-patocka
bb1a84ed97
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>
2025-03-30 06:07:59 -04:00
mikulas-patocka
fe203ffbb2
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>
2025-03-26 20:31:49 -04:00
Nikita Samusev
cf69efabca
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
2025-03-08 06:41:02 -05:00
fossdd
89c99d738f
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
2025-02-28 16:10:10 -05:00