platform/upstream/libffi.git
6 years agoTry different msvc hack
Anthony Green [Tue, 27 Mar 2018 18:34:31 +0000 (14:34 -0400)]
Try different msvc hack

6 years agomsvc c99 hack
Anthony Green [Tue, 27 Mar 2018 18:12:02 +0000 (14:12 -0400)]
msvc c99 hack

6 years agoMore msvc hacks
Anthony Green [Tue, 27 Mar 2018 15:58:42 +0000 (11:58 -0400)]
More msvc hacks

6 years agomsvc fixes
Anthony Green [Tue, 27 Mar 2018 15:49:46 +0000 (11:49 -0400)]
msvc fixes

6 years agoRemove debug output
Anthony Green [Tue, 27 Mar 2018 15:36:04 +0000 (11:36 -0400)]
Remove debug output

6 years agoForce literals to float (msvc warning)
Anthony Green [Tue, 27 Mar 2018 15:35:23 +0000 (11:35 -0400)]
Force literals to float (msvc warning)

6 years agoFix msvc linking
Anthony Green [Tue, 27 Mar 2018 15:28:40 +0000 (11:28 -0400)]
Fix msvc linking

6 years agoFix library path handling
Anthony Green [Tue, 27 Mar 2018 15:20:21 +0000 (11:20 -0400)]
Fix library path handling

6 years agoDeal with libpath
Anthony Green [Tue, 27 Mar 2018 15:14:56 +0000 (11:14 -0400)]
Deal with libpath

6 years agoFix library path handling
Anthony Green [Tue, 27 Mar 2018 12:25:26 +0000 (08:25 -0400)]
Fix library path handling

6 years agoUse mixed cygpath paths
Anthony Green [Tue, 27 Mar 2018 12:10:03 +0000 (08:10 -0400)]
Use mixed cygpath paths

6 years agoCopy - don't symlink - to support msvc builds
Anthony Green [Tue, 27 Mar 2018 12:05:42 +0000 (08:05 -0400)]
Copy - don't symlink - to support msvc builds

6 years agoUse cygpath to convert windows paths
Anthony Green [Tue, 27 Mar 2018 11:35:33 +0000 (07:35 -0400)]
Use cygpath to convert windows paths

6 years agotry to fix windows builds
Anthony Green [Tue, 27 Mar 2018 11:14:59 +0000 (07:14 -0400)]
try to fix windows builds

6 years agoReduce verbosity
Anthony Green [Tue, 27 Mar 2018 11:06:01 +0000 (07:06 -0400)]
Reduce verbosity

6 years agoiOS builds
Anthony Green [Tue, 27 Mar 2018 10:23:29 +0000 (06:23 -0400)]
iOS builds

6 years agoFix -L support
Anthony Green [Tue, 27 Mar 2018 10:22:57 +0000 (06:22 -0400)]
Fix -L support

6 years agoFix quoting
Anthony Green [Tue, 27 Mar 2018 09:59:26 +0000 (05:59 -0400)]
Fix quoting

6 years agoDon't set AM_MAKEFLAGS
Anthony Green [Tue, 27 Mar 2018 09:35:35 +0000 (05:35 -0400)]
Don't set AM_MAKEFLAGS

6 years agoRun tests with lots of debug output
Anthony Green [Tue, 27 Mar 2018 09:13:38 +0000 (05:13 -0400)]
Run tests with lots of debug output

6 years agoAdd -L and -l support
Anthony Green [Tue, 27 Mar 2018 09:11:52 +0000 (05:11 -0400)]
Add -L and -l support

6 years agoMention C99 and build requirements
Anthony Green [Tue, 27 Mar 2018 09:07:08 +0000 (05:07 -0400)]
Mention C99 and build requirements

6 years agoRemove reference to wiki
Anthony Green [Tue, 27 Mar 2018 08:46:04 +0000 (04:46 -0400)]
Remove reference to wiki

6 years agoRefactor travis build instructions. Add iOS build
Anthony Green [Tue, 27 Mar 2018 08:09:56 +0000 (04:09 -0400)]
Refactor travis build instructions.  Add iOS build

6 years agoAdd issue template
Anthony Green [Tue, 27 Mar 2018 08:02:06 +0000 (04:02 -0400)]
Add issue template

6 years agoRemove uninitialized warning. Fix #163.
Anthony Green [Tue, 27 Mar 2018 08:01:37 +0000 (04:01 -0400)]
Remove uninitialized warning. Fix #163.

