Update to version 3.4.4
More aarch64 fixes
Fix types of temporary variables in aarch64 extend_integer_type (#745)
Fixes truncated values in weston-info output.
typos (#742)
Add 32-bit cygwin test
Correction for older compilers
Flush output before aborting (#740)
Co-authored-by: Andreas Schwab <schwab@suse.de>
Fix strict aliasing problem in aarch64 ffi_call (#739)
The assignment a = &dest in ffi_call_int may be moved after the call to
extend_integer_type because that function accesses the assigned value with
a different type.
Co-authored-by: Andreas Schwab <schwab@suse.de>
riscv: make copies of structs passed by reference (#738)
Co-authored-by: Andreas Schwab <schwab@suse.de>
Add gcc-12 testing for aarch64 linux
Tweak quotes
Add .
Update README for 3.4.4.
Revert to previous cfi check. (#735)
Remove nested comments
Don't tweak path
Fix find
Locate tools
Use cross tools for Windows
Fix shell
Find ms tools
32- and 64-bit Windows
Add "lto" to triple to identify lto builds
Try aarch64 linux with -flto
Show compiler version
Never link pthread for android
CI: add Android builds (#732)
Test idea borrowed from cpython
or1k: All struct args are passed in memory
moxie: All struct args are passed in memory
Add test case transcribed from cpython
Set host triplet for native builds
Update job names
Give better names to CI workflows
Update version to 3.4.4-experimental
Suppress error console output duing configure in case not an ELF file (#729)
On Cygwin, MSYS and MinGW readelf is available, but files generated are no
ELF files. This results in an Error output on console:
'checking whether .eh_frame section should be read-only... readelf: Error: Not an ELF file - it has the wrong magic bytes at the start
yes'
With this patch the error output is suppressed resulting in only
'checking whether .eh_frame section should be read-only... yes'
Setting of related variables is not changed.
Co-authored-by: Hannes Müller <>
Fix typo
Update version
Update libtool version
Update version to 3.4.3
Update release dates
Add new files for distribution
Mention AIX with GCC
Update comment about platform support
Clean ups, preparing for new release
Standardize temp exec file creation
Handle win32 ABIs for struct return
Debug x86
Revert
Add test case
Add missing ABI_ATTR
X86 is never defined.
Add MSYS configuration files (#728)
* Add MSYS configuration files
MSYS behaves very similiar to Cygwin, e.g. also __CYGWIN__ is defined.
Now 'make check' passes on MSYS without extra patches.
* Fix warning extra tokens at end of #endif in closures.c
Extra tokens converted into a comment. Also nearby indentations corrected.
* Fix missing prototype warning mkostemp() on Cygwin
Cygwin requires also _GNU_SOURCE to be defined to enable mkostemp() prototype.
* Fix warning label ‘out’ defined but not used in ffi functions
Define same preprocessor conditions for goto and label visibility.
* Fix warning label ‘out’ defined but not used and related indentations.
Define same preprocessor conditions for goto and label visibility. Correct also
related indentations.
Co-authored-by: Hannes Müller <>
Fix test case for 64-bit mingw
Passes on 64bit mingw
Fix arg alignment for STDCALL
Fix test headers
Tweak msys2 tools again
Fix msys2 tool selection
Build 32- and 64-bit msys2
msvc requires the printf change, not mingw
Install unzip
Don't make msys2 default shell
Try msys2
Try new path
Find mingw32
DEbug
Try new shell
Fix indentation
set mingw32 path
Rename job
Fix mingw32 github actions
Add mingw32 testing
Fix test case
Improve test case
Add test case
Mention Cygwin static trampoline support.
Fix limits.h inclusion for cygwin
Add static trampoline support for Cygwin
Remove stray }}
Update rlgl usage (switch from player ID to labels)
Label rlgl reports
The right kind of quotes
More quotes
Fix random build dir
Remove bogus sparc compiler flag
Fix typo
Fix typo
Set CC and CXX for GCC compile farm builds
dlmmap fix and always check for PaX MPROTECT on linux
Also make EMUTRAMP experimental
From Stefan Bühler
https://github.com/libffi/libffi/pull/282
Fix typos
Retry autoconf downloads
Fix typo
Fix unwindtest on macos
Install automake on macos
Test with gcc and clang on macos 11 and 12.
Switch to 7 char SHA IDs. Fix windows crlf at git clone time.
Use GitHub SHA for rlgl ID
Pass large structs by value
outputs vs output
Use single quotes
Try {{}}
Fix compares
Show host availability
Fix conditionals?
Use boolean values
Try conditional steps
Tweak test for host availability
Fix triples
Add missing paren
Unnest quotes
Fix syntax error
Try dribbling output during make check
Split up build into multiple steps
Try to fix ssh issues
Try forcing exit upon completion
Source .profile on remote host if it exists
Only ignore errors when testing for ssh connectivity.
Don't fail on error
Add POWER hosts
Fix the setting of the host
If a remote host is unavailable, don't fail the build.
Debug build
Add connection timeouts and retries
Prune warnings from sparc64 linux ld
For host triples to distinguish m1 arm64 from others.
Don't exit if runtest fails
Fix spaces
Run rlgl
Fix recursive copy flag
Fix typo
Use scp, as rsync isn't available on all hosts
Use ssh port numbers and copy dejagnu results back
Use username
Tighten permissions on key
Disable host key checking
Add quotes
Remove bad command
Debug
Fix typo
Simplify remote tests
Revert to old file copy
Remove SHA256
Try new fingerprint
Use correct fingerprint
Ignore fingerprints
Use rsa fingerprints
Use host fingerprints
Try new scp
Fix GITHUB_RUN_NUMBER usage
Fix loongarch64 server port. Try GITHUB_RUN_NUMBER.
Reference matrix variables properly
List cfarm servers explicitly
Try multiple hosts
Use correct version of scp-action
Use scp instead of rsync
Remove extra debug
Debug rsync
Change remote path
Tweak
Work in actions dir
Run autogen before copying files to remote server
Install autoconf
Try more remote testing
Fix ssh
Add platform
Missing colon
Try cfarm access
GCC_AS_CFI_PSEUDO_OP passes on msvc, although it's not sufficient.
Fix struct padding warning reported by MSVC (#613)
When building on 32-bit x86.
Makefile: enable target overridings. (#661)
This patch allows target to provide extra files enabling the
override of Makefile rules.
This patch is not needed for libffi itself but only for GCC on AIX. The
t-aix file which is here empty will be replaced in GCC repository. We cannot
include GCC version directly here because it has no sense for a standalone
libffi.
Co-authored-by: Clement <clement.chigot@atos.net>
Don't use cached configure test result
Fix .cfi pseudo-ops test.
The existing tests were failing because the GCC was wrapping the test
asm in cfi directives, which gas doesn't like. So now we test if the
compiler emits them first, and assume that the assembler will accept
them. If that doesn't work, then we test if the assembler will accept
them assuming the compiler doesn't emit them.
Change comment style
Fix exports for tests
Don't -malign-double for x86-32
Update copyright year
static trampoline for LoongArch (#723)
For the benefit and technical details of static trampoline, see
https://github.com/libffi/libffi/pull/624. As a new architecture, let's
be "safer" from the start.
The change survived libffi testsuite on loongarch64-linux-gnu.
Move FFI_TYPE definitions above <ffitarget.h> include (#722)
For powerpc at least, these definitions are referenced in the
target-specific ffitarget.h. Discovered in the jffi project. Should
close https://github.com/libffi/libffi/issues/637. Downstream jffi bug
https://github.com/jnr/jffi/issues/107. Downstream distro bug
https://bugs.gentoo.org/827215.
Testing - both libffi and jffi test suites pass with this patch applied,
at least on ppc64le linux. I did not see any warnings about
redefinitions.
Tested versions - libffi 3.4.2, jffi 1.3.6 and 1.3.9.
Add missing file
Fix path
Install and use autoconf from special dir
Fix autoconf version number
Fix wget
Fix wget
Fix untar
Install autoconf-2.71
Update autoconf?
Update configury
Fix ILP32 for aarch64
Remove duplicate macro definition.
configure.ac: use grep -E instead of egrep if possible (#720)
Upstream will start to emit a warning if egrep is invoked in the next
grep release. Stop invoking it explicitly. Use AC_PROG_EGREP to try
"grep -E" first, and fallback to egrep if "grep -E" does not work. We
need this fallback for some non-GNU grep implementations (like Solaris).
Url: https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a951562
Ensure that VM_PROT_EXECUTE is set on the trampoline page. (#718)
powerpc64: fix build on gcc-12 (assembly requires AltiVec) (#719)
Without the change build fails on powerpc64-gcc-12 as:
src/powerpc/linux64_closure.S: Assembler messages:
src/powerpc/linux64_closure.S:363: Error: unrecognized opcode: `lvx'
It's a 90205f67 "rs6000: Fix bootstrap (libffi)" patch by
Segher Boessenkool from gcc upstream repository. It's enough to get
libffi build on powerpc64.
Fix windows arg passing
64-bit cygwin: fix struct args. Document change.
m32r: pass copies of large structs
Update testsuite Makefile
Fix building on aarch64 after e409225b41b60c490a094bb068e639a2364202fd (#716)
The ALIGN_DOWN macro was renamed in 2018 in
e6eac7863e2bf1a009ea863041b354bdb4af6b67.
Pass large structs by value on the stack
Fix for MS x64 ABI
Fix moxie struct passing
moxie: structs > 8 go on stack
New test cases
Pass copies of large structs on the stack
Pass large structs by value for Linux x86_64 and Aarch64.
Aarch patch by Andreas Schwab. https://github.com/libffi/libffi/commit/482b37f00467325e3389bab322525099860dd9aa
Mention loongson64
Support loongarch64 (#678)
* update config.{guess,sub}
* Support loongarch64
Co-Authored-By: Cheng Lulu <chenglulu@loongson.cn>
Co-Authored-By: Xi Ruoyao <xry111@mengyan1223.wang>
Co-Authored-By: Xu Hao
Co-Authored-By: Zhang Wenlong <zhangwenlong@loongson.cn>
Co-Authored-By: Pan Xuefeng <panxuefeng@loongson.cn>
Co-authored-by: panxuefeng <panxuefeng@loongson.cn>
Co-authored-by: Cheng Lulu <chenglulu@loongson.cn>
Co-authored-by: Xi Ruoyao <xry111@mengyan1223.wang>
Debug cygwin builds
Revert "Don't dereference beyond the last array entry. (#667)" (#715)
This reverts commit 92d77d0e87a5f2a8c9c9b2431ffd264cb664e17a.
Add support for ARM64 as an Apple simulator platform. (#712)
Upstream FreeBSD riscv patch (#708)
Like 8276f812a99b10d1f2c387dbd6ef2ca4f597c733 commit message:
> devel/libffi: Fix abort() on ARM related to __clear_cache()
>
> The current FreeBSD __clear_cache() implementation does nothing #if
> __i386__ || __x86_64__ #else abort();
>
> cognet@ advises this is an issue for anything !Apple that is using the
> libcompiler_rt provided by Clang on ARM, and requires upstreaming.
Co-authored-by: Kristof Provost <kp@FreeBSD.org>
Fix check for invalid varargs arguments. (#707)
Don't dereference beyond the last array entry. (#667)
testsuite/libffi.closures: Fix PowerPC 64 (#709)
-mlong-double-128 is only supported on glibc.
This test still passes on glibc targets, and now passes on musl targets
as well (which uses 64-bit ldbl).
Remove debug code
Remove stray export command
Debug cygwin builds
Debug cygwin tests
Clean up types
MIPS: fix some N32 test failure (#701)
Some go closure and pointer testcase fails.
These failures is not introduced by the complex support code.
MIPS: fix O32 softfloat support (#702)
x86-64: Always double jump table slot size for CET (#710) (#711)
When CET is enabled, double jump table slot size to add 4 bytes of ENDBR64
for CET. Since CET enabled clang doesn't have the LLVM assembler bug:
https://bugs.llvm.org/show_bug.cgi?id=21501
fixed by
commit 04d39260d64e08b8bfb3844109ad43d4055b2e8d
Author: Rafael Espindola <rafael.espindola@gmail.com>
Date: Wed Nov 4 23:50:29 2015 +0000
Simplify .org processing and make it a bit more powerful.
we can use .org to allocate jump table slot size to 16 bytes.
MIPS: add Complex support (#698)
Allow system to have overlapping mallopt defines (#700)
Which is the case on some OSes, such as QNX.
Clean up the QNX ARM bits (#699)
- Add missing include.
- Use constants instead of magic values.
Xtensa cleanups and XEA3 support (#677)
* xtensa: clean up stack usage in ffi_trampoline call
Space for outgoing call arguments reserved in the stack frame of the
function ffi_trampoline overlaps register spill overflow area at the
top of the frame. In xtensa XEA2 exception architecture the layout of
overlapping areas is identical so that even if the ffi_trampoline
registers frame gets spilled the memory contents doesn't change.
This is not so with the xtensa XEA3 exception architecture, where
registers a0 - a7 of a different function are spilled in that location.
Reserve spill area for 8 registers to avoid overlapping of the spill
area with the outgoing call arguments area in the ffi_trampoline.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* xtensa: support xtensa XEA3 exception architecture
XEA3 requires that 32 bytes of register spill area is reserved in all
functions. Fix ffi_cacheflush entry instruction to satisfy this
requirement.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* xtensa: maintain stack alignment
xtensa ABI requires stack alignment on 16 byte boundary and passing
up to 6 arguments in registers. To simplify stack alignment maintenance
fixed amount of stack space is reserved for arguments passed in
registers and variable but correctly aligned amount is reserved for the
remaining arguments. After copying arguments to the stack and loading
registers the fixed part of the stack reservation is freed.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
* xtensa: fix err_bad_abi tests
Check ffi_cif::abi value in the ffi_prep_closure_loc and return
FFI_BAD_ABI error if it's not one of the supported values.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
riscv: extend return types smaller than ffi_arg (#680)
Co-authored-by: Andreas Schwab <schwab@suse.de>
powerpc64: fix handling of homogeneous float128 structs (#689)
If there is a homogeneous struct with float128 members, they should be
copied to vector register save area. The current code incorrectly copies
only the value of the first member, not increasing the pointer with each
iteration. Fix this.
src/x86/win64.S: Use #define instead of .macro (#665) (#669)
The Solaris/x86 assembler doesn't support .macro/.endm, so use #define since
win64.S is passed through cpp anyway.
testsuite/libffi.call: fix mismatching return types (#679)
Co-authored-by: Andreas Schwab <schwab@suse.de>
Makefile: Add missing kvx/asm.h to dist headers (#660)
The header kvx/asm.h is required to build libffi and is missing from
the dist tarball.
Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
Fix 'type'-o
Fix struct arg passing
No more xfail for alpha
Add alpha CPU
Try to fix ARM QEMU tests
Fix m32r testing
Debug cross-in-containers builds
Test passing structs by value
Mention x32 static tramponline fix
Fix trampoline_code_table for x32. (#657)
x32's struct tramp_parm has 32-bit pointers. This change adjusts the
loads and offsets accordingly.
Fix CHECK
Don't check the whole buffer, just what we printed.
Fix test case
Fix test check
Fix test check
Use CHECK to assert more things in test suite (#654)
* Use CHECK to assert more things in test suite
* Use snprintf instead of sprintf
* Fix va_struct1 and va_struct3
Update README for next release.
Trigger actions on master branch
Migrate from travis-ci to github actions.
Update version to 3.4.2
Version 3.4.1
Update version to 3.4.0
Fix warnings
Add missing test cases to distribution
Add tests for single entry structs (#653)
Fix the assertions in cls-24byte (#652)
* Fix the assertions in cls-24byte
* Update print statement too
3.4.0 release candidate 2
Add missing FFI_HIDDEN to ffi_tramp_is_present declaration (#651)
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Print more information when an assertion fails in test suite (#649)
Fix signature of function pointer in cls_dbls_struct (#648)
configure.ac: add --disable-exec-static-tramp flag (#647)
Some projects like GHC (Glasgow Haskell Compiler) and
gobject-introspection use `ffi_closure_alloc()` as a way
to allocate executable memory. exec static tramp
interferes with it (unclear how exactly yet).
GHC symptom: ffi closure freeing cimplains about unexpected
trampoline (GHC manually fills one):
```
$ ghci
GHCi, version 8.10.5: https://www.haskell.org/ghc/ :? for help
ghc: freeHaskellFunctionPtr: not for me, guv! 0x7f0417a1efe8
ghc: freeHaskellFunctionPtr: not for me, guv! 0x7f0417a1efc8
```
gobject-introspection symptom:
```
$ meld
Segmentation fault (core dumped)
$ gdb --args /usr/bin/python3.9 /usr/bin/meld
(gdb) run
...
Thread 1 "python3.9" received signal SIGSEGV, Segmentation fault.
0x00007fffe9ac1ae8 in g_callable_info_free_closure (
callable_info=0x555555d45990, closure=0x7fffe9e70c20)
at ../gobject-introspection-1.68.0/girepository/girffi.c:428
428 g_free (wrapper->ffi_closure.cif->arg_types);
(gdb) bt
callable_info=0x555555d45990, closure=0x7fffe9e70c20)
at ../gobject-introspection-1.68.0/girepository/girffi.c:428
data=0x555555d252d0)
at ../pygobject-3.40.1/gi/pygi-closure.c:635
...
```
To ease downstreams narrowing down the actual problem let's
provide a knob to disable exec static trampolines.
The change for not affect current default.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Remove caveat about varargs support
Update contact info
configure.ac: allow user to specify READELF (#646)
Before the change with x86_64-pc-linux-gnu cross-compiler
installed the configure was not able to find cross-readelf:
```
$ ./configure --host=x86_64-pc-linux-gnu
...
checking whether .eh_frame section should be read-only... .././configure: line 19540: readelf: command not found
yes
...
```
The change uses AC_CHECK_TOOL to automatically seatch for ${host}-readelf,
readelf. And as a bonus it also allows user to override readelf with
something like READELF=llvm-readelf.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Make 3.4 release candidate 1
Add missing file from make dist. Add missing license info.
Remove test case
This test includes a closure and must live in the closures test directory. (#645)
Co-authored-by: Matthew Green <squidhacks@users.noreply.github.com>
Make test methods static (#644)
Switch from travis-ci.org to travis-ci.com.
Avoid undefined behaviour
Remove libtool-ldflags file from .gitignore (#600)
This is correct. Thank you!
2021-06-15 Jakub Jelinek <jakub@redhat.com>
* src/x86/ffi64.c (classify_argument): For FFI_TYPE_STRUCT set words
to number of words needed for type->size + byte_offset bytes rather
than just type->size bytes. Compute pos before the loop and check
total size of the structure.
* testsuite/libffi.call/nested_struct12.c: New test.
Don't stop test on copy failure (#636)
* Don't stop test on copy failure
Static-library tests were failing only because there were
no DLLs to copy. This change makes a copy failure not stop
the build; if a failed copy would otherwise be relevent, the
later tests would fail anyway.
While there are more clever ways to solve this, a brute force
fix is sufficient.
* [TEST] Try cygwin64; install more packages explicitly
* use correct cygwin64 directory name
appveyor has cygwin64 pre-installed in /cygwin64, and 32-bit cygwin
in /cygwin
* More testing - revert VS change, bump travis timeout
* Add -g to update the rest of perl
* Skip execution tests on non-native platforms
Special site.exp that skips the unix_load() command for arm platforms.
Unset TERM to avoid cruft in stdout
Try harder to find the libffi libraries
Fix build on OpenBSD/mips64 (#638)
The build fails on OpenBSD/mips64 because clang 11's integrated
assembler expects read-only .eh_frame:
../src/mips/n32.S:585:9: error: changed section flags for .eh_frame, expected: 0x2
.section .eh_frame,"aw",@progbits
^
Use EH_FRAME_FLAGS to get matching flags for the section.
Add struct test to verify a nested float struct (#640)
The test aims to check a nested float struct
[float, [float,float]] to see whether it works good
with libffi.
Signed-off-by: Cheng Jin <jincheng@ca.ibm.com>
Remove reference to old test case
Revert appveyor changes
Update vs version
Upgrade to vs2019
Try updating automake
Bring in the latest version of perl
Fix building for arm windows with mingw toolchains (#631)
* arm: Check _WIN32 instead of _M_ARM or _MSC_VER for detecting windows
This matches what was done for ARM64 in
c06468fa6674d3783a0edb1d0fae9afc8bc28513.
* arm: Only use armasm source when building with MSVC
When building for windows/arm with clang, the normal gas style .S
source works fine (if fixed up to support thumb and other windows
specifics).
This matches what was done for ARM64 in
c06468fa6674d3783a0edb1d0fae9afc8bc28513.
* arm: Fix sysv.S to work in thumb mode
Align cases in jump tables (adding nop padding to make sure each
case starts where expected).
Rewrite instructions that add directly to the pc register.
For ffi_closure_ret, factor out a call_epilogue subroutine that
restores both sp and pc from the stack; the thumb version of ldm
can't load into the sp register. To avoid excessive ifdeffing, keep
using call_epilogue in arm mode, but keep the shorter "ldm sp, {sp, pc}"
epilogue in that case.
* arm: Add win32 version of trampoline to sysv.S
This matches the version of it in sysv_msvc_arm32.S. The calling
C code expects a specific form of the trampoline on windows; make
sure these work the same on windows regardless of the form of
assembly used.
* arm: Avoid optimizing out clearing the thumb bit of ffi_arm_trampoline
We clear the thumb bit of ffi_arm_trampoline with a bitmask before
memcpying its instructions into closure->tramp.
If the bit isn't cleared, the memcpy of the trampoline function
copies the wrong instructions.
If the ffi_arm_trampoline symbol is declared as an array of int,
the compiler can assume that it is aligned to a 4 byte boundary
and the bitmask operation is a no-op, and optimize it out.
See https://godbolt.org/z/dE3jE1WTz; both Clang and GCC optimize
out the bitmask as it is, while MSVC doesn't. By declaring the
trampoline as an array of unsigned char, the bitmask works as
intended.
Verbose brew update.
Move container images to quay.io.
testsuite: fix compiler vendor detection on dash as /bin/sh (#594)
In https://bugs.gentoo.org/753299 Paolo Pedroni reported
a single test failure out of all libffi. Here is the minimal
reproducer:
```
$ ./autogen
$ CONFIG_SHELL=/bin/dash ./configure --host=x86_64-pc-linux-gnu
$ make check RUNTESTFLAGS='complex.exp'
...
FAIL: libffi.complex/cls_align_complex_float.c (test for excess errors)
```
This happens because under 'dash' shell autoconf generates slightly
different style of string quotation in `config.log`:
- on bash: `ax_cv_c_compiler_vendor=gnu`
- on dash: `ax_cv_c_compiler_vendor='gnu'`
To avoid shell quotation parsing the change just embeds
`compiler_vendor` into `local.exp` at configure time.
Reported-by: Paolo Pedroni
Bug: https://bugs.gentoo.org/753299
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
arm64e: Pull in pointer authentication code from Apple's arm64e libffi port (#565)
NOTES: This changes the ptrauth support from #548 to match what Apple is
shipping in its libffi-27 tag.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
fix windows tests (#595)
* Update .appveyor.yml
* add (debug+release)*(shared+static) CI
* fix libversion
x86: Fix thiscall and fastcall stack cleanup behavior (#611)
These are meant to use callee clean-up.
Mention MSVC runtime stack checking improvement
x86: Fix MSVC runtime checks interop (#612)
MSVC can add runtime code that checks if a stack frame is mismanaged,
however our custom assembly deliberately accesses and modifies the parent
stack frame. Fortunately we can disable that specific check for the
function call so do that.
Co-authored-by: Matthew Waters <matthew@centricular.com>
Mention LIBFFI_TMPDIR
Search $LIBFFI_TMPDIR also (#605)
Most temp file directories need to be hardened against execution, but
libffi needs execute privileges. Add a libffi-specific temp directory
that can be set up by sysadmins as needed with suitable permissions.
This both ensures that libffi will have a valid temp directory to use
as well as preventing attempts to access other directories.
aarch64: Fix closures for win64 (#606)
Update ax_cc_maxopt m4 macro (#617)
Keeps libffi's specific changes
(https://github.com/libffi/libffi/commit/cec3a3a201f17a7f018f25e1a0917bd5206e5a5a#diff-2396a1256ac4b1c6849c931ddb8018bdd984bb2383be21bb819a33b95d8d603f)
and updates to the latest ax_cc_maxopt.m4
(http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=73ee1b396c21062ee8eeb8721ba5323322110fb5):
ax_cc_maxopt.m4: retain setting of CFLAGS by configure
AX_CC_MAXOPT checks whether CFLAGS was set by the user; if so, the user’s
setting is respected. This behavior is retained, of course.
However, AX_CC_MAXOPT was then setting CFLAGS="". This overrode the default
setting by configure, which usually includes -g. Hence, if CFLAGS was not
set by the user, retain the default setting, to preserve the ability to
debug.
A typical default setting from configure is "-g -O2". This means that
AX_CC_MAXOPT might typically set CFLAGS to "-g -O2 -O3". This is fine,
because the later -O3 will override the earlier -O2. (The only assumption is
that all compilers that AX_CC_MAXOPT knows behave in this sane way.)
Fix formatting
Mention KVX
Bug #680. Don't accept floats or small ints as var args. (#628)
* Bug #680. Don't accept floats or small ints as var args.
* Bug #680. Don't accept floats or small ints as var args.
* Bug #680. Don't accept floats or small ints as var args.
Add some missing #if conditionals from Apple's code drop (#620)
* arm/aarch64: Add FFI_CLOSURES conditionals where appropriate
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch64: Don't emit the do_closure label when building without FFI_GO_CLOSURES
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Add configuration generator for tvOS and watchOS. (#625)
Static tramp v5 (#624)
* Static Trampolines
Closure Trampoline Security Issue
=================================
Currently, the trampoline code used in libffi is not statically defined in
a source file (except for MACH). The trampoline is either pre-defined
machine code in a data buffer. Or, it is generated at runtime. In order to
execute a trampoline, it needs to be placed in a page with executable
permissions.
Executable data pages are attack surfaces for attackers who may try to
inject their own code into the page and contrive to have it executed. The
security settings in a system may prevent various tricks used in user land
to write code into a page and to have it executed somehow. On such systems,
libffi trampolines would not be able to run.
Static Trampoline
=================
To solve this problem, the trampoline code needs to be defined statically
in a source file, compiled and placed in the text segment so it can be
mapped and executed naturally without any tricks. However, the trampoline
needs to be able to access the closure pointer at runtime.
PC-relative data referencing
============================
The solution implemented in this patch set uses PC-relative data references.
The trampoline is mapped in a code page. Adjacent to the code page, a data
page is mapped that contains the parameters of the trampoline:
- the closure pointer
- pointer to the ABI handler to jump to
The trampoline code uses an offset relative to its current PC to access its
data.
Some architectures support PC-relative data references in the ISA itself.
E.g., X64 supports RIP-relative references. For others, the PC has to
somehow be loaded into a general purpose register to do PC-relative data
referencing. To do this, we need to define a get_pc() kind of function and
call it to load the PC in a desired register.
There are two cases:
1. The call instruction pushes the return address on the stack.
In this case, get_pc() will extract the return address from the stack
and load it in the desired register and return.
2. The call instruction stores the return address in a designated register.
In this case, get_pc() will copy the return address to the desired
register and return.
Either way, the PC next to the call instruction is obtained.
Scratch register
================
In order to do its job, the trampoline code would need to use a scratch
register. Depending on the ABI, there may not be a register available for
scratch. This problem needs to be solved so that all ABIs will work.
The trampoline will save two values on the stack:
- the closure pointer
- the original value of the scratch register
This is what the stack will look like:
sp before trampoline ------> --------------------
| closure pointer |
--------------------
| scratch register |
sp after trampoline -------> --------------------
The ABI handler can do the following as needed by the ABI:
- the closure pointer can be loaded in a desired register
- the scratch register can be restored to its original value
- the stack pointer can be restored to its original value
(the value when the trampoline was invoked)
To do this, I have defined prolog code for each ABI handler. The legacy
trampoline jumps to the ABI handler directly. But the static trampoline
defined in this patch jumps tp the prolog code which performs the above
actions before jumping to the ABI handler.
Trampoline Table
================
In order to reduce the trampoline memory footprint, the trampoline code
would be defined as a code array in the text segment. This array would be
mapped into the address space of the caller. The mapping would, therefore,
contain a trampoline table.
Adjacent to the trampoline table mapping, there will be a data mapping that
contains a parameter table, one parameter block for each trampoline. The
parameter block will contain:
- a pointer to the closure
- a pointer to the ABI handler
The static trampoline code would finally look like this:
- Make space on the stack for the closure and the scratch register
by moving the stack pointer down
- Store the original value of the scratch register on the stack
- Using PC-relative reference, get the closure pointer
- Store the closure pointer on the stack
- Using PC-relative reference, get the ABI handler pointer
- Jump to the ABI handler
Mapping size
============
The size of the code mapping that contains the trampoline table needs to be
determined on a per architecture basis. If a particular architecture
supports multiple base page sizes, then the largest supported base page size
needs to be chosen. E.g., we choose 16K for ARM64.
Trampoline allocation and free
==============================
Static trampolines are allocated in ffi_closure_alloc() and freed in
ffi_closure_free().
Normally, applications use these functions. But there are some cases out
there where the user of libffi allocates and manages its own closure
memory. In such cases, static trampolines cannot be used. These will
fall back to using legacy trampolines. The user has to make sure that
the memory is executable.
ffi_closure structure
=====================
I did not want to make any changes to the size of the closure structure for
this feature to guarantee compatibility. But the opaque static trampoline
handle needs to be stored in the closure. I have defined it as follows:
- char tramp[FFI_TRAMPOLINE_SIZE];
+ union {
+ char tramp[FFI_TRAMPOLINE_SIZE];
+ void *ftramp;
+ };
If static trampolines are used, then tramp[] is not needed to store a
dynamic trampoline. That space can be reused to store the handle. Hence,
the union.
Architecture Support
====================
Support has been added for x64, i386, aarch64 and arm. Support for other
architectures can be added very easily in the future.
OS Support
==========
Support has been added for Linux. Support for other OSes can be added very
easily.
Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
* x86: Support for Static Trampolines
- Define the arch-specific initialization function ffi_tramp_arch ()
that returns trampoline size information to common code.
- Define the trampoline code mapping and data mapping sizes.
- Define the trampoline code table statically. Define two tables,
actually, one with CET and one without.
- Introduce a tiny prolog for each ABI handling function. The ABI
handlers addressed are:
- ffi_closure_unix64
- ffi_closure_unix64_sse
- ffi_closure_win64
The prolog functions are called:
- ffi_closure_unix64_alt
- ffi_closure_unix64_sse_alt
- ffi_closure_win64_alt
The legacy trampoline jumps to the ABI handler. The static
trampoline jumps to the prolog function. The prolog function uses
the information provided by the static trampoline, sets things up
for the ABI handler and then jumps to the ABI handler.
- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
initialize static trampoline parameters.
Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
* i386: Support for Static Trampolines
- Define the arch-specific initialization function ffi_tramp_arch ()
that returns trampoline size information to common code.
- Define the trampoline code table statically. Define two tables,
actually, one with CET and one without.
- Define the trampoline code table statically.
- Introduce a tiny prolog for each ABI handling function. The ABI
handlers addressed are:
- ffi_closure_i386
- ffi_closure_STDCALL
- ffi_closure_REGISTER
The prolog functions are called:
- ffi_closure_i386_alt
- ffi_closure_STDCALL_alt
- ffi_closure_REGISTER_alt
The legacy trampoline jumps to the ABI handler. The static
trampoline jumps to the prolog function. The prolog function uses
the information provided by the static trampoline, sets things up
for the ABI handler and then jumps to the ABI handler.
- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
initialize static trampoline parameters.
Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
* arm64: Support for Static Trampolines
- Define the arch-specific initialization function ffi_tramp_arch ()
that returns trampoline size information to common code.
- Define the trampoline code mapping and data mapping sizes.
- Define the trampoline code table statically.
- Introduce a tiny prolog for each ABI handling function. The ABI
handlers addressed are:
- ffi_closure_SYSV
- ffi_closure_SYSV_V
The prolog functions are called:
- ffi_closure_SYSV_alt
- ffi_closure_SYSV_V_alt
The legacy trampoline jumps to the ABI handler. The static
trampoline jumps to the prolog function. The prolog function uses
the information provided by the static trampoline, sets things up
for the ABI handler and then jumps to the ABI handler.
- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
initialize static trampoline parameters.
Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
* arm: Support for Static Trampolines
- Define the arch-specific initialization function ffi_tramp_arch ()
that returns trampoline size information to common code.
- Define the trampoline code mapping and data mapping sizes.
- Define the trampoline code table statically.
- Introduce a tiny prolog for each ABI handling function. The ABI
handlers addressed are:
- ffi_closure_SYSV
- ffi_closure_VFP
The prolog functions are called:
- ffi_closure_SYSV_alt
- ffi_closure_VFP_alt
The legacy trampoline jumps to the ABI handler. The static
trampoline jumps to the prolog function. The prolog function uses
the information provided by the static trampoline, sets things up
for the ABI handler and then jumps to the ABI handler.
- Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to
initialize static trampoline parameters.
Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Use memfd_create() (#604)
memfd_create creates a file in a memory-only filesystem that may
bypass strict security protocols in filesystem-based temporary
files.
libffi/x86: Always check __x86_64__ for x32 hosts (#601) (#602)
Since for x86_64-*x32 and x86_64-x32-* hosts, -m32 generates ia32 codes.
We should always check __x86_64__ for x32 hosts.
Properly quote and resolve msvcc.sh params (#596)
Allow to build with mingw-clang (#579)
For some reason, compiling sysv.S with mingw-clang fails with:
```
error: invalid variant 'ffi_closure_inner@8'
```
This can be fixed (worked around?) by quoting the symbol. This works
fine with mingw-gcc too.
Don't use FFI_TYPE_LONGDOUBLE in the jump table in win64*.S (#580)
It may have the same value as FFI_TYPE_DOUBLE per ffi.h, which
possibly can make things go wrong with .org/ORG.
For instance, GCC complains about "Error: attempt to move .org
backwards"
aarch64: Allow FFI_WIN64 for winelib (#593)
Add support for powerpc64le-*-freebsd*. (#581)
Tests pass with no additional changes needed, tested on hardware.
darwin powerpc: use go closures only if enabled (#583)
SHA: 0ff9419f2e75652426469e256cb7d0748064ad58 added go closures for darwin powerpc AIX, but
these have not yet been implemented for non-AIX systems
use the go closures only if enabled
Support building x86 and arm64 without FFI_GO_CLOSURES (#586)
* x86: Support building without FFI_GO_CLOSURES
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* arm: Support building without FFI_GO_CLOSURES
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
testsuite: Add a missing include of <inttypes.h> to fix build failure in test suite (#587)
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Removing unnecessary instruction from ffi_call_unix64 (#588)
unix64.S's `ffi_call_unix64` looks like it used to take six parameters,
where the sixth said the number of SSE register arguments. However,
currently the function only takes five parameters, and the number of SSE
register arguments is encoded in the `struct register_args *` passed as
the first parameter to `ffi_call_unix64`. This change removes an
instruction that tries to use this missing sixth parameter as the number
of SSE arguments.
This fix should not change any behavior, nor fix any bugs, because a few
instructions later the value moved from %r9d into %eax is overwritten by
the correct value anyway. This change merely makes the code a tad less
confusing, because currently the assembly moves from a register (r9)
whose value is never set.
Fix read-only .eh_frame section test when CFLAGS contains -flto. (#590)
Power10 libffi fixes (#585)
Power10 pc-relative code doesn't use or preserve r2 as a TOC pointer.
That means calling between pc-relative and TOC using code can't be
done without intervening linker stubs, and a call from TOC code to
pc-relative code must have a nop after the bl in order to restore r2.
Now the PowerPC libffi assembly code doesn't use r2 except for the
implicit use when making calls back to C, ffi_closure_helper_LINUX64
and ffi_prep_args64. So changing the assembly to interoperate with
pc-relative code without stubs is easily done.
* src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global
entry when __PCREL__. Call using @notoc. Add nops.
* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise.
(ffi_go_closure_linux64): Likewise.
docs: fix simple typo, paramters -> parameters (#589)
There is a small typo in src/x86/ffi.c.
Should read `parameters` rather than `paramters`.
Re-enable s390x testing
Upstream local FreeBSD patches (#567)
* Add support for FreeBSD mips
Add support for FreeBSD mips, this has been a local patch in the FreeBSD
ports tree for quite some time.
Originally submitted by sson, and committed by sbruno AT FreeBSD DOT org
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191909 for
background details.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* Add support for FreeBSD powerpcspe
Add support for powerpcspe on FreeBSD
This has been in the FreeBSD ports tree for some time.
Originally submitted by jhibbits AT FreeBSD DOT org.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
* Fix abort() on FreeBSD arm related to __clear_cache()
This patch has been in the FreeBSD ports tree for a number of years.
Original commit by koobs AT FreeBSD DOT org
Original commit message:
> devel/libffi: Fix abort() on ARM related to __clear_cache()
>
> The current FreeBSD/ARM __clear_cache() implementation does nothing #if
> __i386__ || __x86_64__ #else abort();
>
> cognet@ advises this is an issue for anything !Apple that is using the
> libcompiler_rt provided by Clang on ARM, and requires upstreaming.
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=149167 for some
background details.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
Don't test s390. Travis-ci is broken.
Add support for eabisim back. This was removed upstream.
Merge pull request #576 from froydnj/config-updates
update config.{guess,sub}
update config.{guess,sub}
This change is primarily for aarch64 macOS support, since that configuration
is now properly supported upstream.
Merge pull request #570 from jwilk-forks/spelling
aarch64: Fix typo
aarch64: Fix typo
Add support for csky
Makefile: increase compatibility with bmake (#551)
Fixes macOS build on Python 3 (#563)
The error was:
```
Traceback (most recent call last):
File "_generate-darwin-source-and-headers.py", line 209, in <module>
generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx)
File "_generate-darwin-source-and-headers.py", line 197, in generate_source_and_headers
for header_name, tag_tuples in platform_headers.iteritems():
AttributeError: 'collections.defaultdict' object has no attribute 'iteritems'
```
Fix Free software foundation address (#564)
ref. https://www.fsf.org/about/contact/
Add gcc bug tests back
Add support for Kalray KVX architecture (#559)
ffi_powerpc.h: fix build failure with powerpc7 (#561)
This is a patch pulled down from the following:
https://github.com/buildroot/buildroot/blob/78926f610b1411b03464152472fd430012deb9ac/package/libffi/0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch
This issue is being hit on OpenBMC code when pulling the latest
libffi tag and building on a P8 ppc64le machine. I verified this
patch fixes the issue we are seeing.
Below is the original commit message:
Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7
fails on:
In file included from ../src/powerpc/ffi.c:33:0:
../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target
typedef _Float128 float128;
^~~~~~~~~
Fix this build failure by checking for __HAVE_FLOAT128 before using
_Float128, as _Float128 is enabled only on specific conditions, see
output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h:
/* Defined to 1 if the current compiler invocation provides a
floating-point type with the IEEE 754 binary128 format, and this glibc
includes corresponding *f128 interfaces for it. */
#if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
&& defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH
# define __HAVE_FLOAT128 1
#else
# define __HAVE_FLOAT128 0
#endif
Fixes:
- http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Co-authored-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
arm: Fix the clang specific version of the assembly (#556)
Also fix the same error in the comment for the non-clang case.
That typo there seems to have existed since the code was written
in that form, in e7f15f60e86 - and when the clang specific codepath
was added in e3d2812ce43, the typo in the comment made it into the
actual code.
win64_armasm: Fix the spelling of ALIGN (#553)
Use __builtin_ffs instead of ffs (#554)
USE_BUILTIN_FFS is defined to 1 within __GNUC__, and the __builtin_ffs
function is available since GCC 3.x at least, while the ffs function
only exists on some OSes.
This fixes compilation for non-x86 mingw platforms. For x86,
USE_BUILTIN_FFS is explicitly disabled for windows targets - but
if USE_BUILTIN_FFS is enabled based on __GNUC__, it should also use
the builtin which actually is available correspondingly, not dependent
on the target OS.
Fix building for aarch64 windows with mingw toolchains (#555)
* aarch64: Check _WIN32 instead of _M_ARM64 for detecting windows
This fixes building for aarch64 with mingw toolchains. _M_ARM64 is
predefined by MSVC, while mingw compilers predefine __aarch64__.
In aarch64 specific code, change checks for _M_ARM64 into checks for
_WIN32.
In arch independent code, check for
(defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32)
instead of just _M_ARM64.
In src/closures.c, coalesce checks like
defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64)
into plain defined(_WIN32). Technically, this enables code for
ARM32 windows where it wasn't, but as far as I can see it, those
codepaths should be fine for that architecture variant as well.
* aarch64: Only use armasm source when building with MSVC
When building for windows/arm64 with clang, the normal gas style .S
source works fine. sysv.S and win64_armasm.S seem to be functionally
equivalent, with only differences being due to assembler syntax.
Improve read-write .eh_frame check (#546)
llvm-objdump -h does not print BFD SEC_* constants like "READONLY",
so the check will consider .eh_frame writable.
clang 11 (since https://reviews.llvm.org/D73999) will error for mismatching section flags.
Use readelf -S and check "WA" instead.
Mention ARM Pointer Authentication
Test on aarch64 Linux with clang
Port to iOS/arm64e (#548)
Try to fix RLGL_KEY nonsense (#547)
* Try to fix RLGL_KEY nonsense
* Hard code policy bound API key
Co-authored-by: Anthony Green <green@moxielogic.com>
Revamp PA_LINUX and PA_HPUX target closures to use function descriptors.
2020-02-23 John David Anglin <danglin@gcc.gnu.org>
* include/ffi.h.in (FFI_CLOSURE_PTR, FFI_RESTORE_PTR): Define.
* src/closures.c (ffi_closure_alloc): Convert closure pointer
return by malloc to function pointer.
(ffi_closure_free): Convert function pointer back to malloc pointer.
* src/pa/ffi.c (ffi_closure_inner_pa32): Use union to double word
align return address on stack. Adjust statements referencing return
address. Convert closure argument from function pointer to standard
closure pointer.
(ffi_prep_closure_loc): Likewise convert closure argument back to
closure pointer. Remove assembler trampolines. Setup simulated
function descriptor as on ia64.
src/pa/ffitarget.h (FFI_TRAMPOLINE_SIZE): Reduce to 12.
src/pa/hpux32.S (ffi_closure_pa32): Retrieve closure pointer and real
gp from fake gp value in register %r19.
src/pa/linux.S (ffi_closure_pa32): Likewise.
Update the ABI version to LIBFFI_BASE_8.0 (#544)
Since x86 and x86-64 FFI_TRAMPOLINE_SIZE have been increased, we must
bump the ABI version. This fixes:
https://github.com/libffi/libffi/issues/543
x86: Fix ffi_prep_closure_loc (#542)
Since FFI_TRAMPOLINE_SIZE is increased by 4 bytes to add ENDBR32, adjust
jump displacement by 4 bytes.
Merge branch 'master' of github.com:/libffi/libffi
Update for pending 3.4 release.
x86: Add indirect branch tracking support (#540)
Intel Control-flow Enforcement Technology (CET):
https://software.intel.com/en-us/articles/intel-sdm
contains shadow stack (SHSTK) and indirect branch tracking (IBT). When
CET is enabled, ELF object files must be marked with .note.gnu.property
section. When Intel CET is enabled, include <cet.h> in assembly codes
to mark Intel CET support.
Also when IBT is enabled, all indirect branch targets must start with
ENDBR instruction and notrack prefix can be used to disable IBT on
indirect branch. <cet.h> defines _CET_ENDBR which can be used in
assembly codes for ENDBR instruction. If <cet.h> isn't included,
define _CET_ENDBR as empty so that _CET_ENDBR can be used in assembly
codes.
Trampoline must be enlarged to add ENDBR instruction unconditionally,
which is NOP on non-CET processors. This is required regardless if
libffi is enabled with CET since libffi.so will be marked in legacy
bitmap, but trampoline won't. Update library version for larger
FFI_TRAMPOLINE_SIZE.
This fixed:
https://github.com/libffi/libffi/issues/474
Tested with
$ CC="gcc -Wl,-z,cet-report=error -fcf-protection" CXX="g++ -Wl,-z,cet-report=error -fcf-protection" .../configure
on Linux CET machines in i686, x32 and x86-64 modes.
Update powerpc sysv assembly for ffi_powerpc.h changes (#541)
Some of the flag bits were moved when adding powerpc64 vector support.
Fixes #536
Update copyright year.
Fix script
Use rlgl API key on login
powerpc64: Use memcpy to help platforms with no __int128. (#534)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Remove 32-bit x86 file references to fix macosx builds
Fixed missed #ifndef for __mips_soft_float (#442)
Thank you!
Clean up macosx builds
Address platforms with no __int128.
Make build errors easier to debug
Add powerpc-eabi
Test on powerpc-eabisim
powerpc: fix build failure on power7 and older (#532)
Build failure looks as:
```
libtool: compile: powerpc-unknown-linux-gnu-gcc \
-O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ...
In file included from src/powerpc/ffi.c:33:
src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target
65 | typedef __int128 float128;
| ^~~~~~~~
```
The fix avoids using __int128 in favour of aligned char[16].
Closes: https://github.com/libffi/libffi/issues/531
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Run aarch64-linux-gnu tests on travi-ci directly
Fixes for ppc64le and s390x travis testing
Force the use of docker
Merge branch 'master' of github.com:libffi/libffi
Try travis-ci's new ppc64le and s390x support
disable obsolete 32-bit targets in macOS (#511)
Minor clean-up
Move nested_struct3 test to closures directory
Add missing closing brace
Version 3.3
Remove junk file from dist
Account for moved test files
Add dejagnu directives accidentally removed
Move closure test to closure directory
More more closure tests to the closure test directory
Merge branch 'master' of github.com:libffi/libffi
Move closure tests so we can easily XFAIL them for some targets
Remove gccbug detection. GCC is good now.
Capture x86-windows host like x86_64-windows (#529)
Manual clean-ups, and include the PDF in the source distribution.
Mention more major port contributors
Update autoconf-archive m4 macros
Fix formatting of README.
Fix or1k lack-of-g++ checking in testsuite
Add work-around for users who manage their own closure memory
As suggested by DJ
No C++ for or1k-unknown-elf
No C++ for or1k
Disable type warnings for or1k.
No c++ for or1k-elf
Fake TRAVIS_BUILD_DIR
Adapt for new old ChangeLog file
Fix DEJAGNU variable
Set vars
Remove verbosity
Pull before running
Fix cross builds for or1k
More cross build debugging
Set path to simulator. Add debugging output.
Be specific when building CI container images
Capture more or1k hosts
Add test support for or1k. Fix yaml typo.
Fix typo for m32r and bfin builds
Merge branch 'master' of github.com:libffi/libffi
Build/test for m32r-elf and bfin-elf
Mention binary128 long double support for Power
IEEE754 binary128 long double support for PowerPC64 (#526)
* powerpc: Adjust flags to make room for vector types
* powerpc64 ELFv2 IEEE128 long double support
Re-enable mingw32 tests.
Disable wine builds.
Stretch out timeout for test
Consolidate all of the old ChangeLog files into ChangeLog.old.
Don't build aarch64-linux-gnu
Extend timeout for builds.
Platform test tweaks
Mark java raw APIs as deprecated.
Disable mips64 tests. Fix log grabbing.
Re-add wine based testing
Add wine-sim.exp for wine-based testing
Fix log file URL extraction. Grab rlgl cli for OSX
Fix log name extraction
Account for shorter ==LOGFILE== string
Fix grep matcher
Debug
Pull test logs from cfarm
Use rlgl for cfarm test results
Use rlgl for cross builds.
Always exit build container successfully. Don't test mingw.
Run rlgl outside of the build container.
Don't bother dumping logs. Use rlgl instead.
Fix rlgl usage
Test rlgl
Debug in-container builds
Build both iOS and Macosx
Fix tpyo
Change s390x options
Mark xfail for m68k and alpha.
Clean up. Debug s390x cpu support.
Try coldfire for m68k builds
Add GCC_OPTIONS flag
Compile m68k target for m5208
Dump supported CPUs
Fix shell script
Print debug output. Use podman when available.
Set QEMU_CPU within the build containers
Set QEMU_CPU for m68k
Add alpha and m68k testing
Sett CC and CXX for cross builds
autogen before cross building
Fix typo. Don't double test.
Use the right cross build container image
Try s390x and sh4 cross builds/tests
Revert to older test cross compilers
Use older test compiler. Enable s390x testing.
Test cross-builds for hppa-linux-gnu
Reference FFI_BUILDING_DLL
rc2. hack as per: https://github.com/travis-ci/travis-ci/issues/6934
Add sparc64-linux-gnu testing back
Don't build sparc. Build mips.
Test mips64el-linux-gnu
Don't run autogen.sh all the time.
Test sparc64-linux-gnu on travis
Try new cfarm build for power
Add make_sunver.pl to distribution.
Fix FFI_STDCALL ABI (#514)
Even for a stdcall function, the stack alignment is still the
responsibility of the caller. Remember the original, not stack-aligned
argument size, but align when setting up a stack frame. In
ffi_closure_inner, return the true argument size, so that
ffi_[go_]closure_STDCALL doesn't adjust too much.
Add missing build script, make_sunver.pl.
Update versions to 3.3-rc1
Remove some debugging output
Don't test ppc64le with buggy qemu.
Strip build status from README.md at 'make dist' time.
Add missing dist files.
Test on arm32v7-linux-gnu, ppc64le-linux-gnu and aarch64-linux-gnu.
Use docker images and qemu to test libffi for non-x86 architectures on
travis-ci.
Use the LIBFFI_TEST_OPTIMIZATION environment variable to
force specific optimization levels at test time.
Fix comments.
Update copyright year
Add long double test (#492)
Required to fix build error on macos with gcc-9
Making the change to correct the comment when SUN (#521)
and GCC are used together
handle compilation warnings with ftruncate API (#508)
* fix me: avoid warning while handle ftruncate API
Signed-off-by: Prasad Nallani <prasad.nallani@intel.com>
* Update closures.c
Clean up line endings (#509)
The CLRF visual studio files can be kept that way, but recognized as
text. The assembly file can be converted to LF.
PowerPC bugfixes (#520)
* powerpc: Silence warnings about unused labels
* powerpc: Fix a couple of comments
* powerpc: Fix alignment after float structs
* powerpc: Don't pad rvalues copied from FP regs
* powerpc: Add missing check in struct alignment
* powerpc: Support homogeneous long double structs
Use https for moxie toolchain repo
fix mingw build and crashing bugs for Python Windows ARM64 (#496)
* fix mingw build and crashing bugs for Python Windows ARM64
* Fix issues found in PR review
Clear the apt cache
More debugging output
Debug moxie builds in travis
libffi: added ARM64 support for Windows (#486)
* libffi: added ARM64 support for Windows
1. ported sysv.S to win64_armasm.S for armasm64 assembler
2. added msvc_build folder for visual studio solution
3. updated README.md for the same
4. MSVC solution created with the changes, and below test suites are tested
with test script written in python.
libffi.bhaible
libffi.call
5. Basic functionality of above test suites are getting passed
Signed-off-by: ossdev07 <ossdev@puresoftware.com>
* Update README.md
uuencode compressed log files for travis
hppa: avoid TEXTREL in .eh_frame section (#447)
Before the change hand-crafted .eh_frame section contained
ABS relocation and caused TEXTREL tag to be emitted:
```
$ ./configure --host=hppa2.0-unknown-linux-gnu LDFLAGS=-Wl,-z,text
$ make
...
/usr/libexec/gcc/hppa2.0-unknown-linux-gnu/ld:
read-only segment has dynamic relocations.
```
Link failure is caused by absolute address of FDEs
encoded into .eh_frame entries.
Fixed TEXTREL by using pcrel (instead of ABS) encoding
for absolute addresses (__PIC__ code) by adding augmentation
information ("zR" CIE type).
All tests still pass on hppa2.0. The specific tests that still pass
and exercise this code path:
testsuite/libffi.call/unwindtest.cc
testsuite/libffi.call/unwindtest_ffi_call.cc
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
fix x86/x64 MSVC build (#487)
add support for 32-bit ARM on Windows (#477)
* add support for 32-bit ARM on Windows
* fix mismatched brace in appveyor.yml
* remove arm platform from appveyor.yml for now
* fix arm build
* fix typo
* fix assembler names
* try Visual Studio 2017
* add windows arm32 to .appveyor.yml
* update README.md
Merge pull request #482 from sharkcz/aarch64
fix check for Linux/aarch64
fix check for Linux/aarch64
fixes #473
Cleanup symbol exports on darwin and add architecture preprocessor checks to assist in building fat binaries (eg: i386+x86_64 on macOS or arm+aarch64 on iOS) (#450)
* x86: Ensure _efi64 suffixed symbols are not exported
* x86: Ensure we do not export ffi_prep_cif_machdep
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* x86: Ensure we don't export ffi_call_win64, ffi_closure_win64, or ffi_go_closure_win64
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* closures: Silence a semantic warning
libffi/src/closures.c:175:23: This function declaration is not a prototype
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch64: Ensure we don't export ffi_prep_cif_machdep
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* arm: Ensure we don't export ffi_prep_cif_machdep
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch64, arm, x86: Add architecture preprocessor checks to support easier fat builds (eg: iOS)
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* x86: Silence some static analysis warnings
libffi/src/x86/ffi64.c:286:21: The left operand of '!=' is a garbage value due to array index out of bounds
libffi/src/x86/ffi64.c:297:22: The left operand of '!=' is a garbage value due to array index out of bounds
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* aarch: Use FFI_HIDDEN rather than .hidden
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* ffi.h: Don't advertise ffi_java_rvalue_to_raw, ffi_prep_java_raw_closure, and ffi_prep_java_raw_closure_loc when FFI_NATIVE_RAW_API is 0
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Fix cfi checks for old compiler (#453)
cfi_sections can be unsupported when cfi_startproc
and cfi_endproc are.
changes for win32 on windows (#468)
aarch64: Flush code mapping in addition to data mapping (#471)
This needs a new function, ffi_data_to_code_pointer, to translate
from data pointers to code pointers.
Fixes issue #470.
Remove -Os testing. No ABI impact, and helps trim log lengths.
Merge pull request #461 from NativeScript/bektchiev/fix-visibility-hidden-check-in-configure
fix(configure): Correctly detect visibility("hidden") support on Darwin
fix(configure): Correctly detect visibility("hidden") support on Darwin
Merge pull request #457 from NativeScript/bektchiev/fix-arm64-q3-q4-args
Fix Q registers parameter passing on ARM64
Fix Q registers parameter passing on ARM64
The second two quads are located at offset 32 not 16
Merge pull request #443 from jeremyhu/master
Update FFI_HIDDEN() to use .private_extern on Apple platforms and use the macro where appropriate
Merge pull request #449 from gpakosz/align-macros
Prefix ALIGN_DOWN macro with FFI_
Prefix ALIGN_DOWN macro with FFI_
Merge pull request #445 from andreas-schwab/master
RISC-V go closures
RISC-V go closures
This implements go closures for RISC-V. It has been tested on
riscv64-suse-linux and against the libgo testsuite.
Update FFI_HIDDEN() to use .private_extern on Apple platforms and use the macro where appropriate
Fix issue #439
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
Add compact unwind for darwin/i386 (#440)
* x86: Add implementation of compact unwind for ffi_call_i386, et al.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* x86: Use __text as the section name to avoid deprecated section name warnings.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* darwin: Add missing regular,debug attributes for compact unwind sections
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
Mark sysv.S as SafeSEH compatible (#438)
It contains no exception handler, so we can just emit the special
@feat.00 symbol to indicate that it's trivially SafeSEH compatible.
SafeSEH only applies to x86 and not x86-64, hence its inclusion in the
x86-specific block. See [1] for details.
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx#the_.sxdata_section_
i386: Fix missing break; in case statement leading to incorrectly returned FFI_BAD_ABI (#437)
* i386: Add missing break triggering dead store static analyzer checks.
Register calling sequence is being reported as bad ABI instead of working as intended.
Found-by: Clang Static Analysis
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* Mark ffi arm sysv entry points as private_extern.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* x86_64: Add implementation of compact unwind for ffi_call_unix64.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Handle FFI_GNUW64 on non-Windows systems (EFI)
Mark some cases as xfail due to GCC bug
Revert "Remove some symbol exports and cleanup newline warnings (#433)"
This reverts commit a5a0f3cf36dfb4d64316414a872288c3170e6c1d.
Remove some symbol exports and cleanup newline warnings (#433)
* build: Ensure darwin generated sources end with a new line
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
* build: Use .private_extern where missing to prevent exporting symbols that are not API
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
Re-enable msabi testing (#436)
* Revert "disable msabi testing for now"
This reverts commit 7b7638eb0eac2adfa72f7ec9f254ba287c9947e2.
* x86: Correct testing for 64-bit x86-64
Since passing -m32 to x86-64 compiler will generate i386 code, we
need to check both __ILP32__ and __i386__ for 64-bit x86-64.
* x86: Check __i386__ instead of i?86-*-* targets
Since passing -m32 to x86-64 compiler will generate i386 code, we need
to check __i386__ instead of i?86-*-* targets for i386 targets.
* i386: Properly passing integer parameters in registers
For thiscall and fastcall, if the paramter passed as 64-bit integer or
struct, all following integer paramters will be passed on stack.
* test: Add ABI_ATTR to callback_code
Add ABI_ATTR to callback_code to properly test different ABIs.
PowerPC64 ELFv1 fp arg fixes
The ELFv1 ABI says: "Single precision floating point values are mapped
to the second word in a single doubleword" and also "Floating point
registers f1 through f13 are used consecutively to pass up to 13
floating point values, one member aggregates passed by value
containing a floating point value, and to pass complex floating point
values".
libffi wasn't expecting float args in the second word, and wasn't
passing one member aggregates in fp registers. This patch fixes those
problems, making use of the existing ELFv2 homogeneous aggregate
support since a one element fp struct is a special case of an
homogeneous aggregate.
I've also set a flag when returning pointers that might be used one
day. This is just a tidy since the ppc64 assembly support code
currently doesn't test FLAG_RETURNS_64BITS for integer types..
* src/powerpc/ffi_linux64.c (discover_homogeneous_aggregate):
Compile for ELFv1 too, handling single element aggregates.
(ffi_prep_cif_linux64_core): Call discover_homogeneous_aggregate
for ELFv1. Set FLAG_RETURNS_64BITS for FFI_TYPE_POINTER return.
(ffi_prep_args64): Call discover_homogeneous_aggregate for ELFv1,
and handle single element structs containing float or double
as if the element wasn't wrapped in a struct. Store floats in
second word of doubleword slot when big-endian.
(ffi_closure_helper_LINUX64): Similarly.
Add license for build-time tools
Fix two "return" issues in x86/ffi64.c (#431)
Issue #70 pointed out that at least one compiler didn't like:
return ffi_call_efi64(cif, fn, rvalue, avalue);
... where the return type is "void". This patch splits the statement
into two.
I also noticed that ffi_call_go here seems to do a double call. I
suspect a "return" is missing here, so this patch adds it as well.
Merge pull request #429 from yousong/m4subst
build: fix subst toolexecdir, toolexeclibdir
build: fix subst toolexecdir, toolexeclibdir
On CentOS 7.4, configure script generated by autogen.sh will output the
following values when compiling GCC source code
toolexecdir='NONE/$(target_alias)'
toolexeclibdir='NONE/$(target_alias)/lib'
and cause build error
... -o libffi.la -rpath NONE/riscv64-bs-linux-gnu/lib ...
checking for shl_load in -ldld... libtool: link: only absolute run-paths are allowed
update to https for cygwin download (#428)
xtensa-linux: use cache flush instruction only if it is available (#426)
Various MIPS Fixes (#425)
* mips: simplify closure #defines
This commit should have no visible effect.
* mips: add special handling of variadic functions
MIPS requires special handling of variadic functions which pass floating
point arguments:
* In the o32 ABI, all float arguments are passed in integer registers.
* In the n32/n64 ABIs, float arguments after the ellipsis are passed in
integer registers.
Implement this in libffi. To support this in n32/n64 closures, we need to add
a new mips_nfixedargs field to ffi_cif which will break the libffi ABI.
This fixes the libffi.call/cls_longdouble_va.c test which was failing on
64-bit MIPS.
* mips: align argn for all 64-bit types in o32 closure handler
Ensure that argn is pre-aligned for all 64-bit argument types (including
doubles) and not just integer types.
This fixes closures of the form "f(float, double, <some integer args>)".
Previously the first integer argument would be read from a2 which is garbage
at this point (the float arguments have already "consumed" a0-a3). After
this commit, argn is correctly padded between the "float" and "double"
arguments so that the first integer argument is read from the stack.
Fixes "double f(float,double,int)" test in #371
* mips: do not read from floating point register if returning a struct
In the o32 ABI, the pointer passed in a0 used to return structures
indirectly is treated as the first argument for argument allocation purposes.
This means that it should inhibit floating point registers the same way that
other integer arguments do.
Fixes "Double f(float,Double,double)" test in #371
* mips: fix pointer cast warnings
Fix two pointer cast warnings when compiled on 64-bit mips by casting
through uintptr_t.
Fixes mips64el part of #404
Merge branch 'master' of github.com:/libffi/libffi
Fix case where callback arg value is split across regs and stack
Fix issue #421 (#422)
Fantastic - thanks for digging into this.
3.3 release candidate 0
disable msabi testing for now
Fix appveyor windows build (#420)
* Fix msvcc dll build by adding dllexport decorations to all API declarations
* Fix appveyor build for VS 2013
Use the new -DFFI_BUILDING_DLL for producing a working DLL. Update the
msvcc.sh wrapper script to successfully compile the testsuite files.
* MSVC build: suppress warnings in testsuite
* fix testsuite on appveyor
Trim some optimization tests
Simplify matrix
Remove warning message from clang
Expand ABI tests on x86. Testsuite bug fixes.
deal with msvc warnings
fix quoting issue
Don't ignore a file
Try different msvc hack
msvc c99 hack
More msvc hacks
msvc fixes
Remove debug output
Force literals to float (msvc warning)
Fix msvc linking
Fix library path handling
Deal with libpath
Fix library path handling
Use mixed cygpath paths
Copy - don't symlink - to support msvc builds
Use cygpath to convert windows paths
try to fix windows builds
Reduce verbosity
iOS builds
Fix -L support
Fix quoting
Don't set AM_MAKEFLAGS
Run tests with lots of debug output
Add -L and -l support
Mention C99 and build requirements
Remove reference to wiki
Refactor travis build instructions. Add iOS build
Add issue template
Remove uninitialized warning. Fix #163.
revert
Try bhaible tests in appveyor
Formatting fixes
Add libffi.map.in to extra dist files
Add sparc solaris build notes
Fix formatting
Fix formatting
Don't align-double for 32-bit x86
Remove debug output
Add m4/ax_require_defined.m4
travis debug
Update autoconf archive macros
Add missing FFI_GNUW64 enum
Merge branch 'master' of github.com:/libffi/libffi
Add FFI_GNUW64 ABI for GNU 80-bit long double support
Add FFI_GWIN64 ABI for GNU 80-bit long double support
Fully allocate file backing writable maps (#389)
When ftruncate() is used on a filesystem supporting sparse files,
space in the file is not actually allocated. Then, when the file
is mmap'd and libffi writes to the mapping, SIGBUS is thrown to
the calling application. Instead, always fully allocate the file
that will back writable maps.
Fix return values
Make tests compile/run standalone
Formatting fixes. Add 'bug fixes' note.
xfail unwind tests for moxie
Install moxie libstdc++
Install moxie-elf-g++
Fix closure case where 8-byte value is partially passed in register. Fixes cls_many_mixed_float_double test case.
Run dejagnu's runtest with -a option to prevent travis timeouts after 10min
fix .travis.yml
fix .travis.yml
fix .travis.yml
fix .travis.yml
fix .travis.yml
fix .travis.yml
fix .travis.yml
fix .travis.yml
fix .travis.yml
Fix travis.yml
yaml syntax error fix
markdown fixes
Fix test cases with short results
Debug travis output
test
debug
debug
Debug env
Refactor
fix moxie build
fix moxie build
revert test
test
Add experimental moxie travis build
Update moxie sub opcode
Fix appveyor badge
Fix travis badge. Add REAME.md to dist files
Preformat release notes
Preformat release notes
Try to fix table
Clean up markdown table
Move to markdown
Add travis and appveyor build badges
Support compiler specific warning suppression flags
Support compiler specific warning suppression flags
Add bhaible's missing Makefile
Remove stray directory
Update version number to next pre-release
Update test list for dist
Add Bruno Haible and Bill Triggs' libffi testsuite
Next release will be 3.3
New RISC-V port (#281)
* Add RISC-V support
This patch adds support for the RISC-V architecture (https://riscv.org).
This patch has been tested using QEMU user-mode emulation and GCC 7.2.0
in the following configurations:
* -march=rv32imac -mabi=ilp32
* -march=rv32g -mabi=ilp32d
* -march=rv64imac -mabi=lp64
* -march=rv64g -mabi=lp64d
The ABI currently can be found at
https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md .
* Add RISC-V to README
* RISC-V: fix configure.host
Merge pull request #406 from trofi/master
ia64: fix variadic function closures with FP arguments
Merge pull request #407 from trofi/ia64-small-struct
ia64: fix small struct return
Merge pull request #409 from andreas-schwab/master
Revert "Fix passing struct by value on aarch64"
Revert "Fix passing struct by value on aarch64"
This reverts commit 482b37f00467325e3389bab322525099860dd9aa.
That was actually a bug in python, see <https://bugs.python.org/issue30353>.
ia64: fix small struct return
This change fixes libffi.call/struct10.c failure on ia64:
FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O0 execution test
.Lst_small_struct handles returns for structs less than 32 bytes
(following ia64 return value ABI [1]). Subroutine does roughly the
following:
```
mov [sp+0] = r8
mov [sp+8] = r9
mov [sp+16] = r10
mov [sp+24] = r11
memcpy(destination, source=sp, 12);
```
The problem: ia64 ABI guarantees that top 16 bytes of stack are
scratch space for callee function. Thus it can clobber it. [1]
says (7.1 Procedure Frames):
"""
* Scratch area. This 16-byte region is provided as scratch storage
for procedures that are called by the current procedure. Leaf
procedures do not need to allocate this region. A procedure may
use the 16 bytes at the top of its own frame as scratch memory,
but the contents of this area are not preserved by a procedure call.
"""
In our case 16 top bytes are clobbered by a PLT resolver when memcpy()
is called for the first time. As a result memcpy implementation reads
already clobbered data frop top of stack.
The fix is simple: allocate 16 bytes of scrats space prior to memcpy()
call.
[1]: https://www.intel.com/content/dam/www/public/us/en/documents/guides/itanium-software-runtime-architecture-guide.pdf
Bug: https://bugs.gentoo.org/634190
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
new test: return small struct
The bug originally was discovered in https://bugs.gentoo.org/634190
where complicated callback was returning invalid data on ia64.
This change adds minimal reproducer that fails only on ia64 as:
FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O0 execution test
FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O2 execution test
FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O3 execution test
FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -Os execution test
Test passes on amd64. The fix is in the following commit.
Bug: https://bugs.gentoo.org/634190
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
ia64: fix variadic function closures with FP arguments
libffi test framework already flagged failures as:
```
FAIL: libffi.call/cls_double_va.c -W -Wall -Wno-psabi -O0 output pattern test, is 7.0
res: 4
0.0
res: 4
? should match 7.0
?es: 4
?.0
res: 4
```
Failure happens here at
```c
// testsuite/libffi.call/cls_double_va.c
...
char* format = "%.1f\n";
double doubleArg = 7;
...
CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL,
code) == FFI_OK);
res = ((int(*)(char*, ...))(code))(format, doubleArg);
```
libffi expects 'doubleArg' to be located in 'f9' (second FP argument) but
gcc placed it to 'r33' (second GR).
ia64 software [1] manual described argument passing ABI in
"8.5.2 Register Parameters" as:
"""
If an actual parameter is known to correspond to a floating-point
formal parameter, the following rules apply:
a) The actual parameter is passed in the next available floating-point
parameter register, if one is available. Floating-point parameter
registers are allocated as needed from the range f8-f15, starting
with f8.
b) If all available floating-point parameter registers have been used,
the actual parameter is passed in the appropriate general register(s).
(This case can occur only as a result of homogeneous floating-point
aggregates, described below.)
If a floating-point actual parameter is known to correspond to
a variable-argument specification in the formal parameter list,
the following rule applies:
c) The actual parameter is passed in the appropriate general
register(s).
If the compiler cannot determine, at the point of call,
whether the corresponding formal parameter is a varargs parameter,
it must generate code that satisfies both of the above conditions.
(The compiler’s determination may be based on prototype declarations,
language standard assumptions, analysis, or other user options or
information.)
"""
We have [c] case here and gcc uses only GR for parameter passing.
The change binds known variadic arguments ro GRs instead of FPs as those
are always expected to be initialized for all variadic call types.
This fixes all 10 failures on ia64-unknown-linux-gnu:
```
=== libffi Summary ===
-# of expected passes 1945
-# of unexpected failures 10
+
+# of expected passes 1955
```
[1]: https://www.intel.com/content/dam/www/public/us/en/documents/guides/itanium-software-runtime-architecture-guide.pdf
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Merge pull request #403 from frida/fix/x86-sysv-pic-closure-regression
Fix x86 SysV closure in PIC mode
Merge pull request #405 from andreas-schwab/master
Fix passing struct by value on aarch64
Fix passing struct by value on aarch64
This fixes the ctypes test in the python testsuite.
Fix x86 SysV closure in PIC mode
The assembly single-line comments swallowed up the remaining assembly
code of the macros due to lack of line-endings.
This is a regression introduced in b7f6d7a.
adjust env usage in travis
test static lib
Merge pull request #393 from thejunkjon/master
Linker error "recompile with -fPIC" for x86_64
Merge pull request #401 from wzssyqa/jr-r6
mips/ffi.c: fix encoding for jr on r6
mips/ffi.c: fix encoding for jr on r6
mips/ffi.c: instruction jr has a different encoding for r6
Merge pull request #398 from emaste/master
Enable symbol versioning when ld is LLVM's lld
Merge pull request #396 from wzssyqa/master
mips/n32.S: disable .set mips4 on mips r6
Enable symbol versioning when ld is LLVM's lld
Fixes #397
Not set mips on mips r6
MIPS release changed encodes of some instructions, include ll/sc etc.
if .set mips4 on mips r6, as will generate some wrong encode of some instructions.
Updating calls to ffi_closure_unix64_inner and ffi_closure_win64_inner to use PLT. Without this fix, statically linking libffi causes the linker error i.e. 'requires dynamic R_X86_64_PC32 reloc against ffi_closure_unix64_inner which may overflow at runtime; recompile with -fPIC)'
Merge pull request #387 from trofi/master
Makefile.am: add 'src/s390/internal.h' to source tarball
Makefile.am: add 'src/s390/internal.h' to source tarball
commit 2f530de168e0253ac06e044c832132c496e8788b
("s390: Reorganize assembly") introduced new header
(similar to other arches) but did not add it to source
tarball.
As a result build from 'make dist' tarballs failed as:
```
../src/s390/ffi.c:34:10: fatal error: internal.h: No such file or directory
#include "internal.h"
^~~~~~~~~~~~
```
To fix it the change adds file to 'Makefile.am'.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Merge pull request #320 from 0-wiz-0/master
Support NetBSD with mprotect.
Merge pull request #322 from compnerd/aarch64-base
aarch64: fix index base register for AArch64
Merge pull request #384 from yan12125/fix-sgidefs-checking
Fix linux detection (closes #303)
Fix linux detection (closes #303)
aarch64: fix index base register for AArch64
The base is passed in `x3`, not in `x2`. This fixes the indexing base
so that the right value is used.
Merge pull request #298 from frida/fix/ios-trampoline-table-complexity
Simplify iOS trampoline table allocation
Merge pull request #323 from compnerd/x86-alloca-alignment
x86: align alloca to 16-byte boundary
Merge pull request #379 from jlj/master
Xcode build improvements
Merge pull request #383 from hjl-tools/hjl/master
Hjl/master
Merge pull request #381 from compnerd/ffi-nullptr-deref
arm: fix a level of indirection issue
Skip WIN64/EFI64 support for x32
Since x32 doesn't support WIN64/EFI64, skip it if __ILP32__ is defined.
Don't include WIN64/EFI64 for x32
Since x32 doesn't support WIN64/EFI64, don't include it for x32. Also
x32 has sizeof size_t == 4. But TARGET should be X86_64.
arm: fix a level of indirection issue
Rather than relying on the stack being 0'ed out always, do it manually.
The stack generally happened to be zero, and because the compiler
realizes that the tests are dealing with chars truncates the read value.
However, the top 3 nibbles of the value are undefined and may be
non-zero. The indirection level caused a null-pointer dereference.
Explicitly scribbling on the stack during the allocation causes test
failures without the original zexting behaviour.
Merge branch 'master' based on ksjogo/libffi
Added a tvOS target in Xcode project. Misc Xcode project cleanup.
Fix macOS build target in Xcode project.
# Conflicts:
# src/aarch64/ffi.c
# src/x86/ffi64.c
Added a tvOS target in Xcode project. Misc Xcode project cleanup.
x86: align alloca to 16-byte boundary
Align the stack allocation to a 16-byte boundary. This ensures that the
stack parameters are 16-byte aligned which is needed for some
instructions.
Merge pull request #326 from trofi/master
src/ia64/unix.S: unbreak small struct handling
src/ia64/unix.S: unbreak small struct handling
commit 6e8a4460833594d5af1b4539178025da0077df19
added FFI_TYPE_COMPLEX value type (comes after FFI_TYPE_POINTER)
ia64 ffi_closure_unix reiles on the ordering of
FFI_ enums as ia64 has ia64-specific FFI types:
small struct and FPU extesions.
As a result all tests handling small structs broke.
The change fixes dispatch table by adding (no-op)
FFI_TYPE_COMPLEX entry
This has positive effect of unbreaking most tests
on ia64:
=== libffi Summary ===
-# of expected passes 1595
-# of unexpected failures 295
+# of expected passes 1930
+# of unexpected failures 10
# of unsupported tests 30
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Merge pull request #324 from compnerd/arm-zext
arm: zext return value parameters
arm: zext return value parameters
The closure function (invoked as closure->fun in ffi_closure_XXX_inner)
will only populate the actual number of bytes for the true return type,
which may be a character. This leaves garbage on the stack when the
assembly closure function (i.e. ffi_closure_XXX) reads the return value
off of the stack into r0 as a 4-byte value. ffi_closure_XXX always
leaves room for at least 4 bytes here, so we can safely set them to 0.
Otherwise, if there is garbage in any of these bytes, these end up in r0
and in the returned value as well.
Support NetBSD with mprotect.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Merge pull request #319 from angerman/patch-5
Adds `local.exp` to DISTCLEANFILES
Change CLEANFILES to DISTCLEANFILES
Merge pull request #316 from angerman/patch-2
Add `configure.host` and `libtool-version` to the `EXTRA_DIST` files
Merge pull request #317 from angerman/patch-3
Add src/x86/asmnames.h to noinst_HEADERS
Merged
Adds `local.exp` to CLEANFILES
With #315, #316, #317, #318 and this patch, running
```
AM_DISTCHECK_CONFIGURE_FLAGS=--disable-docs make distcheck
```
should complete successfully.
Include `libtool-version` in the EXTRA_DIST files.
Add src/x86/asmnames.h to noinst_HEADERS
In eaa59755fcbb692a8cb763c7f9f24a350aadbd30, macros from `unix64.S` were extracted into `asmnames.h` to be used with `win64.S` as well. As such these are required by `unix64.S`, which fails to build without them.
Add `configure.host` to the `EXTRA_DIST` files
When running `make dist`, `configure.host` would not result in the distribution tarball, however `configure` would try to read it, and as such the tarball would not be buildable.
Fix #265
Merge pull request #263 from ksjogo/master
fix ios builds
Merge pull request #271 from frida/fix/qnx-cache-flushing
arm: Fix cache flushing on QNX
Merge pull request #307 from zw3rk/master
Support -ios triple
Merge pull request #312 from fjricci/fix_ub
Fix misaligned memory access in ffi_call_int
Merge pull request #308 from trex58/master
This patch enables FFI Go Closure on AIX.
Fix macOS build target in Xcode project.
- Add missing files for desktop platforms in generate-darwin-source-and-headers.py, and in the Xcode project.
- Add a static library target for macOS.
- Fix "implicit conversion loses integer precision" warnings for iOS mad macOS targets.
Fix misaligned memory access in ffi_call_int
Merge pull request #309 from rurban/oldgcc
__attribute__ deprecated (msg) only since gcc 4.5
__attribute__ deprecated (msg) only since gcc 4.5
make it work with older compilers
add i?86-*-ios -- the iOS simulator (32bit)
add x86_64-*-ios -- the iOS simulator
This patch enables FFI Go Closure on AIX.
Support -ios triple
Autoconf hasn’t had an update since 2014, and it doesn’t look like it will soon[1]
This updates config.{guess,sub}
It adds support for e.g. `-ios`, which allows to have targets like `aarch64-apple-ios`.
It basically does exactly what the config.guess script says:
> It is advised that you download the most up to date version of the config scripts from
The configure.ac script has been updated to relax `*-apple-darwin*` to `*-apple-*`.
Similarly the `.gitignore` and `autogen.sh` needed to be updated to respect the
newer `config.{sub,guess}`
—
[1]: http://lists.gnu.org/archive/html/autoconf/2016-07/msg00017.html
Merge pull request #302 from gpakosz/align-macros
Prefix ALIGN macros with FFI_
Prefix ALIGN macros with FFI_
update for xcode 8.3
Simplify iOS trampoline table allocation
By using VM_FLAGS_OVERWRITE there is no need for speculatively
allocating on a page we just deallocated. This approach eliminates the
race-condition and gets rid of the retry logic.
set ios deployment target to 7.0
fix ltmain.sh in xcode builds
add valid architectures
Update Xcodeproj
Include all currently relevent files.
Call autogen is build script.
Fix compiler settings.
Fix mach include.
remove stray quote
Handle fastcall declaration differently for some Microsoft compilers
We don't support 32-bit builds with the Microsoft toolchain
Enable appveyor ci support
Merge pull request #291 from ramon-garcia/visual-studio-build
Build with Visual C++ (64 bits)
Merge pull request #238 from KubaKaszycki/master
Update README with a new port
Merge pull request #288 from yan12125/std-includedir
Install public headers in the standard path
Merge pull request #299 from matijaskala/patch-1
detect other x32 hosts
Remove osx testing. gcc was symlinked to clang. dejagnu c++ tests fail with clang.
Revert previous two changes. clang/MacOS problem can only be solved within dejagnu.
Fix typo
Work around dejagnu/clang problems
Require sudo for installing packages
detect other x32 hosts
primarily x86_64-pc-linux-muslx32
while at it, add x86_64-x32-pc-linux-{gnu,musl} as well
Merge pull request #297 from frida/fix/error-path
Fix error path so mutex is unlocked before returning
Simplify iOS trampoline table allocation
By using VM_FLAGS_OVERWRITE there is no need for speculatively
allocating on a page we just deallocated. This approach eliminates the
race-condition and gets rid of the retry logic.
Fix error path so mutex is unlocked before returning
In the unusual case where ffi_trampoline_table_alloc() fails.
Merge pull request #295 from terrillmoore/patch-1
Correct typos in libffi.texi
Correct typos in libffi.texi
One "it's" should be "its", and one "is" should be "in".
Modify configure.host to detect compilation with Microsoft Visual C++ and use assembly with Intel syntax in that case
Install public headers in the standard path
make executable
Update travis to test linux 32/64 and osx with a mix of gcc and clang
xfail the unwindtest for osx as per issue #279
Merge pull request #273 from wbx-github/master
m68k: support ISA-A Coldfire CPUs
Merge pull request #272 from yousong/mips64-soft-float
Mips64 soft float
Merge pull request #274 from dr-hannibal/ykolerov-unused
ARC: Remove unused variable
ARC: Remove unused variable
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
m68k: support ISA-A Coldfire CPUs
Fix compilation for m68k/coldfire CPUs like mcf5208.
Signed-off-by: Thorsten Glaser <tg@mirbsd.de>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
doc: fix typo
Name of last argument to ffi_get_struct_offsets is `offsets`, not `sizes`
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
mips: fix MIPS softfloat build issue
The patch for o32.S is taken from OpenWrt packages repo 3a7a4bf "libffi:
fix MIPS softfloat build issue with current binutils"
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Merge pull request #269 from frida/fix/aarch64-variadic-closures-on-ios
aarch64: Fix handling of variadic closures on iOS
Merge pull request #268 from frida/fix/aarch64-large-aggregates
aarch64: Fix handling of aggregates larger than 16 bytes
aarch64: Fix handling of aggregates larger than 16 bytes
Instead of allocating stack space for a pointer we would allocate stack
space for the actual aggregate size.
Merge pull request #270 from frida/fix/aarch64-warnings
Fix aarch64 warnings
arm: Fix cache flushing on QNX
Use `msync()` directly as `__clear_cache()` is broken in the
qnx650_gcc4.8.3 toolchain.
aarch64: Fix warning about unused function on iOS
aarch64: Fix operand size warning reported by Clang
aarch64: Fix handling of variadic closures on iOS
Merge pull request #266 from dr-hannibal/arc-pthread
Make testing easier outside of build directory and especially for ARC
Do not use fabsl() in float2.c test
Some targets may support long double variables but in the same
time may lack support of long double functions like fabsl().
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Fix output expectations in cls_dbls_struct.c test
This test with invalid output expectations may fail on some targets
(e.g. ARC processors).
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Allow setting an arbitary value for blddirffi in testsuite
It is useful when tests are executed not from build directory. So
the path of the build directory may be passed through site.exp or
runtest.
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
ARC: Link tests with pthread library
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Merge pull request #261 from tromey/fix-260
Don't dereference "ecif" before NULL check
Don't dereference "ecif" before NULL check
Fixes #260
Merge pull request #259 from rth7680/master
Mark win64.S with GNU-stack note
Mark win64.S with GNU-stack note
Merge pull request #253 from iains/darwin-build
Some Darwin build fixes
[Darwin-ppc, build] Fixes for clang build.
clang is experimental on powerpc-darwin, but the changes are appropriate to cctools as as well.
Use the 'official' simplified cmpwi insn, rather than the implied one accepted by cctools.
Do not re-use a set value.
[Darwin-x86, build] Fix up label prefixes, remove .purgem
Darwin uses a label prefix of _.
cctools assembler will not accept .purgem as a directive.
[Darwin, configure] Allow configure to work for <arch>-*-darwin.
The exec configury is appropriate for all current targets (including using older tools on them).
Merge pull request #237 from tschwinge/libffi_feature_test
Simplify/fix libffi_feature_test
Merge pull request #251 from berkerpeksag/delete-test-define
Remove unused FFI_CLOSURE_TEST
Remove unused FFI_CLOSURE_TEST
It was here since the first commit c6dddbd (warning: huge diff) and
it wasn't defined by the configure script. It was probably used
manually during development.
Merge pull request #248 from berkerpeksag/patch-1
Delete empty env in .travis.yml
Delete empty env in .travis.yml
Merge pull request #247 from rth7680/symver
Add parent to symbol version LIBFFI_BASE_7.1
Add parent to symbol version LIBFFI_BASE_7.1
Merge pull request #230 from rth7680/symver
Use ELF symbol versioning
Merge pull request #232 from berkerpeksag/signcompare
Fix -Wsign-compare warnings in x86/ffi64.c
Merge pull request #233 from berkerpeksag/mremap
Define _GNU_SOURCE on Linux for mremap()
Merge pull request #246 from berkerpeksag/update-github-links
Update project URLs to use libffi/libffi
Update project URLs to use libffi/libffi
Define _GNU_SOURCE on Linux for mremap()
This was committed to CPython's libffi copy in
https://bugs.python.org/issue10309
mremap() documentation says _GNU_SOURCE needs to
be defined in order to use mremap(): see the
synopsis section at http://linux.die.net/man/2/mremap
Original commit: https://hg.python.org/cpython/rev/9986fff720a2
Original patch was written by Hallvard B Furuseth.
Fix -Wsign-compare warnings in x86/ffi64.c
This was originally reported on the Python tracker:
httpa://bugs.python.org/issue23958
The original patch was written by Steve R. Hastings.
I've updated it to current master of libffi.
Merge pull request #234 from berkerpeksag/disable-docs
Add a note about the --disable-docs switch
Merge pull request #242 from somasis/master
Fix usage on musl libc
Update symbol versioning for ffi_get_struct_offsets
Given that the original symbol versioning patch has shipped
with gcc-6, it would be kind to keep that as a valid base ABI
and make subsequent changes to version 7.1.
Use ELF symbol versioning
At the same time, we must bump the (major) ABI version. This needed to be
done anyway due to ABI breakage in the AArch64 port (see 12cf89ee and the
corresponding GCC PR70024).
Merge pull request #245 from rth7680/tromey-ffi-prep-cif-core-is-private
A rebase of #219
minor comment cleanup
This patch minor cleans up ffi.h.in comments in a minor way. It fixes
some typos and capitalizations, adds some periods, and reformats some
comments to a more GNU-ish style. It also fixes up some stale
documentation.
Change ffi.h.in so that braces match
This is a tiny refactoring to make it so brace-matching works in
Emacs.
move ffi_prep_cif_core to ffi_common.h
Merge pull request #231 from berkerpeksag/simplfy-oserror
Simplify error handling in mkdir_p()
Merge pull request #236 from andreas-schwab/master
Define FFI_SIZEOF_JAVA_RAW for aarch64 ILP32
Merge pull request #241 from rth7680/fix-win64
Fix win64 abi calling from unix64
Fix usage on musl libc
A gcc compiled on musl does not define __gnu_linux__, it defines __linux__.
Only on glibc does __gnu_linux__ get defined, but both define __linux__, so
we should check for that instead.
With this patch, libffi works perfectly, and passes its testsuite entirely
on musl libc systems.
x86: Fix calling convention for ffi_closure_win64_inner
Also enable testing for the cross-abi calls.
x86: Copy fix for clang .org from unix64.S
Clang doesn't understand .org with symbolic operands.
Update README with a new port
This is in fact not a NEW port. Apple Mac devices are generally x86-64 now, x86 rarely. If GCC exists for this CPU, it means that libffi has been built too.
Simplify/fix libffi_feature_test
As detailed in
<http://news.gmane.org/find-root.php?message_id=%3C87wppswqqt.fsf%40kepler.schwinge.homeip.net%3E>,
the original code (originally added in commit
f1301a54bb80e6ae23f7687c68f36875dae69134 as part of pull request #145) does not
work (at least not for me, in the GCC environment).
Define FFI_SIZEOF_JAVA_RAW for aarch64 ILP32
Like x32, aarch64 ILP32 needs to define FFI_SIZEOF_JAVA_RAW. This fixes
the java interpreter.
Merge pull request #212 from tromey/struct-layout
add ffi_get_struct_offsets
Add a note about the --disable-docs switch
Closes #204
Simplify error handling in mkdir_p()
Merge pull request #227 from tromey/fix-documentation-build
Fix documentation build
add ffi_get_struct_offsets
remove and ignore texinfo.tex
This file is provided by Automake
fix documentation building
An earlier patch added --disable-docs, but went too far, making it
impossible to build the docs.
It turns out that Automake seemingly has a bug preventing the
conditional build of an info file. So, this patch works around the
bug by putting the info_TEXINFOS rule into a new doc/Makefile.am.
Tested by building with and without --disable-docs and looking for the
existence of doc/libffi.info.
Merge pull request #190 from havardgraff/master
Add configure-option to disable building docs
Merge pull request #194 from amodra/master
Correct powerpc sysv stack argument accounting
Merge pull request #104 from joshtriplett/efi64
Support the Windows/EFI calling convention on all x86-64 targets
Merge pull request #199 from Pan7/master
Fix configuring msvc compiler
Merge pull request #197 from foxsen/mips_go_closure
Mips go closure support
Merge pull request #193 from rth7680/fix-70
Test case from issue #70
Merge pull request #206 from edolnx/master
Add configure flag to disable multi-os-directory support
Merge pull request #211 from tromey/move-prep-types-out-of-ffi.h
ffi_prep_types is internal-only
Merge pull request #213 from tromey/remove-FFI_TYPE
remove FFI_TYPE typedef
Merge pull request #214 from tromey/document-enum-support
document (lack of) enum handling in libffi
Merge pull request #205 from filbranden/tool_opts
Fix dejagnu test support for --tool_opts
Merge pull request #225 from ehsan/safeseh
Don't clobber safeseh for msvcc.sh -clang-cl in 32-bit mode
Fix dejagnu test support for --tool_opts
Right now it concatenates it with the existing options and then appends
it to that list, fix it to simply append it as is, same as it is done
with the other variables.
Tested by running the following command which includes gcc options:
$ make check RUNTESTFLAGS="--tool_opts '-Werror'"
Without this patch, all the tests fail. With it, the test succeed.
Inspecting the logs shows that -Werror was indeed used when compiling
the test sources.
Don't clobber safeseh for msvcc.sh -clang-cl in 32-bit mode
The commit fb25cd0 went a bit too far and removed safeseh
when -clang-cl was passed, but that's only needed in x86-64
which is already handled by the -m64 flag.
I discovered this when building Firefox x86 with clang-cl.
Merge pull request #222 from freakboy3742/t181
Fixed #181 -- Corrected problems with ARMv7 build under iOS.
Merge pull request #224 from plicease/travis
update apt-get in travis
update apt-get in travis
Merge branch 'master' into t181
Fixed #181 -- Corrected problems with ARMv7 build under iOS.
Based on a patch from @fealebenpae, with input from @SolaWing and @rth7680,
and testing from @superdump.
Merge pull request #221 from tromey/document-closure-ffi_arg
Document closure ffi arg
correctly document closure return promotion
fix formatting of ffi_prep_closure_loc arguments
document (lack of) enum handling in libffi
remove FFI_TYPE typedef
ffi_prep_types is internal-only
speling fix
Merge pull request #209 from tromey/documentation-updates
documentation fixes
Merge pull request #207 from tromey/deprecate-ffi-prep-closure
mark ffi_prep_closure as deprecated
documentation fixes
Fixes #78. Documentation for #33 and #35, but no fix.
mark ffi_prep_closure as deprecated
Add configure flag to disable multi-os-directory support
In some environments, installing the library to GCC's
multi-os-directory is not perferable. This patch adds a switch
to configure "--disable-multi-os-directory" which will disable
that check, typically falling back to ${libdir} unless
cross-compiling.
Original patch was written by Stewart Brodie, and was found at
https://sourceware.org/ml/libffi-discuss/2013/msg00144.html
I've just updated it to work with the current version.
Tidy call.exp test collection
Commit c952a92e20aa6013d8202d0b3fa1d87838c83054 moved all of
the complex tests to libffi.complex, but failed to remove the
anti-globbing from libffi.call.
Test case from Issue #70
Merge pull request #202 from tromey/note-prep-cif-var-usage
document that there must be ntotalargs types
Merge pull request #201 from tromey/fix-texinfo-buglet
Add missing "@" to @var{}
document that there must be ntotalargs types
Add missing "@" to @var{}
Fix configuring msvc compiler
fix type error in unwind code
add unwind infor for *go_closure;
reorder the labels to make thing more clear
fix O32 stack unwind code
add missing 1: label
various fixes for go closure support. Now all n64 tests passed.
add support for go closure support on mips
Correct powerpc sysv stack argument accounting
ppc32 starts using the stack for integer arg passing when we run out
of integer arg passing registers. Similarly, we start using the stack
for floating point args when we run out of floating point registers.
The decision on where an integer arg goes does not depend on number of
floating point args, nor does the decision on where a floating point
arg goes depend on number of integer args. Alignment of stack args
also simply depends on number of stack args.
This patch untangles the horrible mess we had, with intarg_count being
wrongly used to count both integer args and stack words.
* src/powerpc/ffi_sysv.c (ffi_prep_cif_sysv_core): Count fprs,
gprs, and stack words separately.
(ffi_prep_args_SYSV): Similarly.
Support the WIN64/EFI64 calling convention on all X86_64 platforms
Add a new calling convention FFI_EFI64, alias FFI_WIN64, on all X86_64
platforms. This allows libffi compiled on a 64-bit x86 platform to call
EFI functions.
Compile in ffiw64.c and win64.S on all X86_64 platforms. When compiled
for a platform other than X86_WIN64, ffiw64.c suffixes its functions
with _efi64, to avoid conflict with the platform's actual
implementations of those functions.
src/x86/ffiw64.c: Don't assign a "char *" to an "unsigned char *"
Declare a local variable to match the type of the struct field assigned
to it, rather than adding unsigned to the type. Fixes a -Wpointer-sign
warning.
src/x86/win64.S: Handle name mangling and PIC
Move the macros from unix64.S into a shared header asmnames.h and use
them in win64.S too.
src/x86/win64.S: Support compiling on non-WIN64 platforms
Non-WIN64 versions of the GNU assembler don't support the .seh_*
directives for structured exception handling, so wrap them in a macro
that compiles to nothing.
Handle the registers used for the non-Windows x86-64 calling convention
when on a non-Windows platform. Distinguish between cases that should
refer to the native argument registers (defined as arg0, arg1, arg2, and
arg3) and cases that should always refer to the Windows argument
registers.
Add configure-option to disable building docs
Modified arm/sysv.S to remove directives not allowed by clang.
Merge pull request #185 from freakboy3742/t184
Fixed #184 -- Corrected source file references in Darwin source generator tool.
Merge pull request #186 from freakboy3742/gitignore
Added generated source file to .gitignore.
Added generated source file to .gitignore.
Fixed #184 -- Corrected file references in Darwin source generator tool.
Merge pull request #178 from rth7680/aa64-ilp32
aarch64: Handle ILP32 ABI
aarch64: Handle ILP32 ABI
Merge pull request #176 from 0-wiz-0/master
Handle NetBSD/powerpc the same as FreeBSD and OpenBSD.
Handle NetBSD/powerpc the same as FreeBSD and OpenBSD.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Remove incomplete sentence
Merge pull request #175 from rth7680/sparc
sparc: Re-introduce hand-written unwind info
Merge pull request #174 from rth7680/fbsd
configure: Run HAVE_AS_X86_PCREL for all X86 targets
sparc: Re-introduce hand-written unwind info
Fixes the build with the Solaris assembler.
configure: Run HAVE_AS_X86_PCREL for all X86 targets
Merge pull request #170 from fealebenpae/aarch64-trampoline-table
Support closures on ARM64 iOS
Merge pull request #172 from rth7680/fixes
x86: Fix cygwin32 build
x86: Fix cygwin32 build
The section syntax is just that little bit different.
Merge pull request #171 from rth7680/fixes
Fixes from mainline gcc
sparc: Also mark the return address in unwind info
sparc: Solaris fixes, part 2
/bin/as seems to only understand single-digit labels
/bin/as knows nothing about .rept/.endr
sparc: Solaris fixes
* /bin/as requires .type fn,#function instead of @function.
* /bin/as doesn't support .macro/.endm. I'm using preprocessor macros
instead to implement E in src/sparc/v[89].S.
x86: Solaris fixes
* Solaris/x86 /bin/as doesn't support .org, so I've just disabled the
uses in src/x86/{sysv, unix64}.S, as on Darwin.
* Solaris/x86 needs to use EH_FRAME_FLAGS so manually and compiler
generated .eh_frame sections match, otherwise libffi.so fails to link:
* Solaris/x86 /bin/as has different COMDAT syntax; I've disabled it for
the moment.
aarch64: implement the trampoline table workaround for ffi closures on Apple systems
This is a direct copy/paste port of the ARM code, with changes because of Aarch64 pc-relative addressing restrictions.
aarch64: rewrite range syntax into list to appease Clang
Clang's assembler in Xcode 6 appears to choke when the operand of st4 is a range, but is happy with a list.
New test case for old aarch64 bug
Remove extra brackets in configure.host
This table is no longer in configure.ac, needing
protection from m4.
x86: Fix thinko in ffi_raw_call
Missed structure initialization for raw path.
Apparently there are no tests for this outside gcc.
Merge pull request #166 from chevah/master
Fix expr error in Solaris 10 when using gcc.
Merge pull request #165 from rth7680/pcc
Support PCC as producer and consumer
Merge pull request #164 from rth7680/darwin
Fix build on darwin
Merge pull request #160 from nobu/msvc-no-complex
x86: MSVC does not support Complex type
Merge pull request #159 from nobu/fix-void-arith
x86: Fix void pointer arithmetic
Fix expr error in Solaris 10 when using gcc.
x86: Avoid fastcall when building with pcc
Apparently, PCC doesn't support the fastcall calling convention.
Nor does it issue a warning or error for the attribute that it
does not understand.
x86: Load structure return address into eax
x86: Reinstate hand-written unwind info for sysv.S
x86: Expand FFI_GO_CLOSURE
If we're going to have to hand-write unwind info for darwin,
these macros make the job harder.
x86: More Darwin unwind fixups
EHFrame{N} IIRC is a special cue to ld64 that it should treat the unwind
in the object as "special/legacy" .. [these days everything is .cfi_xxxx
(except, cctools-as, as you noted)] .. without that much confusion arises
with ld64's atom-isation of the eh_frame section.
xxxx.eh labels are not needed for darwin ld64 >= 85.2.1 (i.e. darwin9,
xcode 3.1.4) to all intents and purposes, that's all that matters now,
since I think that anyone trying to build on 10.4/darwin8/xcode2.5 would
have to use a later ld64 (from odcctools) for other reasons.
x86: Reinstate hand-written unwind info for unix64.S
One more try to get default Darwin to work.
x86: Avoid using gas local labels
Which are unsupported by Darwin cctools as.
Thankfully this doesn't uglify the source too much.
x86: Remove use of .cfi_escape
The unwind info isn't 100% correct at all points during the epilogue,
and not annotating is just as incorrect as the annotation. This works
better on systems that do not support DW_OP_call_frame_cfa.
x86: Honor alignment of arguments
Darwin aligns long-double to 16, and thus all of the long double
tests were failing due to not honoring that. We ought to be able
to devise a test case for GCC using __attribute__((aligned)) that
would have failed too.
x86: Use .balign not .align
The Apple assembler defaults to power of two alignment, rather than
byte alignment like everyone else. Force byte alignment by using
the proper directive.
x86: Disable .org for Darwin
x86: Best guess at update for Darwin
x86: MSVC does not support Complex type
x86: Fix void pointer arithmetic
Merge pull request #158 from rth7680/s390
S390
s390: Inline and tidy ffi_prep_args
As per discussion with Ulrich Weigand, document the restrictions
on the code within ffi_call_int as we simultaneously prepare
stack frames for ffi_call_SYSV and the target function.
s390: Use pc-relative insns in 31-bit mode
It's silly to stick to esa/390 features when the compiler won't.
Detect when brasl and larl are used by the compiler and then use
them in the assembly.
s390: Reorganize assembly
Avoid using ffi_prep_args as a callback; do all the work setting
up the frame within ffi_call_int directly. Save fewer registers
in ffi_closure_SYSV.
s390: Avoid aliasing warnings
s390: Kill trailing whitespace
s390: Go closure support
Merge pull request #157 from rth7680/x86
Two fixes for x86
Merge pull request #156 from rth7680/sparc
sparc: Define FFI_TARGET_SPECIFIC_VARIADIC for v9
x86: Handle void arguments as if an empty structure
Since libffi currently doesn't allow empty structures, libgo
currently maps them to ffi_type_void. Given that we'll abort
on this case, handle it gracefully.
x86: Fix some unwind errors
Fix for https://github.com/atgreen/libffi/issues/141
Merge pull request #151 from amodra/master
powerpc: go closures for linux
powerpc: Fix ffi_go_closure_linux64
Unlike ffi_closure_LINUX64, this entry point is called normally,
so we already have the TOC in R2 and the closure in R11.
* powerpc/linux64_closure.S (ffi_closure_LINUX64): Remove a
register dependency chain.
(ffi_go_closure_linux64): Don't load r11 or r2.
GO closures for powerpc linux
Plus .cfi async unwind info, rearrangement of ffi_call_linux64 and
ffi_call_SYSV function params to avoid register copies, tweaks to
trampolines.
* src/powerpc/ffitarget.h (FFI_GO_CLOSURES): Define.
* src/powerpc/ffi.c (ffi_call_int): New function with extra
closure param, and args rearranged on ffi_call_linux64 and
ffi_call_SYSV calls, extracted from ..
(ffi_call): ..here.
(ffi_call_go, ffi_prep_go_closure): New functions.
* src/powerpc/ffi_linux64.c (ffi_prep_closure_loc_linux64): Make
hidden. Only flush insn part of ELFv2 trampoline. Don't shuffle
ELFv1 trampoline.
(ffi_closure_helper_LINUX64): Replace closure param with cif, fun,
user_data params.
* src/powerpc/ffi_powerpc.h (ffi_go_closure_sysv): Declare.
(ffi_go_closure_linux64): Declare.
(ffi_call_SYSV, fi_call_LINUX64): Update.
(ffi_prep_closure_loc_sysv, ffi_prep_closure_loc_linux64): Declare.
(ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Update.
* src/powerpc/ffi_sysv.c (ASM_NEEDS_REGISTERS): Increase to 6.
(ffi_prep_closure_loc_sysv): Use bcl in trampoline, put data words
last, flush just the insn part.
(ffi_closure_helper_SYSV): Replace closure param with cif, fun and
user_data params.
* src/powerpc/linux64.S (ffi_call_LINUX64): Replace hand-written
.eh_frame with .cfi directives. Adjust for changed param order.
Pass extra "closure" param to user function in static chain. Add
.cfi directives to describe epilogue. Don't provide traceback
table for ELFv2 or _CALL_LINUX.
* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Replace
hand-written .eh_frame with .cfi directives. Adjust for changed
ffi_closure_helper_LINUX64 params. Add .cfi directives to
describe epilogue. Don't provide traceback table for ELFv2 or
_CALL_LINUX.
(ffi_go_closure_linux64): New function.
* src/powerpc/sysv.S: Remove redundant .globl ffi_prep_args_SYSV.
(ffi_call_SYSV): Make hidden. Replace hand-written .eh_frame with
.cfi directives. Adjust for changed params. Pass extra "closure"
param to user function in static chain. Add .cfi directives to
describe epilogue.
* src/powerpc/ppc_closure.S (ffi_closure_SYSV): Make hidden.
Replace hand-written .eh_frame with .cfi directives. Adjust for
changed ffi_closure_helper_SYSV params. Add .cfi directives to
describe epilogue. Don't just use nops in the dead __NO_FPRS__
epilogues.
(ffi_go_closure_sysv): New function.
Fix powerpc breakage from 6e8a4460
* src/powerpc/ffitarget.h: #error on unexpected FFI_TYPE_LAST.
(FFI_PPC_TYPE_LAST): Define.
(FFI_TYPE_UINT128): Define in terms of FFI_PPC_TYPE_LAST.
(FFI_SYSV_TYPE_SMALL_STRUCT, FFI_V2_TYPE_FLOAT_HOMOG): Likewise.
(FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Likewise.
Merge pull request #148 from gpakosz/dlmalloc-preprocessor-fix
dlmalloc: change defined(i386) to defined(__i386__)
sparc: Define FFI_TARGET_SPECIFIC_VARIADIC for v9
This is a port of
http://gcc.gnu.org/viewcvs?rev=207763&root=gcc&view=rev
aka GCC PR libffi/60073, to the rewritten Sparc codebase.
Supposedly, we should have seen failures with the existing
libffi.call/cls_double_va.c testcase, but I hadn't.
Perhaps a gcc newer than 4.6.3 is required to see that...
dlmalloc: change defined(i386) to defined(__i386__)
When compiling with --std==c99, GCC and clang don't define i386 but __i386__
Merge pull request #147 from rth7680/go/alpha
testsuite: Fix alpha static chain register name
testsuite: Fix alpha static chain register name
Merge pull request #145 from rth7680/master
Configure and testsuite cleanups, v2
Merge pull request #144 from atrosinenko/testsuite-fp-comparison-fix
Floating point number comparison fix for testsuite
Merge pull request #143 from adamkaplan/patch-1
Update i386 & armv7 minimum iOS version to 7.0
x86: Fix typo in ffi_prep_go_closure
Used the wrong register for THISCALL and FASTCALL.
testsuite: Add trivial tests for Go closures
testsuite: Move complex tests to their own subdirectory
It seems a bit silly to isolate them by globbing vs "*complex*"
when we can just as easily put them in their own subdirectory.
testsuite: Use feature test rather than enumeration for complex
testsuite: Detect clang
Clang doesn't like the -Wno-psabi argument that we want to pass to GCC.
Since clang is detected as GCC via __GNUC__, use ax_cv_c_compiler_vendor.
configure: Move target source selection into configure.host
This eliminates the AM_CONDITIONAL ugliness, which eliminates
just a bit of extra boilerplate for a new target.
At the same time, properly categorize the EXTRA_DIST files
into SOURCES and HEADERS, for the generation of ctags.
Take a float absolute value using fabs() instead of abs().
Replace integer abs() by floating point fabs() in the approximate
equality check for float values.
Fix floating point number comparisons in testsuite/libffi.call/float[123].c.
Rewrite the checks for approximate equality of floating point return
values to be in the form "fabs(a - b) < EPS" instead of just
"a - b < EPS".
Update i386 & armv7 minimum iOS version to 7.0
iOS 5 (and any below 7.1) is deprecated. Apple doesn't distribute the supporting libraries for this platform anymore as of Xcode 6, so it causes a linker error.
configure: Split out configure.host
Split out the host case statement to a separate file, so that
we don't have to regenerate configure.in for changes therein.
powerpc: Delete patch output
Clearly added by mistake.
Merge branch 'rth7680-go-closure'
Update in preparation for next release
Merge branch 'go-closure' of https://github.com/rth7680/libffi into rth7680-go-closure
Conflicts:
src/aarch64/ffi.c
Fix for AArch64. Release as 3.2.1.
x86: Work around clang bugs
http://llvm.org/bugs/show_bug.cgi?21500
http://llvm.org/bugs/show_bug.cgi?21501
http://llvm.org/bugs/show_bug.cgi?21515
sparc: Re-add abi compliant structure support
The original code, removed in the "rewrite" patch, was incorrect for
large structures, and required dynamic allocation of a trampoline on
every ffi_call.
Instead, allocate a 4k entry table of all possible structure returns.
The table is 80k, but is read-only and dynamically paged, which ought
to be better than allocating the trampoline.
This is difficult to test with gcc. One can only use -O0 at present.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63668.
sparc: Add support for Go closures
sparc: Add support for complex types
sparc: Handle more cases of structure return directly
sparc: Preprocess float point struct return
We can eliminate recursion and speed structure return
by flattening a nested structure tree into a bitmask.
sparc: Rewrite everything
It's impossible to call between v8 and v9 ABIs, because of the stack bias
in the v9 ABI. So let's not pretend it's just not implemented yet. Split
the v9 code out to a separate file.
The register windows prevent ffi_call from setting up the entire stack
frame the assembly, but we needn't make an indirect call back to prep_args.
sparc: Tidy up symbols
Assembly to use local labels, .type annotation, hidden annotation.
I do retain the _prefix for the symbols, but given that it wasn't
done consistently across all symbols, I doubt it's actually needed.
sparc: Eliminate long double ifdefs
arm: Add support for Go closures
arm: Add argument space for the hidden struct return pointer
This should have been failing all along, but it's only
exposed by the complex_int test case.
arm: Add support for complex types
arm: Remove internal FFI_TYPE constants
These have been replaced by the contents of internal.h.
arm: Rewrite ffi_closure
Move the push of the argument registers into ffi_closure_SYSV,
reducing the size of the trampoline.
arm: Rewrite ffi_call
Use the trick to allocate the stack frame for ffi_call_SYSV
within ffi_call itself.
arm: Rewrite vfp_type_p
Do not modify the ffi_type. Rearrange the tests so that we
quickly eliminate structures that cannot match. Return an
encoded value of element count and base type.
arm: Deref ffi_put_arg arguments
arm: Deref ffi_align argument
arm: Reindent arm/ffi.c
alpha: Add support for Go closures
alpha: Add support for complex types
alpha: Clean up conversion of float values
Don't use "real" conversion to double, lest we raise
exceptions when passing signalling nans.
alpha: Reorganize cif flags
Unties the backend from changes to FFI_TYPE_* constants, and allows
compilation to succeed after the addition of FFI_TYPE_COMPLEX.
Delete the hand-written unwind info.
aarch64: Add support for Go closures
aarch64: Move x8 out of call_context
Reduces stack size. It was only used by the closure, and there
are available argument registers.
aarch64: Add support for complex types
aarch64: Remove aarch64_flags
This field was useless from the start, since the normal flags
field is available for backend use.
aarch64: Unify scalar fp and hfa handling
Since an HFA of a single element is exactly the same as scalar,
this tidies things up a bit.
aarch64: Move return value handling into ffi_closure_SYSV
As with the change to ffi_call_SYSV, this avoids copying data
into a temporary buffer.
aarch64: Move return value handling into ffi_call_SYSV
This lets us pass return data directly to the caller of ffi_call
in most cases, rather than storing it into temporary storage first.
aarch64: Merge prep_args with ffi_call
Use the trick to allocate the stack frame for ffi_call_SYSV
within ffi_call itself.
aarch64: Tidy up abi manipulation
Avoid false abstraction, like get_x_addr. Avoid recomputing data
about the type being manipulated. Use NEON insns for HFA manipulation.
Note that some of the inline assembly will go away in a subsequent patch.
aarch64: Treat void return as not passed in registers
This lets us do less post-processing when there's no return value.
aarch64: Use correct return registers
There are fewer return registers than argument registers.
aarch64: Reduce the size of register_context
We don't need to store 32 general and vector registers.
Only 8 of each are used for parameter passing.
aarch64: Simplify AARCH64_STACK_ALIGN
The iOS abi doesn't require padding between arguments, but
that's not what AARCH64_STACK_ALIGN meant. The hardware will
in fact trap if the SP register is not 16 byte aligned.
aarch64: Always distinguish LONGDOUBLE
Avoid if-deffery by forcing FFI_TYPE_LONGDOUBLE different
from FFI_TYPE_DOUBLE. This will simply be unused on hosts
that define them identically.
aarch64: Improve is_hfa
The set of functions get_homogeneous_type, element_count, and is_hfa
are all intertwined and recompute data. Return a compound quantity
from is_hfa that contains all the data and avoids the recomputation.
aarch64: Fix non-apple compilation
x86: Use win32 name mangling for fastcall functions
x86: Add support for Go closures
x86: Add support for Complex
x86: Rewrite closures
Move everything into sysv.S, removing win32.S and freebsd.S.
Handle all abis with a single ffi_closure_inner function.
Move complexity of the raw THISCALL trampoline into assembly
instead of the trampoline itself.
Only push the context for the REGISTER abi; let the rest
receive it in a register.
x86: Rewrite ffi_call
Decouple the assembly from FFI_TYPE_*. Merge prep_args with ffi_call,
passing the frame and the stack to the assembly.
Note that this patch isn't really standalone, as this breaks closures.
x86: Convert to gas generated unwind info
x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE
There are few abis that set double = long double. Eliminate the
conditional compilation and let this code simply be unused there.
x86: Remove some conditional compilation
Removal of ifdefs made possible to due to ffi_abi unification.
x86: Tidy ffi_abi
The x86_64 unix port only handles one ABI; don't define all of the
other symbols. The UNIX64 symbol retains the same value.
The i386 ports ought to have the same symbols, even if we can't yet
unify the values without incrementing the libffi soname.
testsuite: Add two dg-do run markers
Caught by clang warning about unused -L parameter.
testsuite: Fix return_complex2 vs excessive precision
Use the previously computed rc2 to validate, rather than
recomputing a floating point result with excess precision.
x86_64: Add support for complex types
x86_64: Decouple return types from FFI_TYPE constants
We can better support structure returns, and as prep for
complex types.
x86_64: Fixups for x32
win64: Remove support from ffi.c
win64: Rewrite
It's way too different from the 32-bit ABIs with which it is
currently associated. As seen from all of the existing XFAILs.
x86-64: Support go closures
Dumps all of the hand-coded unwind info for gas generated. Move jump
table data into .rodata. Adjust ffi_call_unix64 to load the static
chain. Split out sse portions of ffi_closure_unix64 to
ffi_closure_unix64_sse rather than test cif->flags at runtime.
Add ffi_cfi.h
Have one copy of the HAVE_AS_CFI_PSEUDO_OP code
to share between all backends.
Add entry points for interacting with Go
A "ffi_go_closure" is intended to be compatible with the
function descriptors used by Go, and ffi_call_go sets up
the static chain parameter for calling a Go function.
The entry points are disabled when a backend has not been
updated, much like we do for "normal" closures.
Fix typo
Final 3.2 changes
Final 3.2 changes
Mention OpenRISC
Merge pull request #134 from s-macke/openrisc
Add OpenRISC support
Only run the complex type tests on supported platforms.
Add OpenRISC support
This patch adds support for the OpenRISC architecture.
(http://opencores.org/or1k/Main_Page)
This patch has been tested under Linux with QEMU-user emulation support.
- 32 Bit
- big endian
- delayed instructions
This is the only available configuration under Linux.
The description of the ABI can be found on the official website.
Is passes the testsuite except of the unwindtest_ffi_call.cc
testcase, which seems to be a problem of gcc and not libffi.
Some testcases of the gcc testsuite still fail.
Signed-off-by: Sebastian Macke <sebastian@macke.de>
Add complex type support. Mostly broken right now
Compile tests with -Wno-psabi when using GCC
Update version to 3.2
More README updates for 3.2
Update release notes.
2014-05-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
Fix current cygwin-64 build problems.
* src/java_raw_api.c: Remove if !defined(FFI_NO_RAW_API).
* src/x86/ffi.c: Add if defined(__CYGWIN__).
* src/x86/win64.S (ffi_closure_win64, ffi_call_win64): Added
handling for FFI_TYPE_UINT64, FFI_TYPE_POINTER and FFI_TYPE_INT.
Added SEH information. Fixed formatting.
2014-09-10 Jakub Jelinek <jakub@redhat.com>
* src/powerpc/linux64.S: Emit .note.GNU-stack even when
POWERPC64 is not defined.
* src/powerpc/linux64_closure.S: Likewise. Also test _CALL_ELF == 2.
Fix -Werror=declaration-after-statement problem
2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com>
* src/types.c (FFI_TYPEDEF, FFI_NONCONST_TYPEDEF): Merge the macros by
adding another argument that controls whether the result is const or not
(FFI_LDBL_CONST): Temporary macro to reduce ifdef confusion
* src/prep_cif.c (ffi_prep_cif_core): Replace list of systems with new
macro FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
* src/pa/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION):
Define.
* src/s390/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION):
Define.
* src/x86/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION):
Define.
2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com>
* doc/libffi.texi (Primitive Types): Document ffi_type_complex_float,
ffi_type_complex_double and ffi_type_complex_longdouble
(Complex Types): New subsection.
(Complex Type Example): Ditto.
* testsuite/libffi.call/cls_align_complex_double.c: New
FFI_TYPE_COMPLEX test.
* testsuite/libffi.call/cls_align_complex_float.c: Ditto.
* testsuite/libffi.call/cls_align_complex_longdouble.c: Ditto.
* testsuite/libffi.call/cls_complex_double.c: Ditto.
* testsuite/libffi.call/cls_complex_float.c: Ditto.
* testsuite/libffi.call/cls_complex_longdouble.c: Ditto.
* testsuite/libffi.call/cls_complex_struct_double.c: Ditto.
* testsuite/libffi.call/cls_complex_struct_float.c: Ditto.
* testsuite/libffi.call/cls_complex_struct_longdouble.c: Ditto.
* testsuite/libffi.call/cls_complex_va_double.c: Ditto.
* testsuite/libffi.call/cls_complex_va_float.c: Ditto.
* testsuite/libffi.call/cls_complex_va_longdouble.c: Ditto.
* testsuite/libffi.call/complex_double.c: Ditto.
* testsuite/libffi.call/complex_defs_double.c: Ditto.
* testsuite/libffi.call/complex_float.c: Ditto.
* testsuite/libffi.call/complex_defs_float.c: Ditto.
* testsuite/libffi.call/complex_longdouble.c: Ditto.
* testsuite/libffi.call/complex_defs_longdouble.c: Ditto.
* testsuite/libffi.call/complex_int.c: Ditto.
* testsuite/libffi.call/many_complex_double.c: Ditto.
* testsuite/libffi.call/many_complex_float.c: Ditto.
* testsuite/libffi.call/many_complex_longdouble.c: Ditto.
* testsuite/libffi.call/return_complex1_double.c: Ditto.
* testsuite/libffi.call/return_complex1_float.c: Ditto.
* testsuite/libffi.call/return_complex1_longdouble.c: Ditto.
* testsuite/libffi.call/return_complex2_double.c: Ditto.
* testsuite/libffi.call/return_complex2_float.c: Ditto.
* testsuite/libffi.call/return_complex2_longdouble.c: Ditto.
* testsuite/libffi.call/return_complex_double.c: Ditto.
* testsuite/libffi.call/return_complex_float.c: Ditto.
* testsuite/libffi.call/return_complex_longdouble.c: Ditto.
* src/raw_api.c (ffi_raw_to_ptrarray): Handle FFI_TYPE_COMPLEX
(ffi_ptrarray_to_raw): Ditto.
* src/prep_cif.c (ffi_prep_cif_core): Abort if FFI_TYPE_COMPLEX is not
implemented in libffi for the target.
* src/java_raw_api.c (ffi_java_raw_size): FFI_TYPE_COMPLEX not supported
yet (abort).
(ffi_java_raw_to_ptrarray): Ditto.
(ffi_java_rvalue_to_raw): Ditto.
(ffi_java_raw_to_rvalue): Ditto.
* src/debug.c (ffi_type_test): Add debug tests for complex types.
* include/ffi.h.in (FFI_TYPE_COMPLEX): Add new FFI_TYPE_COMPLEX.
(FFI_TYPE_LAST): Bump.
(ffi_type_complex_float): Add new ffi_type_....
(ffi_type_complex_double): Ditto.
(ffi_type_complex_longdouble): Ditto.
2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com>
* src/s390/ffitarget.h (FFI_TARGET_HAS_COMPLEX_TYPE): Define to provide
FFI_TYPE_COMPLEX support.
* src/s390/ffi.c (ffi_check_struct_type): Implement FFI_TYPE_COMPLEX
(ffi_prep_args): Ditto.
(ffi_prep_cif_machdep): Ditto.
(ffi_closure_helper_SYSV): Ditto.
Merge pull request #132 from nielsAD/master
Pascal and Register calling convention support on x86
Merge pull request #130 from frida/fix/darwin-aarch64-float-alignment
Fix alignment of FFI_TYPE_FLOAT for Apple's ARM64 ABI
Merge pull request #129 from frida/fix/darwin-aarch64-cif-prep
Fix non-variadic CIF initialization for Apple/ARM64
Merge pull request #124 from knuesel/master
Fix issue with builddir when calling configure with absolute path
Merge pull request #123 from ehsan/clang-cl
Add support for building with clang-cl
Determine whether register arguments (THISCALL/FASTCALL/REGISTER) are really passed via register to closures. Use stack if not.
Fixed THISCALL/FASTCALL closures and added basic support for PASCAL/REGISTER closures.
Support for calling functions with PASCAL and REGISTER calling conventions on x86 Windows/Linux.
Also changed indentation to be more consistent throughout the (adjusted) files.
Enable forcing the usage of the static CRT in libffi's msvc wrapper
This is required for AddressSanitizer builds with clang-cl.
Fix alignment of FFI_TYPE_FLOAT for Apple's ARM64 ABI
Fix non-variadic CIF initialization for Apple/ARM64
Turns out `aarch64_nfixedargs` wasn't initialized in the non-variadic
case, resulting in undefined behavior when allocating arguments.
Fix issue with builddir when calling configure with absolute path
Add support for building with clang-cl
Remove compiler warning
Fix paths in libffi.pc.in
Merge pull request #122 from rvandermeulen/1014976
Don't make --enable-debug imply using the debug CRT in libffi
Bug 1014976 - Don't make --enable-debug imply using the debug CRT in libffi.
Prepare for libffi 3.1.1
Add missing GNU stack markings in win32.S
Fix typo
Update current version.
Increment libtool version number
Merge pull request #120 from l0kod/tmpfile
Create temporary file with O_TMPFILE and O_CLOEXEC when available
closures: Check for mkostemp(3)
closures: Create temporary file with O_TMPFILE and O_CLOEXEC when available
The open_temp_exec_file_dir function can create a temporary file without
file system accessible link. If the O_TMPFILE flag is not defined (old
Linux kernel or libc) the behavior is unchanged.
The open_temp_exec_file_name function now need a new argument "flags"
(like O_CLOEXEC) used for temporary file creation.
The O_TMPFILE flag allow temporary file creation without race condition.
This feature/fix prevent another process to access the (future)
executable file from the file system.
The O_CLOEXEC flag automatically close the temporary file for any
execve. This avoid transmitting (executable) file descriptor to a child
process.
Update date. Annoucing 3.1 today.
Increment libtool library revision number
Update to version 3.1
Support versions of git older than 1.8.5
Fix testsuite for GCC 4.9.0
Check /proc/self/status for PaX status.
Use to get correct dir
Merge pull request #119 from joshtriplett/fastcall-fastball
src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
Merge pull request #101 from joshtriplett/fastcall-closures
Support closures for fastcall
Support fastcall closures
libffi on 32-bit x86 now supports closures for all supported ABIs.
Thus, rewrite the last remaining duplicated-by-ABI test (closure_stdcall
and closure_thiscall) to use the generic ABI_NUM/ABI_ATTR mechanism.
Merge pull request #80 from ueno/devel
Fix typo in doc
Merge pull request #86 from joshtriplett/testsuite-CC-CXX
testsuite ignores CC parameter supplied to configure or make
Merge pull request #116 from frida/fix/darwin-aarch64-variadic
Fix handling of variadic calls on Darwin/AArch64
Merge pull request #115 from frida/fix/darwin-aarch64-alignment
Fix alignment of AArch64 assembler functions
Merge pull request #117 from frida/fix/windows-regression
Fix Windows regression
Fix Windows regression
Introduced by b5fed601948237037513a9b7f967c8fc6c9ff1f6.
Fix handling of variadic calls on Darwin/AArch64
Fix alignment of AArch64 assembler functions
Merge pull request #114 from joshtriplett/bounce-on-a-tiny-trampoline
Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
The trampoline size is part of the ABI, so it cannot change. Move the
logic from the stdcall and thiscall trampolines to the functions they
call, to reduce them both to 10 bytes.
This drops the previously added support for raw THISCALL closures on
non-Windows. (Non-raw THISCALL closures still work.)
README: Note the testsuite changes to respect $CC and $CXX
README: Update Windows example to set both CC and CXX
Use the proper C++ compiler to run C++ tests
Running the C compiler with -shared-libgcc -lstdc++ does not work on
non-GCC compilers.
.travis.yml: Make the build command more readable by splitting at &&
"script" can contain multiple commands to run in sequence.
Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC
This fixes cross-compilation and compilation with CC="gcc -m32".
Stop looking for expect and runtest above top_builddir
Users wishing to test hand-compiled versions of expect and runtest can
easily enough put them in their path or set EXPECT and RUNTEST
themselves.
Stop setting an empty AM_RUNTESTFLAGS
Upgrade version to 3.1-rc1
Update copyright date and clean up README notes.
Merge pull request #108 from joshtriplett/freebsd
[3.1 blocker] Fix FreeBSD support
Merge pull request #106 from joshtriplett/darwin-award
[3.1 blocker] Update OS X build system to include win32.S on 32-bit
Merge pull request #110 from joshtriplett/w64
Fix 64-bit Windows support
Merge pull request #105 from joshtriplett/win32-relocations
[3.1 blocker] win32.S needs to handle relocations/GOT
Compile win32.S on FreeBSD
Compile win32.S on 32-bit Darwin as well
Always use configure to detect whether global symbols need underscores
64-bit Windows already used this check; make it universal, and use it in
place of an ifdef on X86_WIN32, to handle non-Windows platforms that use
the underscore, such as Darwin.
Fix a warning on 64-bit Windows
When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes
produces a "possible loss of data" warning. However, the size_t in
question refers to the size of a single parameter. Use a cast to avoid
the warning.
Avoid referencing undefined ABIs on 64-bit Windows builds
64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
win32.S: Add handling for position-independent code on Darwin
Newer versions of Darwin generate the necessary stub functions
automatically and just need a call instruction, but accomodating older
versions as well requires adding the stub.
win32.S: Use shifting for multiplication rather than repeated addition
The jump table code added a register to itself twice to multiply by 4;
shift the register left by 2 instead.
win32.S: Make the jump tables position-independent
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code. This fixes build failures on
target platforms that do not allow text relocations.
win32.S: Make calls to ffi_closure_SYSV_inner position-independent
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code. This fixes one source of build
failures on target platforms that do not allow text relocations.
Merge pull request #107 from rvandermeulen/msvcc
Various compatibility fixes and improvements to msvcc.sh.
Various compatibility fixes and improvements to msvcc.sh.
* Don't try to mix incompatible optimization flags in debug builds.
* Workaround ax_cc_maxopt.m4 not supporting MSVC and change -O3 to -O2.
* Fix MSVC warning by properly passing linker flags to compiler.
* Make msvcc.sh return 1 if invalid command line options are used rather than silently eating them.
* Add more comments.
Merge pull request #102 from joshtriplett/test-generic
Add ABIs to the test matrix; unify many bits of the testsuite
testsuite: Add ABIs to the test matrix; unify tests across ABIs
This eliminates all the *_win32.c tests in favor of the tests they were
branched from, and expands test coverage to run many more tests on
stdcall, thiscall, and fastcall.
This same mechanism also supports testing any other target that has
multiple ABIs.
testsuite: Replace ffitestcxx.h with ffitest.h
ffitest.h contains a superset of the functionality of ffitestcxx.h;
make the C++ tests include ffitest.h instead, and remove ffitestcxx.h.
testsuite: Unify the C and C++ testsuites
These two testsuites differ only in the source file glob and a couple of
additional compiler options; unify the remaining bits.
testsuite: ffitest.h: Parenthesize the CHECK macro
testsuite: Factor out a function to run a matrix of tests
This commons up code from libffi.call/call.exp and
libffi.special/special.exp, unifies the optimization option matrix
between the two, and makes it easier to add more axes to the matrix
in the future.
testsuite: Introduce a __THISCALL__ compiler-specific macro
Merge pull request #99 from joshtriplett/gitignore
.gitignore: Ignore more generated files
Merge pull request #100 from rvandermeulen/bug-756740
Change double quotes in Makefile.am to single quotes.
Change double quotes in Makefile.am to single quotes.
This was originally done in PR #84, except the change was made to Makefile.in instead of Makefile.am and was therefore reverted the next time the files were regenerated.
.gitignore: Ignore more generated files
The build process generates doc/libffi.info and fficonfig.h.in, so add
them to .gitignore.
testsuite: Introduce a __STDCALL__ compiler-specific macro
Several tests want to use stdcall, which differs in syntax by compiler,
so introduce a macro for it in ffitest.h.
testsuite: Common up the ifdef blocks for compiler-specific macros
Merge pull request #98 from joshtriplett/unconfigure.host
Merge configure.host into configure.ac
Merge configure.host into configure.ac
configure.host only has a single entry, and shows no signs of needing
more added.
Update version to 3.1-rc0. Clean up README.
Merge pull request #97 from joshtriplett/remove-more-generated-files
Remove more generated files
Merge pull request #96 from joshtriplett/sawing-changelogs
Generate ChangeLog from git in make dist; remove it from version control
doc: Remove autogenerated info file and stamp
fficonfig.h.in: Remove, configure generates it
Generate ChangeLog from git in make dist
Archive the existing ChangeLog to ChangeLog.libffi-3.1
ChangeLog.v1: Fix typo in explanatory header.
Add missing ChangeLog entry. Clean up some entries.
Merge pull request #95 from joshtriplett/news
README: Update news for 3.0.14
README: Update news for 3.0.14
Merge pull request #93 from joshtriplett/travis-dist
Make Travis check "make dist"
.travis.yml: Test "make dist" too.
Merge pull request #85 from joshtriplett/stdcall
stdcall support on Linux
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.
Merge pull request #90 from joshtriplett/win32-unifdef
prep_cif.c: Remove unnecessary ifdef for X86_WIN32
Merge pull request #89 from joshtriplett/travis32
.travis.yml: Test on both 32-bit and 64-bit
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.
.travis.yml: Test on both 32-bit and 64-bit
Merge pull request #94 from joshtriplett/esp-extra-stackery-perception
ChangeLog: Document testsuite changes to remove fragile stack pointer checks
ChangeLog: Document testsuite changes to remove fragile stack pointer checks
Merge pull request #91 from joshtriplett/esp-extra-stackery-perception
testsuite: Remove fragile stack pointer checks
testsuite: Remove fragile stack pointer checks
testsuite/libffi.call/closure_stdcall.c and
testsuite/libffi.call/closure_thiscall.c include inline assembly to save
the stack pointer before and after the call, and compare the values.
However, compilers can and do leave the stack in different states for
these two pieces of inline assembly, such as by saving a temporary value
on the stack across the call; observed with gcc -Os, and verified as
spurious through careful inspection of disassembly.
Merge pull request #88 from joshtriplett/such-precision-many-fail-wow
testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures
testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision
The test case testsuite/libffi.call/many_win32.c can spuriously fail due
to excess floating-point precision. Instrumenting it with some printf
calls shows differences well above FLT_EPSILON. (Note when
instrumenting it that multiple computations of the difference, such as
one in a print and another in the conditional, may produce different
results.)
Rather than complicating the test suite with architecture-specific flags
to avoid excess precision, just simplify the floating-point computation
to avoid a dependency on potential excess precision.
testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
The test case testsuite/libffi.call/many.c can spuriously fail due to
excess floating-point precision. Instrumenting it with some printf
calls shows differences well above FLT_EPSILON. (Note when
instrumenting it that multiple computations of the difference, such as
one in a print and another in the conditional, may produce different
results.)
Rather than complicating the test suite with architecture-specific flags
to avoid excess precision, just simplify the floating-point computation
to avoid a dependency on potential excess precision.
Merge pull request #92 from joshtriplett/autogen
Re-add libtool-ldflags
Re-add libtool-ldflags
Merge pull request #87 from joshtriplett/autogen
Remove autogenerated files from the repository
Remove autogenerated files from the repository
Add an autogen.sh to regenerate them.
Ensure the linker supports @unwind sections in libffi.
Fix merge
Merge pull request #81 from rvandermeulen/bug-756740
Allow building for mipsel with Android NDK r8.
Remove stray hunk that shouldn't have been included in this patch.
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
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
Allow building for mipsel with Android NDK r8. From Mozilla bug 756740.
https://bugzilla.mozilla.org/show_bug.cgi?id=756740
Fix typo in doc
Update Makefile for new darwin scripts
Add README note
Add missing -DFFI_DEBUG flag
Merge branch 'master' of github.com:/atgreen/libffi
Merge pull request #46 from makotokato/android-clang
Fix build failure when using clang for Android
Merge pull request #46 from makotokato/android-clang
Fix build failure when using clang for Android
Merge branch 'master' of github.com:/atgreen/libffi
Merge pull request #40 from wojdyr/master
Correct the -L flag in libffi.pc.in
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
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
Add ChangeLog entry for Josh's change
Merge pull request #75 from joshtriplett/longdouble
Fix build error on x86 without distinct long double
Rebuilt with new libtool
Merge branch 'master' of github.com:/atgreen/libffi
Conflicts:
ChangeLog
Fix spelling errors
Fix spelling errors
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
aarch64 fix
Fix ChangeLog merge
Fix build error on x86 without distinct long double
src/x86/ffi64.c: In function 'classify_argument':
src/x86/ffi64.c:205:5: error: duplicate case value
case FFI_TYPE_LONGDOUBLE:
^
src/x86/ffi64.c:202:5: error: previously used here
case FFI_TYPE_DOUBLE:
^
Merge pull request #72 from heiher/devel
MIPS N32: Fix call floating point va function
Merge pull request #68 from zeldin/master
Linux/ppc64: Remove assumption on contents of r11 in closure
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.
AArch64: Fix void fall-through case when assertions are enabled
AArch64: Fix missing semicolons when assertions are enabled
Remove build-ios from Makefile
Conflicts:
ChangeLog
Mention Aarch64 on iOS
Update ChangeLog
AArch64: Remove duplicitous element_count call.
This inhibits an analyzer warning by Clang.
Darwin/aarch64: Respect iOS ABI re: stack argument alignment
Darwin/aarch64: Fix size_t assumptions
Darwin/aarch64: Fix "shadows declaration" warnings
Darwin/aarch64: Use Clang cache invalidation builtin
Darwin/aarch64: Account for long double being equal to double
Darwin/aarch64: Use CNAME, restrict .size like ARM
Darwin/aarch64: Fix invalid reference in assembly
Darwin/x86_64: Fix 64-bit type shortening warnings
Darwin: Merge build scripts, redo project, incl. arm64
Darwin/iOS: Improve unified syntax use for LLVM
Fix dlmalloc warnings due to set_segment_flags, sizeof(size_t)
Darwin/iOS: Fix mis-typing of vfp_reg_free
Darwin/ARM: Assert on NULL dereference
This inhibits an analyzer warning by Clang on all platforms.
Darwin/i386: Inhibit Clang previous prototype warnings
Darwin/ARM: Inhibit Clang previous prototype warnings
Darwin/AArch64: Inhibit Clang previous prototype warnings
Linux/ppc64: Remove assumption on contents of r11 in closure
When the function called by the ffi called a function defined in a shared library generate a fatal error
The correction was to take into consideration the GOT.
Undo iOS ARM64 changes.
Merge branch 'master' of github.com:/atgreen/libffi
Mention Aarch64 on iOS
Mention Aarch64 on iOS
Remove build-ios from Makefile
Merge branch 'master' of github.com:/atgreen/libffi
Add ChangeLog entry.
Merge pull request #60 from zwaldowski/ios-redo
Mac/iOS support, including aarch64 port
Darwin: Properly export headers from Xcode project
Darwin: Freshen gen scripts, remove old build-ios.sh
Darwin/iOS: Include x86_64+aarch64 pieces in library
Darwin/aarch64: size_t assumptions
Darwin/aarch64: Fix “shadows declaration” warnings
Darwin/aarch64: Use Clang cache invalidation builtin
Darwin/aarch64: Inhibit Xcode warning
Darwin/aarch64: double == long double
Darwin/iOS prep script: try and compile for arm64
Darwin/aarch64: Restrict .size to ELF like arm32.
Darwin/aarch64: Potentially(?) fix compile error
Darwin/aarch64: Use CNAME refs
Darwin/Mac: Fix 64/32 shortening warnings
Darwin: Misc size_t warnings
Darwin: Fix dlmalloc warnings due to sizeof(size_t)
Darwin: Rebuild Xcode project
Darwin/iOS: Fix LLVM 3.3 warning re: memcpy.
Darwin: Clean up, modernize generator scripts
Darwin/Mac: Also exclude OS X generated source
Darwin/iOS: More unified syntax support w/ Clang.
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
Darwin: Silence Clang warnings.
Merge branch 'master' of github.com:/atgreen/libffi
Conflicts:
ChangeLog
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.
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.
Merge pull request #59 from iains/powerpc-darwin-unwind-fix
Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels.
Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels.
Clean up code to appease modern GCC compiler.
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.
Merge branch 'master' of github.com:/atgreen/libffi
Conflicts:
ChangeLog
src/powerpc/ffi.c
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.
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.
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
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
This patch prepares for ELFv2, where sizes of these areas change. It
also makes some minor changes to improve code efficiency.
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..
Fix sample closure code
Fix broken test cases
Merge branch 'master' of https://github.com/bivab/libffi
Conflicts:
ChangeLog
update Changelog
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.
Respect HAVE_ALLOCA_H
add a testcase for the double/float issue on ARMHF
stop trying to assing vfp regs once we are done with the registers
mark all vfp registers as used when done.
To avoid assigning registers the would fit, once arguments have been on
the stack, we mark all registers as used once we do not find a free
register for the first time.
UltraSPARC IIi fix. Update README and build configury.
Align the stack pointer to 16-bytes.
Mark executable as not requiring executable stack.
Fix up docs
Merge branch 'master' of github.com:/atgreen/libffi
Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
arc: Fix build error
Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
arc: Fix build error
Don't align stack for win32
Merge pull request #51 from vbudovski/for_upstream
Don't use 16 byte aligned stack for WIN32
Add more credits to README. Tidy up.
Update README
Fix N32 ABI issue for MIPS.
Update travis-ci build dependencies to include texinfo
Add nios2 port.
Fix testsuite bug
Fix many.c testcase for Aarch64
Fix spelling errors
Update README for M88K and VAX
Add m88k and VAX support. Update some configury bits.
Don't use 16 byte aligned stack for WIN32
This fixes a crash when accessing __stdcall functions in Python ctypes.
Fix build failure when using clang for Android
clang for Android generates __gnu_linux__ define, but gcc for Android doesn't. So we should add check it for Android
arc: Fix build error
One part of the patch for ARC support was missing in the upstreamed
version.
Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
little-endian ppc64 support
Rebuild for ARC additions
Revert "Merge pull request #36 from abergmeier/emscripten_fix"
This reverts commit 6a4d901dde7b3f87984c563505717cde3113d16e, reversing
changes made to b50a13b9c07ec09af4b9697e482acdad571e6961.
Merge pull request #36 from abergmeier/emscripten_fix
Fixes for building with Emscripten
Merge pull request #44 from foss-for-synopsys-dwc-arc-processors/arc_support
Add ARC support
Merge pull request #43 from JensTimmerman/__m128
added include for xmmintrin.h
added include for xmmintrin.h
Add ARC support
This adds support for the ARC architecture to libffi. DesignWare ARC
is a family of processors from Synopsys, Inc.
This patch has been tested on a little-endian system and passes
the testsuite.
Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
Update libffi.pc.in
use -L${toolexeclibdir} instead of -L${libdir}
to be consistent with Makefile.am
Enable disabling of libtool on platforms where it does not work (e.g. LLVM).
Build libraries normally then.
Merge pull request #34 from davidsch/armhf
Fix ARM hard-float support for large numbers of VFP arguments
update changelog
folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP
create separated versions of ffi_prep_incoming_args_* for SYSV and VFP ABIs.
The different versions will be called depending on the value of cif->abi
add a failing test for closures on ARM hardfloat
extend ffi_prepare_args for FFI_VFP (hard-float ABI), fixing an issue with passing VFP arguments in VFP registers and the stack, while at the same time not using all core registers.
separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention
move the hardfloat specific argument copying code to the helper function
extract setting of arguments to be passed to a helper function
extract code to align the argument storage pointer to a helper function
add a testcase, that on ARM hardfloat needs more than the 8 VFP argument registers to pass arguments to a call
use the absolute value to check the test result against an epsilon
Merge branch 'master' of github.com:/atgreen/libffi
Merge branch 'master' of github.com:/atgreen/libffi
Merge branch 'master' of github.com:/atgreen/libffi
cygwin fix & updates for 3.0.13
cygwin fix & updates for 3.0.13
Fix lib install dir
2.0.13rc1
Merge branch 'master' of github.com:/atgreen/libffi
Conflicts:
ChangeLog
Build fix for soft-float power targets
Documentation fix
Fix for m68000 systems
Fix for m68000 systems
Update configury.
Merge branch 'master' of github.com:/atgreen/libffi
Add Meta processor support
Merge pull request #32 from alex/patch-1
Fix for a crasher due to misaligned stack on x86-32.
Merge pull request #32 from alex/patch-1
Fix for a crasher due to misaligned stack on x86-32.
Fix for a crasher due to misaligned stack on x86-32.
Full information on reproduction (using Python's ctypes available here: http://bugs.python.org/issue17423)
Add moxie support. Release 3.0.12.
Update README
mend
sparc v8 and testsuite fixes
Fix small struct passing on ppc
Remove xfail for arm*-*-*.
Fix typo
More man page cleanup
Fix many.c testcase for ppc
Add missing files to dist
sparc v9 fixes for sun tools
Fix microblaze big-endian struct issue
Fix botched sparc patch. Update version.
Update bug report address. rc2.
Add cache flushing routine for sun compiler on sparc solaris 2.8
Add libtool-ldflags. Define toolexeclibdir for non-GCC builds.
x32 and libtool fixes
Remove a.out cruft from dist
Fix GCC usage test and update README
Fixes for AIX xlc compiler.
Fix man page. Clean out junk.
Bump soversion
Release candidate 1
Fix pkgconfig install bits
Work around LLVM ABI problem on x86-64
Merge pull request #28 from jralls/master
Reorder x86_64 checks
Reorder x86_64 tests
So that darwin and cygwin/mingw are tested before the generic check --
which allows them to actually be set.
Update README
Merge branch 'master' of github.com:/atgreen/libffi
Update README
Merge branch 'master' of github.com:/atgreen/libffi
New microblaze support
New microblaze support
Xtensa support
Mention IBM XL compiler support on AIX.
Remove obsolete inline test functions
xlc compiler support
[travis] install dejagnu with sudo
[travis] install dejagnu
Add first travis config file
32-bit x86 fix and more
Add compiler column to table
Fix for sunpro compiler on Solaris
Update documentation version.
Handle both 32 and 64-bit x86 builds regardless of target triple
Don't run EH tests with non-GNU compiler
Don't use warning checking macro with sun compiler
Don't use GCCisms to define types when
+ building with the SUNPRO compiler.
Fix for closures with sunpro compiler
Make sure we're running dejagnu tests with the right compiler.
Make compiler options in dejagnu runs compiler specific
Switch x86 Solaris to X86 from X86_64
Fix read-only eh_frame test
Only emit DWARF unwind info when building with GCC
Testsuite fix for Solaris vendor compiler
mend
Testsuite fixes (was Re: [PATCH] Fix libffi on m68k-linux-gnu, completely)
Dixi quod…
>although I believe some 3.0.11 checks to be broken:
And indeed, with a few minor changes on top of git master,
I still get a full run of PASS plus one XPASS on amd64-linux!
With the other patches (from this message’s parent) and
these applied, I get a full PASS on m68k-linux as well.
So, please git am these three diffs ☺
bye,
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
From 5cb15a3bad1f0fb360520dd48bfc938c821cdcca Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Sun, 2 Dec 2012 23:20:56 +0000
Subject: [PATCH 1/2] Fix tests writing to a closure retval via pointer casts
As explained in <Pine.BSM.4.64L.1212022014490.23442@herc.mirbsd.org>
all other tests that do the same cast to an ffi_arg pointer instead.
PASS on amd64-linux (Xen domU) and m68k-linux (ARAnyM)
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
m68k fixes for signed 8 and 16-bit calls.
remove gcc-ism
Add missing ChangeLog entry and generated files.
Merge pull request #26 from rofl0r/master
fix build error on ppc when long double == double
Merge pull request #23 from rurban/master
cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined
Regenerate files
Update texinfo.tex
Update config.guess and config.sub
Missing .gitignore changes for xcode support
missed x32 libtool patch.
missed trampoline_table patch. Move to GCC.
Windows symbol export fix. Move to GCC.
+2012-03-21 Peter Rosin <peda@lysator.liu.se>
+
+ * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
+ (set_ld_library_path_env_vars): Add the library search dir to PATH
+ (and save PATH for later).
+ (restore_ld_library_path_env_vars): Restore PATH.
med
Test GCC update
New stand-alone patch
Merge with GCC. Eliminate quilt bits.
Refresh config.guess and config.sub
fix build on ppc when long double == double
Pull in config.sub for aarch64 support and more
Add missing aarch64 configury bits
Rebase for ppc64 fix
Add PaX work-around
Fix commit conflicts
Darwin12 fix
AArch64 port
AArch64 port
Fix autoconf macros
Update Tile* port info
TILE-Gx/TILEPro support
Rebase
cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined
otherwise only static libs are created.
iOS build fixes.
Update README with Blackfin/uClinux support
Add blackfin supprt from Alexandre Keunecke.
3.0.11
Update files to ship
More mac/ios build improvements
Fix typo for darwin targets
mend
Build iOS library with xcode
Reapply missing testsuite changes for arm
Update to rc4. Upgrade autoconf version.
Fix Linux/x32 reference in README
Linux/x32 libtool fix
Update libtool version, README, tests dists
Revert debug code changes
Fix building with Clang for Darwin (OS X 10.6+ and iOS
4.0+)
Fix return_uc.c test case on windows.
Repair ppc build regression.
Various MSVC-related changes.
ARM VFP fix for old toolchains
Rebase on fixed GCC sources
Fix vararg float test
More cygwin fixes
Rebase post GCC merge
abi check fixes and Linux/x32 support
Add -no-undefined for both 32- and 64-bit x86
windows-like hosts.
Ensure that users don't include ffitarget.h directly
Fix ABI check regression
Rebased from gcc
Refresh autoconf-archive m4 scripts
Rebase from GCC
Alpha fix
mend
mend
Add Amiga support
Unlikely fixes
mend
mend
m68k fixes
Refresh
Update variadic patch
Fix cls_double_va.c and update docs
Rerun automake
Update version number
Fix last patch
Add David Gilbert's variadic function call support
clean up
Add powerpc soft float support
Remove junk file
Fix kfreebsd
Add missing ChangeLog entry
Fix arm wince alignment issue
Remove use of ppc string instructions
Fix darwin11 build problem
Fix ax_enable_builddir macro on BSD systems
Rebase
Build assembly files with debug info
Regenerate configury with missing m4 macros
Update list of supported OpenBSD systems
3.0.11-rc1. soname bump.
Version 3.0.10
Fix use of autoconf macros
Many new patches
Revert remove-debug-code patch temporarily (for ARM Fedora release)
Refresh from GCC
Fix darwin EH
Fix permissions
More AIX fixes. rc9.
Merge branch 'master' of https://github.com/landonf/libffi-ios
rc8. fix last patch.
rc7. More AIX fixes.
Fix ppc32 bug
Another non-GCC configury fix
Fix ax_cc_maxopt.m4
Fix warning and msvcc patches
Add missing msvcc.sh
Merge remote branch 'upstream/master'
Fix bad_abi test. rc5.
iOS fixes
Add support for building a full armv6/armv7/i386 universal iOS library
Update my e-mail address.
Fix symbol prefixes on Darwin.
Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
This re-integrates commit da2773e02ab26cc11a7f.
Apple assembler support; fixed most gas/ELF-isms.
Replace RETLDM macro.
The macro is incompatible with Apple's assembler; switch to
a simple inline version.
Switch to the current iOS 4.2 SDK.
Merge remote branch 'upstream/master'
Merge branch 'master' of github.com:landonf/libffi-ios
Allow specification of the minimum supported iOS version.
rc4
ungccify parts of the build
Fix permissions
Use newer autotools. Only build debug.c when --enable-debug.
Fix xlc build on AIX
sparc ABI test fix.
Fix tests
Fix permissions
rc3
Fix IRIX support
Add powerpc64-*-darwin* support
Add Interix support
Remove README.markdown form libffi-ios
Fix xfails
Update README for iOS again
Update to rc2
Add ChangeLog entry. Fix copyright headers.
Add missing change
Fix make dist
fix permissions
3.0.10rc1
Clean ups
Update README
Add iOS support
3.0.10rc0 changes
Rebase from GCC
copyright updates patch
Fix msvcc.sh botch
Fix HP-UX build
Fix sparc v8 aggregate type returns for sun's compiler
grammar fix
Fix AIX build with IBM XLC
fix win64-underscore patch
x86 pcrel test part 2
x86 pcrel test
Refresh from GCC
win64-underscore patch
Rebase
Include the license header in the generated output.
Add missing copyright/license header.
Minor README fix.
Minor README fix.
Add a libffi-ios-specific github README.
Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM.
This provides working closure support on iOS/ARM devices where
PROT_WRITE|PROT_EXEC is not permitted. The code passes basic
smoke tests, but requires further review.
Rename the generated symbol
Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
Regenerated the autoconf script
Enable AC_SUBST for FFI_EXEC_TRAMPOLINE_TABLE
Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation.
This implements support for re-mapping a shared table of executable
trampolines directly in front of a writable configuration page, working
around PROT_WRITE restrictions for sandboxed applications on Apple's
iOS.
This implementation is for testing purposes; a proper allocator is still
necessary, and ARM-specific code needs to be moved out of
src/closures.c.
Fix symbol prefix for ffi_closure_SYSV_inner on Darwin.
Whitespace/comment fixes.
Fix the script name (build-iphone.sh -> build-ios.sh)
Update the autogenerated autoconf/automake files.
Update automake/autoconf to conditionally build src/arm/trampoline.S if FFI_EXEC_TRAMPOLINE_TABLE is enabled.
Add the trampoline table generated by gentramp.sh
Add a shell script that generates the ARM trampoline page.
This generates a page of 340 trampolines, aligned within one page. The
trampolines use pc-relative addressing to reference config data
(context, jump address) from a page placed directly prior to the
trampoline page. This can be used on systems -- such as iOS -- that do not
support writable, executable memory by remapping the executable page
containing the trampolines directly above a newly allocated writable
config page.
Update autoconf files
Add autoconf check for W^X platforms that require a trampoline table.
This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for
arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is
not permitted for sandboxed binaries.
Use the correct host triple for arm/darwin
Add missing UNWIND entry; disables .pad on non-EABI targets.
Apple assembler support; fixed most gas/ELF-isms.
Fix placement of the __APPLE__ macro.
Work-around libffi's FP ABI detection.
On iOS, we must use the AAPCS floating point return value calling
conventions. libffi's ARM implementation will only use these conventions
if __SOFTFP__ is defined, which is not the case when GCC's
-mfloat-abi defaults to 'softfp' instead of 'soft'. To work around this
we manually define __SOFTFP__ for Apple platforms in the ARM-specific
sysv.S.
See also:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iPhoneOSABIReference/Introduction/Introduction.html
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf
Add a stub iOS build script to drive autoconf
Restore execute permissions
Fix win64-struct-args patch
Fix debug build for windows
Don't use -safeseh with ml64
stdcall-x86-closure-fix
define generic symbols carefully
don't copy win64 struct args
FFI_LAST_ABI fix
rebase
Fix selinux test
Micharl Kohler's spelling fixes
Rebase to latest GCC sources
Remove warnings and add OS/2 support
Dan Witte's windows build fixes.
Remove junk file
fix-comments patch
Rebuild Makefiles with automake 1.11.1 for CVE-2009-4029.
Mention recent changes in README
Add msvc.sh wrapper
Microsoft Visual C port
Add x86 Sun Studio compiler support
Add closure example doc
Rebase from GCC
Add x86-64 MingW to README
Reset quilt patches post 3.0.9 merge with GCC
Update version
Final updates before 3.0.9
really 3.0.9rc12
3.0.9rc12
3.0.9rc11
HPUX support and avr32 test fixes.
3.0.9rc9
Remove xfails for mips and arm
Remove a bunch of xfails.
Fix huge_struct for solaris
3.0.9rc8
3.0.9rc8
Rebase from GCC
Add Andreas Schwab's powerpc fix
3.0.9rc7
Updated some mips XFAILs
Clean up ChangeLog.libffi for older patches.
Clean up undefine_AC_ARG_VAR_PRECIOUS patch.
Fix patches
Add windows support patch.
3.0.9rc6
3.0.9rc6
Release 3.0.9rc5
Update README
Update missing changes for 3.0.9r4.
Switch to quilt. Rebase to latest GCC.
Merge branch 'master' of git@github.com:atgreen/libffi
More clean up.
Clean up
From Jens Rehsack. Fix for 64-bit AIX.
From Abdulaziz Ghuloum. Adds special case for Snow Leopard.
Fix detection of free/openbsd. From Alexis Ballier.
AVR support
Initial stand-alone patch.
Initial commit
Update version to 3.0.9rc1. Add more useful things to .gitignore.
Add .gitignore
Remove old CVSROOT files.
Apply Dave Korn's cygwin/GCC changes
2009-06-16 Wim Lewis <wiml@hhhh.org>
* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
supposed to be callee-saved.
* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
return buffer for odd-size structs.
2009-06-16 Andreas Tobler <a.tobler@schweiz.org>
PR libffi/40444
* testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
allow_stack_execute for Darwin.
2009-06-16 Andrew Haley <aph@redhat.com>
* configure.ac (TARGETDIR): Add missing blank lines.
* configure: Regenerate.
2009-06-16 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/cls_align_sint64.c,
testsuite/libffi.call/cls_align_uint64.c,
testsuite/libffi.call/cls_longdouble_va.c,
testsuite/libffi.call/cls_ulonglong.c,
testsuite/libffi.call/return_ll1.c,
testsuite/libffi.call/stret_medium2.c: Fix printf format
specifiers.
* testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
* testsuite/libffi.call/float2.c: Fix dg-excess-errors.
* testsuite/libffi.call/ffitest.h,
testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
2009-06-16 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
* testsuite/libffi.call/err_bad_abi.c: Likewise.
2009-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
* testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
* testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
* testsuite/libffi.call/err_bad_typedef.c: Likewise.
2009-06-12 Andrew Haley <aph@redhat.com>
* ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
testsuite/libffi.call/cls_align_uint64.c,
testsuite/libffi.call/cls_ulonglong.c,
testsuite/libffi.call/return_ll1.c,
testsuite/libffi.call/stret_medium2.c: Fix printf format
specifiers.
testsuite/libffi.special/unwindtest.cc: include stdint.h.
update changelog
use ffi_closure_alloc instead of stack-based closure
remove unused extern
remove not-yet-applied changelog entries
add win64 support
2009-06-08 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/err_bad_abi.c: Add xfails.
* testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
* testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
* testsuite/libffi.call/err_bad_typedef.c: Add xfails.
* testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
* testsuite/libffi.call/stret_medium.c: Likewise.
* testsuite/libffi.call/stret_large2.c: Likewise.
* testsuite/libffi.call/stret_large.c: Likewise.
2009-06-05 Andrew Haley <aph@redhat.com>
* src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc.
2009-06-04 Andrew Haley <aph@redhat.com>
* src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
2009-06-04 Andrew Haley <aph@redhat.com>
* src/mips/o32.S,
src/mips/n32.S: Fix licence formatting.
2009-06-04 Andrew Haley <aph@redhat.com>
* src/x86/darwin.S: Fix licence formatting.
src/x86/win32.S: Likewise.
src/sh64/sysv.S: Likewise.
src/sh/sysv.S: Likewise.
2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh64/ffi.c: Remove lint directives. Was missing from merge
of Andreas Tobler's patch from 2006-04-22.
2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
2007-03-07.
2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
* src/x86/win32.S (_ffi_closure_STDCALL): New function.
(.eh_frame): Add FDE for it.
2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
* configure.ac: Also check if assembler supports pc-relative
relocs on X86_WIN32 targets.
* configure: Regenerate.
* src/x86/win32.S (ffi_prep_args): Declare extern, not global.
(_ffi_call_SYSV): Add missing function type symbol .def and
add EH markup labels.
(_ffi_call_STDCALL): Likewise.
(_ffi_closure_SYSV): Likewise.
(_ffi_closure_raw_SYSV): Likewise.
(.eh_frame): Add hand-crafted EH data.
2008-11-21 Eric Botcazou <ebotcazou@adacore.com>
* src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
signed/unsigned int8/16 return values.
* src/sparc/v8.S (ffi_call_v8): Likewise.
(ffi_closure_v8): Likewise.
2008-03-26 Kaz Kojima <kkojima@gcc.gnu.org>
* src/sh/sysv.S: Add .note.GNU-stack on Linux.
* src/sh64/sysv.S: Likewise.
2008-03-26 Daniel Jacobowitz <dan@debian.org>
* src/arm/sysv.S: Fix ARM comment marker.
properly glob-match
Mark XFAIL on longdouble tests for x86_64/mingw
clean up tests for win64 use
Version 3.0.8 with x86-solaris support
Bump to 3.0.7
Many test fixes (failures due to excessive compiler warnings).
Version 3.0.6. sh/sh64 fixes.
Rev 3.0.5.
3.0.5
2008-03-04 Anthony Green <green@redhat.com>
Blake Chaffin
hos@tamanegi.org
* testsuite/libffi.call/cls_align_longdouble_split2.c
testsuite/libffi.call/cls_align_longdouble_split.c
testsuite/libffi.call/cls_dbls_struct.c
testsuite/libffi.call/cls_double_va.c
testsuite/libffi.call/cls_longdouble.c
testsuite/libffi.call/cls_longdouble_va.c
testsuite/libffi.call/cls_pointer.c
testsuite/libffi.call/cls_pointer_stack.c
testsuite/libffi.call/err_bad_abi.c
testsuite/libffi.call/err_bad_typedef.c
testsuite/libffi.call/huge_struct.c
testsuite/libffi.call/stret_large2.c
testsuite/libffi.call/stret_large.c
testsuite/libffi.call/stret_medium2.c
testsuite/libffi.call/stret_medium.c: New tests from Apple.
clicky
getclicky
2008-02-26 Jakub Jelinek <jakub@redhat.com>
Anthony Green <green@redhat.com>
* src/alpha/osf.S: Add .note.GNU-stack on Linux.
* src/s390/sysv.S: Likewise.
* src/powerpc/linux64.S: Likewise.
* src/powerpc/linux64_closure.S: Likewise.
* src/powerpc/ppc_closure.S: Likewise.
* src/powerpc/sysv.S: Likewise.
* src/x86/unix64.S: Likewise.
* src/x86/sysv.S: Likewise.
* src/sparc/v8.S: Likewise.
* src/sparc/v9.S: Likewise.
* src/m68k/sysv.S: Likewise.
* src/ia64/unix.S: Likewise.
* src/arm/sysv.S: Likewise.
2008-02-26 Anthony Green <green@redhat.com>
Thomas Heller <theller@ctypes.org>
* src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
comment.
2008-02-26 Anthony Green <green@redhat.org>
Thomas Heller <theller@ctypes.org>
* include/ffi.h.in: Change void (*)() to void (*)(void).
2008-02-26 Anthony Green <green@spindazzle.org>
* src/alpha/ffi.c: Change void (*)() to void (*)(void).
src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,> src/x86/ffi64.c: Ditto.
fix date
New release
2008-02-24 Anthony Green <green@spindazzle.org>
* configure.ac: Accept openbsd*, not just openbsd.
Bump version to 3.0.4.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
* libtool-version: Increment revision.
* README: Update for new release.
sync readme with web page.
New release
2008-02-22 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.3.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
* libtool-version: Increment revision.
* README: Update for new release. Clean up test docs.
Update configure script.
2008-02-22 Bjoern Koenig <bkoenig@alpha-tierchen.de>
Andreas Tobler <a.tobler@schweiz.org>
* configure.ac: Add amd64-*-freebsd* target.
* configure: Regenerate.
2008-02-22 Thomas Heller <theller@ctypes.org>
* configure.ac: Add x86 OpenBSD support.
* configure: Rebuilt.
Fix README.
3.0.2
add missing file
2008-02-21 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.2.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
* libtool-version: Increment revision.
* README: Update for new release.
2008-02-21 Björn König <bkoenig@alpha-tierchen.de>
* src/x86/freebsd.S: New file.
* configure.ac: Add x86 FreeBSD support.
* Makefile.am: Ditto.
Updated
2008-02-15 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.1.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
* libtool-version: Increment revision.
* README: Update for new release.
2008-02-15 David Daney <ddaney@avtrex.com>
* src/mips/ffi.c: Remove extra '>' from include directive.
(ffi_prep_closure_loc): Use clear_location instead of tramp.
Add more platforms.
3.0 notes
Update
2008-02-15 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.0,
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
2008-02-15 David Daney <ddaney@avtrex.com>
* src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
Define (conditionally), and use it to include cachectl.h.
(ffi_prep_closure_loc): Fix cache flushing.
* src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
New release
* man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
Update dates and remove all references to ffi_prep_closure.
* configure.ac: Bump version to 2.99.9.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
New release.
* man/ffi_prep_closure.3: Delete.
* man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
(man_MANS): Ditto.
* man/Makefile.in: Rebuilt.
* configure.ac: Bump version to 2.99.8.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
Update.
* configure.ac: Bump version to 2.99.7.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
* include/ffi.h.in LICENSE src/debug.c src/closures.c
src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
src/arm/ffitarget.h src/prep_cif.c: Update license text.
New release
Update supported platforms. Bump version.
* configure.ac: Bump version to 2.99.5.
* configure: Rebuilt.
* Makefile.am (EXTRA_DIST): Add darwin64.S
* Makefile.in: Rebuilt.
* testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
* LICENSE: Update WARRANTY.
update license reference
Update WARRANTY
fix tarball reference
First update in 5 years!
Fix .pc file bug and bump version
Add man files and info file. Update README. Tag as 2.99.3.
Move entry from ChangeLog to ChangeLog.libffi
* aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
* mdate-sh, texinfo.tex: New files.
* Makefile.am (info_TEXINFOS): New variable.
* doc/libffi.texi: New file.
* doc/version.texi: Likewise.
* Makefile.am (AM_CFLAGS): Don't compile with -D.
(lib_LTLIBRARIES): Define.
(toolexeclib_LIBRARIES): Undefine.
* Makefile.in: Rebuilt.
* configure.ac: Reset version to 2.99.1.
* configure.in: Rebuilt.
Fix typo.
* libffi.pc.in: Usse @PACKAGE_NAME@ and @PACKAGE_VERSION@.
* configure.ac: Reset version to 2.99.1.
* configure.in: Rebuilt.
* Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
* Makefile.in: Rebuilt.
* LICENSE: Update copyright notice.
Fix make dist again
Fix make dist
Use pkgconfig. Increment libtool CURRENT version.
Fix header installs when using DESTDIR.
update changelog
offset from code base address, not data base address
Fix header installs.
Revert my broken changes to twall's patch.
Fix make dist .
Add Tim Wall's x86 windows patch.
Add HJ's -fomit-frame-pointer struct return fix
Clean up for new automake.
Fixes to run testsuite
New files from gcc tree.
Latest gcc svn sources
Install ffitarget.h in $prefix/include.
Add new files.
Merge from gcc
Pulled in libffi from gcc trunk.
Fixed build and install for standalone use.
sourcware.org
Add LockDir
Add link to Gianni's web site.
Newer, better, increased from before! (list of acceptable anon usernames)
Fixed Cygnus references.
Testsuite fixes.
* include/ffi_common.h: Delete, after moving contents to...
* include/ffi_private.h: Subsume contents of ffi_common.h.
* include/Makefile.am (noinst_HEADERS): Remove ffi_common.h.
* include/Makefile.in: Rebuilt.
* arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c,
ia64/ffi.c: Include ffi_private.h, not ffi_common.h.
* alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h.
* types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include
ffi_common.h.
* debug.c: Include ffi_private.h instead of ffi_common.h.
* mips/ffi.c (calc_n32_struct_flags): Make static.
(FIX_ARGP): Remove call to debugging routine ffi_stop_here.
* mips/n32.S: Include ffi_private.h.
* mips/o32.S: Include ffi_private.h.
* README: Update some comments.
* Makefile.am (SUBDIRS): Add include so ffi.h gets installed.
* Makefile.in: Rebuilt.
* include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__.
* types.c: Ditto.
* prep_cif.c (ffi_prep_cif): Ditto.
* alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S:
Include ffi_private.h.
* include/ffi_private.h (FFI_TYPE_LAST): Define.
Moved files from old home
These are dead.
All these files live somewhere else now.
Many changes. Not quite there yet.
Moved m68k files
New, target indepentent, header
Many changes.
Many changes
Moved ia64 files
Moved arm files
Many many updates. Merge from gcc and then some.
Mnay fixes.
Merge from libgcj. Merged patches from net. See ChangeLog for details.
1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
Deleted; generic versions now used for all repositories.
* CVSROOT/commitinfo, CVSROOT/loginfo: Change pathnames to
generic versions.
* CVSROOT/checkoutlist: Don't try to check out the removed
files any longer.
1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
Deleted; generic versions now used for all repositories.
* CVSROOT/commitinfo, CVSROOT/loginfo: Change pathnames to
generic versions.
* CVSROOT/checkoutlist: Don't try to check out the removed
files any longer.
New configury
* include/ffi.h.in: Try to work around messy header problem
with PACKAGE and VERSION.
* configure: Rebuilt.
* configure.in: Change version to 2.00-beta.
* fficonfig.h.in: Rebuilt.
* acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
* src/x86/ffi.c (ffi_raw_call): Rename.
New file for Kresten's closure work
Kresten's closure work. Initial checkin.
* configure.in: Add x86 and powerpc BeOS configurations.
From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
1999-05-12 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Add links to libffi* mail list archives.
* configure.in: Add warning about this being beta code.
Remove src/Makefile.am from the picture.
* configure: Rebuilt.
* Makefile.am: Move logic from src/Makefile.am. Add changes
to support libffi as a target library.
* Makefile.in: Rebuilt.
* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
Upgraded to new autoconf, automake, libtool.
* README: Tweaks.
* LICENSE: Update copyright date.
* src/Makefile.am, src/Makefile.in: Removed.
Updated to new automake, libtool, autoconf - nothing works :-)
1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Missed a reference to libffi-discuss@cygnus.com. Fixed.
1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Change links to ftp directory to point to sourceware
directory.
Change mailing list subscription forms to point to sourceware lists.
Standard sourceware setup.
Small typeo. (I wouldn't bother except that it made the sentence hard
for me to parse on a casual read.)
A few cleanups. Most notably, point to the correct subscribe cgi-bin
script.
* index.html: Reformatted and updated to reflect hosting on
sourceware.cygnus.com (new mailing lists, etc).
initial snapshot of documentation
Initial revision
This commit was generated by cvs2svn to compensate for changes in r7, which
included commits to RCS files with non-trunk default branches.
Import of v1 code.
Send commit messages to mailing lists.
initial checkin
Add standard setup.
Add readers and standard modules file.
initial checkin