Commit Graph

209 Commits

Author SHA1 Message Date
Steve Dower
16fad4855b Import libffi-3.4.2 2021-08-26 22:01:30 +01:00
Josh Triplett
1c68c07217 Generate ChangeLog from git in make dist
Archive the existing ChangeLog to ChangeLog.libffi-3.1
2014-03-16 06:16:20 -07:00
Anthony Green
9a62a21f5c Add missing ChangeLog entry. Clean up some entries. 2014-03-16 09:03:57 -04:00
Josh Triplett
e1911f78df Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
Linux supports the stdcall calling convention, either via functions
explicitly declared with the stdcall attribute, or via code compiled
with -mrtd which effectively makes stdcall the default.

This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
non-Windows x86-32 platforms, as non-default calling conventions.
2014-03-16 05:05:06 -07:00
Josh Triplett
9531d05f64 prep_cif.c: Remove unnecessary ifdef for X86_WIN32
ffi_prep_cif_core had a special case for X86_WIN32, checking for
FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range
before returning FFI_BAD_ABI.  However, on X86_WIN32, FFI_THISCALL
already falls in that range, making the special case unnecessary.
Remove it.
2014-03-16 04:56:57 -07:00
Josh Triplett
f6dd184543 ChangeLog: Document testsuite changes to remove fragile stack pointer checks 2014-03-16 04:49:36 -07:00
Josh Triplett
82f8cb24a1 ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures 2014-03-16 04:40:45 -07:00
Josh Triplett
2f44952c95 Re-add libtool-ldflags 2014-03-16 04:35:12 -07:00
Josh Triplett
35634dbcea Remove autogenerated files from the repository
Add an autogen.sh to regenerate them.
2014-03-16 04:24:12 -07:00
Anthony Green
76d19d004e Ensure the linker supports @unwind sections in libffi. 2014-03-14 16:54:31 -04:00
Anthony Green
c86d9b6cc6 Fix merge 2014-03-14 16:51:20 -04:00
Ryan VanderMeulen
f8cdf11467 Replace double quotes with single quotes in Makefile.in to improve compatibility between some versions of MSYS and gmake. From Mozilla bug 943728.
https://bugzilla.mozilla.org/show_bug.cgi?id=943728
2014-03-10 15:04:58 -04:00
Ryan VanderMeulen
dfa3738732 Ensure the linker supports @unwind sections in libffi. From Mozilla bug 756740.
https://bugzilla.mozilla.org/show_bug.cgi?id=778414

Also tracked as issue #42.
https://github.com/atgreen/libffi/issues/42
2014-03-10 14:53:48 -04:00
Ryan VanderMeulen
18eb81d032 Allow building for mipsel with Android NDK r8. From Mozilla bug 756740.
https://bugzilla.mozilla.org/show_bug.cgi?id=756740
2014-03-10 14:43:37 -04:00
Anthony Green
634a475eaf Update Makefile for new darwin scripts 2014-03-01 18:37:29 -05:00
Anthony Green
a04e30ba3d Add missing -DFFI_DEBUG flag 2014-02-28 17:20:59 -05:00
Anthony Green
b40aeda31a Merge branch 'master' of github.com:/atgreen/libffi 2014-02-28 01:02:55 -05:00
Anthony Green
20698abc6a Merge pull request #66 from ppizarro/master
BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
2014-02-28 00:58:30 -05:00
Anthony Green
64bd06990a Add ChangeLog entry for Josh's change 2014-02-28 00:52:56 -05:00
Anthony Green
33c9954f2e Rebuilt with new libtool 2014-02-28 00:38:41 -05:00
Anthony Green
5a88c85fde Fix spelling errors 2014-02-28 00:26:09 -05:00
Anthony Green
001aaf4b1b When no VFP arguments are present the IP register is used
uninitialized. Initialize it to the value of FP.

This fixes a number of testsuite failures when configured for
armv7l-unknown-linux-gnueabihf
2014-02-28 00:20:17 -05:00
Anthony Green
49f7729c3c aarch64 fix 2014-02-28 00:17:16 -05:00
Anthony Green
447483d51c Fix ChangeLog merge 2014-02-27 15:42:41 -05:00
Heiher
40927bd3e1 Fix call floating point va function
I'm not sure floating-point arguments in GPR or FPR before calling
variable number arguments function. so, load all arguments to GPR and
FPR.
2014-02-09 10:38:24 +08:00
Zachary Waldowski
f466aad0d9 AArch64: Fix missing semicolons when assertions are enabled 2014-02-05 14:28:59 -05:00
Zachary Waldowski
bfc06b3fdb Update ChangeLog 2014-02-05 14:28:59 -05:00
Anthony Green
3dc3f32c35 Undo iOS ARM64 changes. 2013-12-05 16:23:25 -05:00
Anthony Green
d4b931c1b8 Remove build-ios from Makefile 2013-11-30 20:58:31 -05:00
Anthony Green
dfbf236d70 Merge branch 'master' of github.com:/atgreen/libffi
Add ChangeLog entry.
2013-11-30 20:55:47 -05:00
Alan Modra
ab79d6e219 This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
code, and makes it possible to link code compiled with different
options to those used to compile libffi.  For example, a
-mlong-double-128 libffi can be used with -mlong-double-64 code.

