Commit Graph

558 Commits

Author SHA1 Message Date
Anthony Green
3dc3f32c35 Undo iOS ARM64 changes. 2013-12-05 16:23:25 -05:00
Anthony Green
356b2cbc30 Merge branch 'master' of github.com:/atgreen/libffi 2013-11-30 22:38:13 -05:00
Anthony Green
484a758426 Mention Aarch64 on iOS 2013-11-30 22:37:50 -05:00
Anthony Green
07345a30ec Mention Aarch64 on iOS 2013-11-30 21:06:51 -05:00
Anthony Green
d4b931c1b8 Remove build-ios from Makefile 2013-11-30 20:58:31 -05:00
Anthony Green
dfbf236d70 Merge branch 'master' of github.com:/atgreen/libffi
Add ChangeLog entry.
2013-11-30 20:55:47 -05:00
Anthony Green
bb9740e545 Merge pull request #60 from zwaldowski/ios-redo
Mac/iOS support, including aarch64 port
2013-11-30 17:54:39 -08:00
Zachary Waldowski
4d701e03fa Darwin: Properly export headers from Xcode project 2013-11-30 13:25:55 -05:00
Zachary Waldowski
022f12eb9a Darwin: Freshen gen scripts, remove old build-ios.sh 2013-11-30 12:21:38 -05:00
Zachary Waldowski
e820fe2025 Darwin/iOS: Include x86_64+aarch64 pieces in library 2013-11-30 12:03:51 -05:00
Zachary Waldowski
0278284e47 Darwin/aarch64: size_t assumptions 2013-11-30 12:02:18 -05:00
Zachary Waldowski
9775446b64 Darwin/aarch64: Fix “shadows declaration” warnings 2013-11-30 04:17:00 -05:00
Zachary Waldowski
4260badc37 Darwin/aarch64: Use Clang cache invalidation builtin 2013-11-30 04:16:58 -05:00
Zachary Waldowski
9fa7998d5f Darwin/aarch64: Inhibit Xcode warning 2013-11-30 04:16:56 -05:00
Zachary Waldowski
0e832048a9 Darwin/aarch64: double == long double 2013-11-30 04:16:53 -05:00
Zachary Waldowski
602dc22d76 Darwin/iOS prep script: try and compile for arm64 2013-11-30 04:16:53 -05:00
Zachary Waldowski
b513dfe79d Darwin/aarch64: Restrict .size to ELF like arm32. 2013-11-30 04:16:50 -05:00
Zachary Waldowski
bc978099bf Darwin/aarch64: Potentially(?) fix compile error 2013-11-30 04:16:48 -05:00
Zachary Waldowski
d6bb931446 Darwin/aarch64: Use CNAME refs 2013-11-30 04:16:45 -05:00
Zachary Waldowski
33c46ce568 Darwin/Mac: Fix 64/32 shortening warnings 2013-11-30 04:14:10 -05:00
Zachary Waldowski
0612081e6c Darwin: Misc size_t warnings 2013-11-30 04:14:10 -05:00
Zachary Waldowski
6a6247d179 Darwin: Fix dlmalloc warnings due to sizeof(size_t) 2013-11-30 04:14:10 -05:00
Zachary Waldowski
4d60d9e1e3 Darwin: Rebuild Xcode project 2013-11-30 04:14:05 -05:00
Zachary Waldowski
cb719a5c1c Darwin/iOS: Fix LLVM 3.3 warning re: memcpy. 2013-11-30 04:09:18 -05:00
Zachary Waldowski
21bde92c9a Darwin: Clean up, modernize generator scripts 2013-11-30 03:49:16 -05:00
Zachary Waldowski
fd54eab74c Darwin/Mac: Also exclude OS X generated source 2013-11-30 03:49:11 -05:00
Zachary Waldowski
953b6f14c6 Darwin/iOS: More unified syntax support w/ Clang.
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
2013-11-30 03:48:45 -05:00
Zachary Waldowski
c713a55379 Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
2013-11-30 03:48:05 -05:00
Zachary Waldowski
16ba1b8002 Darwin: Silence Clang warnings. 2013-11-30 03:47:58 -05:00
Anthony Green
852ac3bd30 Merge branch 'master' of github.com:/atgreen/libffi
Conflicts:
	ChangeLog
2013-11-21 21:25:44 -05:00
Alan Modra
ab79d6e219 This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
code, and makes it possible to link code compiled with different
options to those used to compile libffi.  For example, a
-mlong-double-128 libffi can be used with -mlong-double-64 code.

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

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

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

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

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

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

and then

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

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

This also fixes two faulty tests that used a non-variadic function
cast to call a variadic function, and spuriously reasoned that this is
somehow necessary for static functions..
2013-11-16 06:38:55 -05:00
Andrew Haley
31257b3189 Fix sample closure code 2013-11-16 06:35:51 -05:00
Andrew Haley
db0ace3a38 Fix broken test cases 2013-11-16 06:29:25 -05:00
Anthony Green
de10f5039e Merge branch 'master' of https://github.com/bivab/libffi
Conflicts:
	ChangeLog
2013-11-14 10:56:29 -05:00
David Schneider
f3657da278 update Changelog 2013-11-14 13:02:16 +01:00
Alan Modra
58c2577a3f This enshrines the current testsuite practice of using ffi_arg for
returned values.  It would be reasonable and logical to use the actual
return argument type as passed to ffi_prep_cif, but this would mean
changing a large number of tests that use ffi_arg and all backends
that write results to an ffi_arg.
2013-11-13 16:55:36 -05:00
Anthony Green
8af42f9944 Respect HAVE_ALLOCA_H 2013-11-13 16:40:28 -05:00
David Schneider
cdf405d574 add a testcase for the double/float issue on ARMHF 2013-11-13 18:01:56 +01:00