Commit Graph
159 Commits
Author SHA1 Message Date
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
Alan Modra ac75368893 This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
code, and makes it possible to link code compiled with different
options to those used to compile libffi.  For example, a
-mlong-double-128 libffi can be used with -mlong-double-64 code.

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

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

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

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

and then

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

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

This also fixes two faulty tests that used a non-variadic function
cast to call a variadic function, and spuriously reasoned that this is
somehow necessary for static functions..
2013-11-16 06:38:55 -05:00
David Schneider 77f823e31f stop trying to assing vfp regs once we are done with the registers 2013-11-13 14:26:57 +01:00
David Schneider 37067ec503 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.
2013-11-12 19:49:01 +01:00
Mark Kettenis becd754434 Align the stack pointer to 16-bytes. 2013-11-06 06:43:49 -05:00
Konstantin Belousov 05c3109340 Mark executable as not requiring executable stack. 2013-11-06 06:40:58 -05:00
Anthony Green c2422174b3 Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
arc: Fix build error
2013-11-02 17:11:08 -04:00
Anthony Green f3cd393457 Merge pull request #51 from vbudovski/for_upstream
Don't use 16 byte aligned stack for WIN32
2013-11-02 13:17:57 -07:00
Mark H Weaver d3372c54ce Fix N32 ABI issue for MIPS. 2013-10-26 08:30:06 -04:00
Sandra Loosemore 16b93a211b Add nios2 port. 2013-10-15 15:33:59 -04:00
Anthony Green 128cd1d2f3 Fix spelling errors 2013-10-08 06:45:51 -04:00
Anthony Green d2fcbcdfbe Add m88k and VAX support. Update some configury bits. 2013-10-08 06:27:46 -04:00
Vitaly Budovski 6aa15900ac Don't use 16 byte aligned stack for WIN32
This fixes a crash when accessing __stdcall functions in Python ctypes.
2013-09-05 12:05:06 +10:00
Anthony Green d3d099b40c little-endian ppc64 support 2013-07-02 16:11:38 -04:00
Anthony Green b50a13b9c0 Merge pull request #44 from foss-for-synopsys-dwc-arc-processors/arc_support
Add ARC support
2013-07-02 12:10:26 -07:00
Anthony Green 767f1f96e5 Merge pull request #43 from JensTimmerman/__m128
added include for xmmintrin.h
2013-07-02 12:08:04 -07:00
Jens Timmerman b8a91d81be added include for xmmintrin.h 2013-07-02 10:57:37 +02:00
Mischa Jonker b082e15091 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>
2013-06-14 10:06:30 +02:00
David Schneider 9708e7cf09 folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP 2013-03-28 16:40:40 +01:00
David Schneider b41120981e 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
2013-03-28 16:40:40 +01:00
David Schneider 3c1608613a 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. 2013-03-28 16:38:28 +01:00
David Schneider 0f2ff2d4c9 separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention 2013-03-28 16:38:25 +01:00
David Schneider 3a352b8a82 move the hardfloat specific argument copying code to the helper function 2013-03-28 16:38:21 +01:00
David Schneider 5df6b7944a extract setting of arguments to be passed to a helper function 2013-03-28 16:38:15 +01:00
David Schneider 7d1048c471 extract code to align the argument storage pointer to a helper function 2013-03-28 16:38:10 +01:00
Anthony Green 12b1886d7b cygwin fix & updates for 3.0.13 2013-03-17 18:33:59 -04:00
Anthony Green 4acf0056f5 Build fix for soft-float power targets 2013-03-16 08:18:45 -04:00
Anthony Green 8a286f570c Fix for m68000 systems 2013-03-16 08:12:19 -04:00
Anthony Green 2fb527a017 Add Meta processor support 2013-03-16 07:46:38 -04:00
Alex Gaynor ee18766b16 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)
2013-03-14 15:00:33 -07:00
Anthony Green f308faf1ea Add moxie support. Release 3.0.12. 2013-02-11 14:25:13 -05:00
Anthony Green a9521411a5 sparc v8 and testsuite fixes 2013-02-09 06:54:40 -05:00
Anthony Green 70b11b47ee Fix small struct passing on ppc 2013-02-08 16:12:19 -05:00
Anthony Green 8bd15d139a Fix many.c testcase for ppc 2013-02-08 13:56:37 -05:00
Anthony Green cb03ea8f4e sparc v9 fixes for sun tools 2013-02-08 12:25:18 -05:00
Anthony Green 35ee8d44f3 Fix microblaze big-endian struct issue 2013-02-08 07:12:41 -05:00
Anthony Green 9db7e1a958 Fix botched sparc patch. Update version. 2013-02-07 21:06:08 -05:00
Anthony Green fd07c9e404 Add cache flushing routine for sun compiler on sparc solaris 2.8 2013-02-07 18:00:36 -05:00
Anthony Green 6a79012942 Work around LLVM ABI problem on x86-64 2013-02-06 17:37:15 -05:00
Anthony Green aeb8719a34 New microblaze support 2013-01-21 07:55:37 -05:00