kc3-lang/libffi/src/ia64

Branch :


Log

Author Commit Date CI Message
b58caef7 2018-02-17 19:00:40 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>
ed7488c0 2017-10-17 13:00:51 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>
128cd1d2 2013-10-08 06:45:51 Fix spelling errors
8360bf1c 2012-02-23 07:01:13 Ensure that users don't include ffitarget.h directly
c365ee75 2012-01-23 11:13:18 Refresh
1fbf9dc4 2011-02-13 08:06:39 Fix bad_abi test. rc5.
2db72615 2010-11-21 10:50:56 Rebase
d14178be 2010-07-23 09:14:00 FFI_LAST_ABI fix
3f5b1375 2010-07-12 14:39:18 rebase
63097415 2010-05-05 20:14:56 Micharl Kohler's spelling fixes
9dc9a293 2010-04-13 10:33:52 Rebase to latest GCC sources
7b7a42f2 2010-01-12 09:14:14 Rebase from GCC
c3042afa 2010-01-01 08:08:02 Reset quilt patches post 3.0.9 merge with GCC
0cfe60e9 2009-12-29 10:06:04 3.0.9rc12
9458d88f 2009-12-26 07:02:27 Rebase from GCC
da11bece 2009-12-24 05:34:46 Release 3.0.9rc5
115ab36f 2009-12-24 00:22:00 Update missing changes for 3.0.9r4.
c6dddbd0 2009-10-04 08:11:33 Initial commit