Using the return value area as a place to pass parameters wasn't such
a good idea, causing a failure of cls_ulonglong.c.  I didn't see this
when running the mainline gcc libffi testsuite because that version of
the test is inferior to the upstreamm libffi test.

Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
that a parameter save area could be allocated before it was strictly
necessary.  Wrong but harmless.  Found when splitting apart ffi.c
into 32-bit and 64-bit support.
2013-11-21 21:24:56 -05:00
Alan Modra
ac75368893 This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
code, and makes it possible to link code compiled with different
options to those used to compile libffi.  For example, a
-mlong-double-128 libffi can be used with -mlong-double-64 code.

Using the return value area as a place to pass parameters wasn't such
a good idea, causing a failure of cls_ulonglong.c.  I didn't see this
when running the mainline gcc libffi testsuite because that version of
the test is inferior to the upstreamm libffi test.

Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
that a parameter save area could be allocated before it was strictly
necessary.  Wrong but harmless.  Found when splitting apart ffi.c
into 32-bit and 64-bit support.
2013-11-21 06:12:35 -05:00
Iain Sandoe
aa1f62c0a0 Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels. 2013-11-18 13:11:56 +00:00
Anthony Green
2f450822a8 Clean up code to appease modern GCC compiler. 2013-11-18 06:52:29 -05:00
Alan Modra
16d56c51ad An #endif in the wrong place would cause compile failure on powerpcle.
Using bl instead of b doesn't cause runtime failures as you might think,
but does mess the processor branch prediction.
2013-11-18 06:36:03 -05:00
Alan Modra
83f65b63d9 Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be
linked with ELFv2 objects, so this is one case where preprocessor
tests in ffi.c are fine.  Also, there is no need to define a new
FFI_ELFv2 or somesuch value in enum ffi_abi.  FFI_LINUX64 will happily
serve both ABIs.
2013-11-16 06:56:30 -05:00
Alan Modra
362851379a Andreas' 2013-02-08 change reverted some breakage for struct return
values from 2011-11-12, but in so doing reintroduced string
instructions to sysv.S that are not supported on all powerpc variants.
This patch properly copies the bounce buffer to destination in C code
rather than in asm.

I have tested this on powerpc64-linux, powerpc-linux and
powerpc-freebsd.  Well, the last on powerpc-linux by lying to
configure with

CC="gcc -m32 -msvr4-struct-return -mlong-double-64" \
CXX="g++ -m32 -msvr4-struct-return -mlong-double-64" \
/src/libffi-current/configure --build=powerpc-freebsd

and then

make && make CC="gcc -m32" CXX="g++ -m32" \
RUNTESTFLAGS=--target_board=unix/-m32/-msvr4-struct-return/-mlong-double-64\
 check
2013-11-16 06:52:43 -05:00
Alan Modra
1c06515d92 The powerpc64 ABIs align structs passed by value, a fact ignored by
gcc for quite some time.  Since gcc now does the correct alignment,
libffi needs to follow suit.  This ought to be made selectable via
a new abi value, and the #ifdefs removed from ffi.c along with many
other #ifdefs present there and in assembly.  I'll do that with a
followup patch sometime.

This is a revised version of
https://sourceware.org/ml/libffi-discuss/2013/msg00162.html
2013-11-16 06:41:36 -05:00
Alan Modra
a97cf1fae5 This patch prepares for ELFv2, where sizes of these areas change. It
also makes some minor changes to improve code efficiency.
2013-11-16 06:40:13 -05:00
Alan Modra
164283f4ac The powerpc64 support opted to pass floating point values both in the
fpr area and the parameter save area, necessary when the backend
doesn't know if a function argument corresponds to the ellipsis
arguments of a variadic function.  This patch adds powerpc support for
variadic functions, and changes the code to only pass fp in the ABI
mandated area.  ELFv2 needs this change since the parameter save area
may not exist there.

This also fixes two faulty tests that used a non-variadic function
cast to call a variadic function, and spuriously reasoned that this is
somehow necessary for static functions..
2013-11-16 06:38:55 -05:00
Andrew Haley
31257b3189 Fix sample closure code 2013-11-16 06:35:51 -05:00
Andrew Haley
db0ace3a38 Fix broken test cases 2013-11-16 06:29:25 -05:00
Anthony Green
de10f5039e Merge branch 'master' of https://github.com/bivab/libffi
Conflicts:
	ChangeLog
2013-11-14 10:56:29 -05:00
David Schneider
f3657da278 update Changelog 2013-11-14 13:02:16 +01:00
Alan Modra
58c2577a3f This enshrines the current testsuite practice of using ffi_arg for
returned values.  It would be reasonable and logical to use the actual
return argument type as passed to ffi_prep_cif, but this would mean
changing a large number of tests that use ffi_arg and all backends
that write results to an ffi_arg.
2013-11-13 16:55:36 -05:00
Anthony Green
8af42f9944 Respect HAVE_ALLOCA_H 2013-11-13 16:40:28 -05:00
Anthony Green
2f5b7ce545 UltraSPARC IIi fix. Update README and build configury. 2013-11-09 06:16:32 -05:00
Mark Kettenis
becd754434 Align the stack pointer to 16-bytes. 2013-11-06 06:43:49 -05:00
Konstantin Belousov
05c3109340 Mark executable as not requiring executable stack. 2013-11-06 06:40:58 -05:00
Anthony Green
cf6bf9818e Fix up docs 2013-11-02 17:23:59 -04:00