6 years agorevert
Anthony Green [Sat, 24 Mar 2018 13:05:14 +0000 (09:05 -0400)]
revert

6 years agoTry bhaible tests in appveyor
Anthony Green [Sat, 24 Mar 2018 12:45:59 +0000 (08:45 -0400)]
Try bhaible tests in appveyor

6 years agoFormatting fixes
Anthony Green [Sat, 24 Mar 2018 12:40:04 +0000 (08:40 -0400)]
Formatting fixes

6 years agoAdd libffi.map.in to extra dist files
Anthony Green [Fri, 23 Mar 2018 15:47:29 +0000 (11:47 -0400)]
Add libffi.map.in to extra dist files

6 years agoAdd sparc solaris build notes
Anthony Green [Fri, 23 Mar 2018 13:06:08 +0000 (09:06 -0400)]
Add sparc solaris build notes

6 years agoFix formatting
Anthony Green [Mon, 19 Mar 2018 01:22:55 +0000 (21:22 -0400)]
Fix formatting

6 years agoFix formatting
Anthony Green [Mon, 19 Mar 2018 00:36:52 +0000 (20:36 -0400)]
Fix formatting

6 years agoDon't align-double for 32-bit x86
Anthony Green [Sun, 18 Mar 2018 20:00:04 +0000 (16:00 -0400)]
Don't align-double for 32-bit x86

6 years agoRemove debug output
Anthony Green [Sun, 18 Mar 2018 19:30:00 +0000 (15:30 -0400)]
Remove debug output

6 years agoAdd m4/ax_require_defined.m4
Anthony Green [Sun, 18 Mar 2018 19:13:21 +0000 (15:13 -0400)]
Add m4/ax_require_defined.m4

6 years agotravis debug
Anthony Green [Sun, 18 Mar 2018 17:41:15 +0000 (13:41 -0400)]
travis debug

6 years agoUpdate autoconf archive macros
Anthony Green [Sun, 18 Mar 2018 17:32:03 +0000 (13:32 -0400)]
Update autoconf archive macros

6 years agoAdd missing FFI_GNUW64 enum
Anthony Green [Sun, 18 Mar 2018 16:53:42 +0000 (12:53 -0400)]
Add missing FFI_GNUW64 enum

6 years agoMerge branch 'master' of github.com:/libffi/libffi
Anthony Green [Sun, 18 Mar 2018 16:34:18 +0000 (12:34 -0400)]
Merge branch 'master' of github.com:/libffi/libffi

6 years agoAdd FFI_GNUW64 ABI for GNU 80-bit long double support
Anthony Green [Sun, 18 Mar 2018 16:32:10 +0000 (12:32 -0400)]
Add FFI_GNUW64 ABI for GNU 80-bit long double support

6 years agoAdd FFI_GWIN64 ABI for GNU 80-bit long double support
Anthony Green [Sun, 18 Mar 2018 16:32:10 +0000 (12:32 -0400)]
Add FFI_GWIN64 ABI for GNU 80-bit long double support

