Commit Graph

1142 Commits

Author SHA1 Message Date
Anthony Green
5314b10671 test static lib 2018-01-10 07:22:51 -05:00
Anthony Green
bec6135dff Merge pull request #393 from thejunkjon/master
Linker error "recompile with -fPIC" for x86_64
2018-01-10 07:20:04 -05:00
Anthony Green
f6ecf10ca0 Merge pull request #401 from wzssyqa/jr-r6
mips/ffi.c: fix encoding for jr on r6
2018-01-05 16:51:44 -05:00
YunQiang Su
746dbe3a6a mips/ffi.c: fix encoding for jr on r6
mips/ffi.c: instruction jr has a different encoding for r6
2018-01-03 10:07:41 +08:00
Anthony Green
c50ba182f4 Merge pull request #398 from emaste/master
Enable symbol versioning when ld is LLVM's lld
2018-01-01 15:18:46 -05:00
Anthony Green
54cb3e2345 Merge pull request #396 from wzssyqa/master
mips/n32.S: disable .set mips4 on mips r6
2017-12-31 07:46:05 -05:00
Ed Maste
af6949b7af Enable symbol versioning when ld is LLVM's lld
Fixes #397
2017-12-17 23:08:52 -05:00
YunQiang Su
94c102aa69 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.
2017-12-10 14:25:01 +08:00
jon
d15581c696 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)' 2017-12-01 00:34:30 -08:00
Anthony Green
716bfd8317 Merge pull request #387 from trofi/master
Makefile.am: add 'src/s390/internal.h' to source tarball
2017-11-05 09:02:37 -05:00
Sergei Trofimovich
cd5e9f8b87 Makefile.am: add 'src/s390/internal.h' to source tarball
commit 2f530de168
("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>
2017-11-05 13:56:42 +00:00
Anthony Green
4fdbb0578e Merge pull request #320 from 0-wiz-0/master
Support NetBSD with mprotect.
2017-11-03 07:05:31 -04:00
Anthony Green
b302bc3dfe Merge pull request #322 from compnerd/aarch64-base
aarch64: fix index base register for AArch64
2017-11-03 07:03:55 -04:00
Anthony Green
14eac93869 Merge pull request #384 from yan12125/fix-sgidefs-checking
Fix linux detection (closes #303)
2017-11-03 06:49:03 -04:00
Yen Chi Hsuan
9fc9dc535e Fix linux detection (closes #303) 2017-10-27 16:12:56 +08:00
Saleem Abdulrasool
1fb788ac89 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.
2017-10-26 19:13:10 -07:00
Anthony Green
ad15ae762c Merge pull request #298 from frida/fix/ios-trampoline-table-complexity
Simplify iOS trampoline table allocation
2017-10-25 13:16:49 -04:00
Anthony Green
dc2ff5baab Merge pull request #323 from compnerd/x86-alloca-alignment
x86: align alloca to 16-byte boundary
2017-10-25 13:11:40 -04:00
Anthony Green
927da71662 Merge pull request #379 from jlj/master
Xcode build improvements
2017-10-25 13:05:53 -04:00
Anthony Green
a0455c0318 Merge pull request #383 from hjl-tools/hjl/master
Hjl/master
2017-10-25 13:04:23 -04:00
Anthony Green
0faf614529 Merge pull request #381 from compnerd/ffi-nullptr-deref
arm: fix a level of indirection issue
2017-10-25 13:03:55 -04:00
H.J. Lu
9d9d92b47f Skip WIN64/EFI64 support for x32
Since x32 doesn't support WIN64/EFI64, skip it if __ILP32__ is defined.
2017-10-25 05:37:30 -07:00
H.J. Lu
b2a343ffc6 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.
2017-10-25 05:36:49 -07:00
Saleem Abdulrasool
3c372c384a 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.
2017-10-24 16:44:54 -07:00
Jean-Luc Jumpertz
181fc4cc9c 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
2017-10-23 15:02:29 +02:00
Jean-Luc Jumpertz
54529ba1db Added a tvOS target in Xcode project. Misc Xcode project cleanup. 2017-10-23 09:49:35 +02:00
Saleem Abdulrasool
79d1509cb0 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.
2017-10-22 14:09:51 -07:00
Tom Tromey
8d26e8c6da Merge pull request #326 from trofi/master
src/ia64/unix.S: unbreak small struct handling
2017-10-17 10:46:49 -06:00
Sergei Trofimovich
ed7488c003 src/ia64/unix.S: unbreak small struct handling
commit 6e8a446083
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>
2017-10-17 13:00:51 +01:00
Anthony Green
1c9171ec89 Merge pull request #324 from compnerd/arm-zext
arm: zext return value parameters
2017-10-10 23:19:57 -04:00
Saleem Abdulrasool
7ad0ae7f42 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.
2017-10-10 11:46:20 -07:00
Joerg Sonnenberger
2bfcd29955 Support NetBSD with mprotect.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2017-10-02 15:34:03 +02:00
Tom Tromey
9f1f8741b2 Merge pull request #319 from angerman/patch-5
Adds `local.exp` to DISTCLEANFILES
2017-10-01 20:25:50 -06:00
Moritz Angermann
6cf0dea78a Change CLEANFILES to DISTCLEANFILES 2017-10-02 10:20:16 +08:00
Tom Tromey
dca078f468 Merge pull request #316 from angerman/patch-2
Add `configure.host` and `libtool-version` to the `EXTRA_DIST` files
2017-10-01 20:19:53 -06:00
Tom Tromey
540258d13e Merge pull request #317 from angerman/patch-3
Add src/x86/asmnames.h to noinst_HEADERS
2017-10-01 20:17:02 -06:00
Moritz Angermann
bccba9a34e Merged 2017-10-01 12:48:17 +08:00
Moritz Angermann
6b6df1a7bb 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.
2017-10-01 12:37:53 +08:00
Moritz Angermann
59d65d74ae Include libtool-version in the EXTRA_DIST files. 2017-10-01 12:23:31 +08:00
Moritz Angermann
4c6aa78d75 Add src/x86/asmnames.h to noinst_HEADERS
In eaa59755fc, 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.
2017-10-01 11:32:41 +08:00
Moritz Angermann
a1e6ccb67e 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.
2017-10-01 11:28:40 +08:00
Anthony Green
93d8e7dd17 Fix #265 2017-09-27 21:51:34 -04:00
Anthony Green
02a5145abb Merge pull request #263 from ksjogo/master
fix ios builds
2017-09-27 21:43:03 -04:00
Anthony Green
10099d6cad Merge pull request #271 from frida/fix/qnx-cache-flushing
arm: Fix cache flushing on QNX
2017-09-27 20:54:09 -04:00
Anthony Green
c8f1aa3d04 Merge pull request #307 from zw3rk/master
Support -ios triple
2017-09-27 20:53:50 -04:00
Anthony Green
db4dad97e2 Merge pull request #312 from fjricci/fix_ub
Fix misaligned memory access in ffi_call_int
2017-09-27 20:47:08 -04:00
Anthony Green
8a16f2f47f Merge pull request #308 from trex58/master
This patch enables FFI Go Closure on AIX.
2017-09-27 20:45:15 -04:00
Jean-Luc Jumpertz
a78da73956 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.
2017-09-04 15:55:34 +02:00
Francis Ricci
9c12209d2e Fix misaligned memory access in ffi_call_int 2017-08-03 10:46:28 -07:00
Tom Tromey
b23091069a Merge pull request #309 from rurban/oldgcc
__attribute__ deprecated (msg) only since gcc 4.5
2017-07-12 12:43:06 -06:00