Commit Graph
1145 Commits
Author SHA1 Message Date
Anthony Green d71051c46a fix .travis.yml 2018-03-14 21:21:06 -04:00
Anthony Green e86aa54ce3 fix .travis.yml 2018-03-14 21:00:55 -04:00
Anthony Green 5b538ed61f fix .travis.yml 2018-03-14 20:32:00 -04:00
Anthony Green 6ed64a7953 fix .travis.yml 2018-03-14 20:22:33 -04:00
Anthony Green 90809e928f fix .travis.yml 2018-03-14 14:09:39 -04:00
Anthony Green 85e4c62351 fix .travis.yml 2018-03-14 13:47:27 -04:00
Anthony Green aa8a5ec4a4 fix .travis.yml 2018-03-14 13:25:04 -04:00
Anthony Green 7c3e5da401 fix .travis.yml 2018-03-14 13:07:04 -04:00
Anthony Green 19aec19893 Fix travis.yml 2018-03-14 12:40:58 -04:00
Anthony Green bf337b0709 yaml syntax error fix 2018-03-14 12:15:04 -04:00
Anthony Green 076d5a987e markdown fixes 2018-03-14 11:13:32 -04:00
Anthony Green d2f7e788ae Fix test cases with short results 2018-03-14 09:06:38 -04:00
Anthony Green 18fe190068 Debug travis output 2018-03-14 08:02:10 -04:00
Anthony Green 718a4177f2 test 2018-03-14 07:40:53 -04:00
Anthony Green 486c34b65d debug 2018-03-13 23:31:18 -04:00
Anthony Green 00464aa520 debug 2018-03-13 23:30:52 -04:00
Anthony Green eb0544d0d4 Debug env 2018-03-13 23:20:15 -04:00
Anthony Green 9d5bd29d8d Refactor 2018-03-13 23:07:10 -04:00
Anthony Green 52a364d769 fix moxie build 2018-03-13 22:49:48 -04:00
Anthony Green 1a32b3f146 fix moxie build 2018-03-13 22:44:13 -04:00
Anthony Green e8958c3a64 revert test 2018-03-13 22:36:41 -04:00
Anthony Green 58315ae125 test 2018-03-13 22:35:50 -04:00
Anthony Green 6239c28741 Add experimental moxie travis build 2018-03-13 22:13:44 -04:00
Anthony Green 01db31d94e Update moxie sub opcode 2018-03-13 20:41:55 -04:00
Anthony Green e8f5a43033 Fix appveyor badge 2018-03-13 09:27:00 -04:00
Anthony Green d1689dd3bf Fix travis badge. Add REAME.md to dist files 2018-03-13 09:24:37 -04:00
Anthony Green 785351fbc2 Preformat release notes 2018-03-13 09:21:49 -04:00
Anthony Green 8c7fbd1616 Preformat release notes 2018-03-13 09:20:44 -04:00
Anthony Green 54f31b0056 Try to fix table 2018-03-13 09:17:57 -04:00
Anthony Green 3a29a27a86 Clean up markdown table 2018-03-13 09:14:40 -04:00
Anthony Green fbfc3b048f Move to markdown 2018-03-13 09:12:21 -04:00
Anthony Green a31d3d3ba6 Add travis and appveyor build badges 2018-03-13 09:11:24 -04:00
Anthony Green 16313cb274 Support compiler specific warning suppression flags 2018-03-13 08:52:30 -04:00
Anthony Green cca6d1fb54 Support compiler specific warning suppression flags 2018-03-13 08:51:34 -04:00
Anthony Green 9291f941c2 Add bhaible's missing Makefile 2018-03-13 08:37:21 -04:00
Anthony Green bede01d82e Remove stray directory 2018-03-13 07:53:33 -04:00
Anthony Green 9aefbb1031 Update version number to next pre-release 2018-03-13 07:51:02 -04:00
Anthony Green ddf7a8f751 Update test list for dist 2018-03-13 07:47:57 -04:00
Anthony Green 6186261cb3 Add Bruno Haible and Bill Triggs' libffi testsuite 2018-03-12 21:53:18 -04:00
Anthony Green 4e8f79d558 Next release will be 3.3 2018-03-11 18:21:46 -04:00
Stef O'Rear 3840d49aaa 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
2018-03-11 08:55:15 -04:00
Anthony Green dca52b55bc Merge pull request #406 from trofi/master
ia64: fix variadic function closures with FP arguments
2018-03-11 08:50:01 -04:00
Anthony Green 83d9aba3a4 Merge pull request #407 from trofi/ia64-small-struct
ia64: fix small struct return
2018-03-11 08:48:42 -04:00
Anthony Green ab15405693 Merge pull request #409 from andreas-schwab/master
Revert "Fix passing struct by value on aarch64"
2018-03-11 08:46:58 -04:00
Andreas Schwab e66fd67820 Revert "Fix passing struct by value on aarch64"
This reverts commit 482b37f004.

That was actually a bug in python, see <https://bugs.python.org/issue30353>.
2018-02-20 10:47:09 +01:00
Sergei Trofimovich b58caef7fd 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>
2018-02-17 19:01:29 +00:00
Sergei Trofimovich 45da2fcbcd 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>
2018-02-17 18:53:02 +00:00
Sergei Trofimovich 11de69ddb7 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>
2018-02-11 12:17:32 +00:00
Anthony Green 9429968b82 Merge pull request #403 from frida/fix/x86-sysv-pic-closure-regression
Fix x86 SysV closure in PIC mode
2018-02-10 23:23:33 -05:00
Anthony Green f08b2be627 Merge pull request #405 from andreas-schwab/master
Fix passing struct by value on aarch64
2018-02-10 23:21:49 -05:00