6 years agoFully allocate file backing writable maps (#389)
Ryan C. Underwood [Sun, 18 Mar 2018 14:00:42 +0000 (07:00 -0700)]
Fully allocate file backing writable maps (#389)

When ftruncate() is used on a filesystem supporting sparse files,
space in the file is not actually allocated.  Then, when the file
is mmap'd and libffi writes to the mapping, SIGBUS is thrown to
the calling application.  Instead, always fully allocate the file
that will back writable maps.

6 years agoFix return values
Anthony Green [Sun, 18 Mar 2018 11:01:54 +0000 (07:01 -0400)]
Fix return values

6 years agoMake tests compile/run standalone
Anthony Green [Sun, 18 Mar 2018 02:49:58 +0000 (22:49 -0400)]
Make tests compile/run standalone

6 years agoFormatting fixes. Add 'bug fixes' note.
Anthony Green [Sat, 17 Mar 2018 13:03:42 +0000 (09:03 -0400)]
Formatting fixes.  Add 'bug fixes' note.

6 years agoxfail unwind tests for moxie
Anthony Green [Sat, 17 Mar 2018 11:17:24 +0000 (07:17 -0400)]
xfail unwind tests for moxie

6 years agoInstall moxie libstdc++
Anthony Green [Sat, 17 Mar 2018 03:54:28 +0000 (23:54 -0400)]
Install moxie libstdc++

6 years agoInstall moxie-elf-g++
Anthony Green [Sat, 17 Mar 2018 03:36:51 +0000 (23:36 -0400)]
Install moxie-elf-g++

6 years agoFix closure case where 8-byte value is partially passed in register. Fixes cls_many_...
Anthony Green [Fri, 16 Mar 2018 21:53:33 +0000 (17:53 -0400)]
Fix closure case where 8-byte value is partially passed in register.  Fixes cls_many_mixed_float_double test case.

6 years agoRun dejagnu's runtest with -a option to prevent travis timeouts after 10min
Anthony Green [Fri, 16 Mar 2018 11:28:33 +0000 (07:28 -0400)]
Run dejagnu's runtest with -a option to prevent travis timeouts after 10min

6 years agofix .travis.yml
Anthony Green [Thu, 15 Mar 2018 12:17:18 +0000 (08:17 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Thu, 15 Mar 2018 01:21:06 +0000 (21:21 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Thu, 15 Mar 2018 01:00:55 +0000 (21:00 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Thu, 15 Mar 2018 00:32:00 +0000 (20:32 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Thu, 15 Mar 2018 00:22:33 +0000 (20:22 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Wed, 14 Mar 2018 18:09:39 +0000 (14:09 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Wed, 14 Mar 2018 17:47:27 +0000 (13:47 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Wed, 14 Mar 2018 17:25:04 +0000 (13:25 -0400)]
fix .travis.yml

6 years agofix .travis.yml
Anthony Green [Wed, 14 Mar 2018 17:07:04 +0000 (13:07 -0400)]
fix .travis.yml

6 years agoFix travis.yml
Anthony Green [Wed, 14 Mar 2018 16:40:58 +0000 (12:40 -0400)]
Fix travis.yml

6 years agoyaml syntax error fix
Anthony Green [Wed, 14 Mar 2018 16:15:04 +0000 (12:15 -0400)]
yaml syntax error fix

6 years agomarkdown fixes
Anthony Green [Wed, 14 Mar 2018 15:13:32 +0000 (11:13 -0400)]
markdown fixes

6 years agoFix test cases with short results
Anthony Green [Wed, 14 Mar 2018 13:06:38 +0000 (09:06 -0400)]
Fix test cases with short results

6 years agoDebug travis output
Anthony Green [Wed, 14 Mar 2018 12:02:10 +0000 (08:02 -0400)]
Debug travis output

6 years agotest
Anthony Green [Wed, 14 Mar 2018 11:40:53 +0000 (07:40 -0400)]
test

6 years agodebug
Anthony Green [Wed, 14 Mar 2018 03:31:18 +0000 (23:31 -0400)]
debug

6 years agodebug
Anthony Green [Wed, 14 Mar 2018 03:30:52 +0000 (23:30 -0400)]
debug

6 years agoDebug env
Anthony Green [Wed, 14 Mar 2018 03:20:15 +0000 (23:20 -0400)]
Debug env

6 years agoRefactor
Anthony Green [Wed, 14 Mar 2018 03:07:10 +0000 (23:07 -0400)]
Refactor

6 years agofix moxie build
Anthony Green [Wed, 14 Mar 2018 02:49:48 +0000 (22:49 -0400)]
fix moxie build

6 years agofix moxie build
Anthony Green [Wed, 14 Mar 2018 02:44:13 +0000 (22:44 -0400)]
fix moxie build

6 years agorevert test
Anthony Green [Wed, 14 Mar 2018 02:36:41 +0000 (22:36 -0400)]
revert test

6 years agotest
Anthony Green [Wed, 14 Mar 2018 02:35:50 +0000 (22:35 -0400)]
test

6 years agoAdd experimental moxie travis build
Anthony Green [Wed, 14 Mar 2018 02:13:44 +0000 (22:13 -0400)]
Add experimental moxie travis build

6 years agoUpdate moxie sub opcode
Anthony Green [Wed, 14 Mar 2018 00:41:55 +0000 (20:41 -0400)]
Update moxie sub opcode

6 years agoFix appveyor badge
Anthony Green [Tue, 13 Mar 2018 13:27:00 +0000 (09:27 -0400)]
Fix appveyor badge

6 years agoFix travis badge. Add REAME.md to dist files
Anthony Green [Tue, 13 Mar 2018 13:24:37 +0000 (09:24 -0400)]
Fix travis badge.  Add REAME.md to dist files

6 years agoPreformat release notes
Anthony Green [Tue, 13 Mar 2018 13:21:49 +0000 (09:21 -0400)]
Preformat release notes

6 years agoPreformat release notes
Anthony Green [Tue, 13 Mar 2018 13:20:44 +0000 (09:20 -0400)]
Preformat release notes

6 years agoTry to fix table
Anthony Green [Tue, 13 Mar 2018 13:17:57 +0000 (09:17 -0400)]
Try to fix table

6 years agoClean up markdown table
Anthony Green [Tue, 13 Mar 2018 13:14:40 +0000 (09:14 -0400)]
Clean up markdown table

6 years agoMove to markdown
Anthony Green [Tue, 13 Mar 2018 13:12:21 +0000 (09:12 -0400)]
Move to markdown

6 years agoAdd travis and appveyor build badges
Anthony Green [Tue, 13 Mar 2018 13:11:24 +0000 (09:11 -0400)]
Add travis and appveyor build badges

6 years agoSupport compiler specific warning suppression flags
Anthony Green [Tue, 13 Mar 2018 12:52:30 +0000 (08:52 -0400)]
Support compiler specific warning suppression flags

6 years agoSupport compiler specific warning suppression flags
Anthony Green [Tue, 13 Mar 2018 12:51:34 +0000 (08:51 -0400)]
Support compiler specific warning suppression flags

6 years agoAdd bhaible's missing Makefile
Anthony Green [Tue, 13 Mar 2018 12:37:21 +0000 (08:37 -0400)]
Add bhaible's missing Makefile

6 years agoRemove stray directory
Anthony Green [Tue, 13 Mar 2018 11:53:33 +0000 (07:53 -0400)]
Remove stray directory

6 years agoUpdate version number to next pre-release
Anthony Green [Tue, 13 Mar 2018 11:51:02 +0000 (07:51 -0400)]
Update version number to next pre-release

6 years agoUpdate test list for dist
Anthony Green [Tue, 13 Mar 2018 11:47:57 +0000 (07:47 -0400)]
Update test list for dist

6 years agoAdd Bruno Haible and Bill Triggs' libffi testsuite
Anthony Green [Tue, 13 Mar 2018 01:53:18 +0000 (21:53 -0400)]
Add Bruno Haible and Bill Triggs' libffi testsuite

6 years agoNext release will be 3.3
Anthony Green [Sun, 11 Mar 2018 22:21:46 +0000 (18:21 -0400)]
Next release will be 3.3

6 years agoNew RISC-V port (#281)
Stef O'Rear [Sun, 11 Mar 2018 12:55:15 +0000 (05:55 -0700)]
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

6 years agoMerge pull request #406 from trofi/master
Anthony Green [Sun, 11 Mar 2018 12:50:01 +0000 (08:50 -0400)]
Merge pull request #406 from trofi/master

ia64: fix variadic function closures with FP arguments

6 years agoMerge pull request #407 from trofi/ia64-small-struct
Anthony Green [Sun, 11 Mar 2018 12:48:42 +0000 (08:48 -0400)]
Merge pull request #407 from trofi/ia64-small-struct

ia64: fix small struct return

6 years agoMerge pull request #409 from andreas-schwab/master
Anthony Green [Sun, 11 Mar 2018 12:46:58 +0000 (08:46 -0400)]
Merge pull request #409 from andreas-schwab/master

Revert "Fix passing struct by value on aarch64"

6 years agoRevert "Fix passing struct by value on aarch64"
Andreas Schwab [Tue, 20 Feb 2018 09:47:09 +0000 (10:47 +0100)]
Revert "Fix passing struct by value on aarch64"

This reverts commit 482b37f00467325e3389bab322525099860dd9aa.

That was actually a bug in python, see <https://bugs.python.org/issue30353>.

6 years agoia64: fix small struct return
Sergei Trofimovich [Sat, 17 Feb 2018 19:00:40 +0000 (19:00 +0000)]
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>
6 years agonew test: return small struct
Sergei Trofimovich [Sat, 17 Feb 2018 18:53:02 +0000 (18:53 +0000)]
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>
6 years agoia64: fix variadic function closures with FP arguments
Sergei Trofimovich [Sun, 11 Feb 2018 11:29:39 +0000 (11:29 +0000)]
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>