Commit Graph

668 Commits

Author SHA1 Message Date
Anthony Green
7d2478568e Merge pull request #110 from joshtriplett/w64
Fix 64-bit Windows support
2014-03-25 16:12:17 -04:00
Anthony Green
beab5f334d Merge pull request #105 from joshtriplett/win32-relocations
[3.1 blocker] win32.S needs to handle relocations/GOT
2014-03-25 16:07:47 -04:00
Josh Triplett
56be47f876 Fix a warning on 64-bit Windows
When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes
produces a "possible loss of data" warning.  However, the size_t in
question refers to the size of a single parameter.  Use a cast to avoid
the warning.
2014-03-24 21:24:53 -07:00
Josh Triplett
48a8eda74a Avoid referencing undefined ABIs on 64-bit Windows builds
64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
2014-03-24 21:21:12 -07:00
Josh Triplett
ef5890ebaf win32.S: Use shifting for multiplication rather than repeated addition
The jump table code added a register to itself twice to multiply by 4;
shift the register left by 2 instead.
2014-03-21 11:02:50 -07:00
Josh Triplett
4fca48901e win32.S: Make the jump tables position-independent
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code.  This fixes build failures on
target platforms that do not allow text relocations.
2014-03-21 11:00:41 -07:00
Josh Triplett
2087dcf736 win32.S: Make calls to ffi_closure_SYSV_inner position-independent
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code.  This fixes one source of build
failures on target platforms that do not allow text relocations.
2014-03-21 10:57:06 -07:00
Anthony Green
28fb197079 Merge pull request #107 from rvandermeulen/msvcc
Various compatibility fixes and improvements to msvcc.sh.
2014-03-18 12:19:36 -04:00
Ryan VanderMeulen
c3dd0a1a02 Various compatibility fixes and improvements to msvcc.sh.
* Don't try to mix incompatible optimization flags in debug builds.
* Workaround ax_cc_maxopt.m4 not supporting MSVC and change -O3 to -O2.
* Fix MSVC warning by properly passing linker flags to compiler.
* Make msvcc.sh return 1 if invalid command line options are used rather than silently eating them.
* Add more comments.
2014-03-18 12:09:45 -04:00
Anthony Green
c697472fcc Merge pull request #102 from joshtriplett/test-generic
Add ABIs to the test matrix; unify many bits of the testsuite
2014-03-17 00:32:42 -04:00
Josh Triplett
e48918ecf8 testsuite: Add ABIs to the test matrix; unify tests across ABIs
This eliminates all the *_win32.c tests in favor of the tests they were
branched from, and expands test coverage to run many more tests on
stdcall, thiscall, and fastcall.

This same mechanism also supports testing any other target that has
multiple ABIs.
2014-03-16 20:39:12 -07:00
Josh Triplett
4d4d368e5a testsuite: Replace ffitestcxx.h with ffitest.h
ffitest.h contains a superset of the functionality of ffitestcxx.h;
make the C++ tests include ffitest.h instead, and remove ffitestcxx.h.
2014-03-16 20:39:06 -07:00
Josh Triplett
3f97cf3413 testsuite: Unify the C and C++ testsuites
These two testsuites differ only in the source file glob and a couple of
additional compiler options; unify the remaining bits.
2014-03-16 20:34:46 -07:00
Josh Triplett
0d9cce8edb testsuite: ffitest.h: Parenthesize the CHECK macro 2014-03-16 20:34:46 -07:00
Josh Triplett
5695ec1444 testsuite: Factor out a function to run a matrix of tests
This commons up code from libffi.call/call.exp and
libffi.special/special.exp, unifies the optimization option matrix
between the two, and makes it easier to add more axes to the matrix
in the future.
2014-03-16 20:34:46 -07:00
Josh Triplett
dfdb02cc86 testsuite: Introduce a __THISCALL__ compiler-specific macro 2014-03-16 20:34:41 -07:00
Anthony Green
83fd2bce04 Merge pull request #99 from joshtriplett/gitignore
.gitignore: Ignore more generated files
2014-03-16 22:03:29 -04:00
Anthony Green
3658a0700a Merge pull request #100 from rvandermeulen/bug-756740
Change double quotes in Makefile.am to single quotes.
2014-03-16 21:37:42 -04:00
Ryan VanderMeulen
46c5d3c30f Change double quotes in Makefile.am to single quotes.
This was originally done in PR #84, except the change was made to Makefile.in instead of Makefile.am and was therefore reverted the next time the files were regenerated.
2014-03-16 21:16:08 -04:00
Josh Triplett
06ff924215 .gitignore: Ignore more generated files
The build process generates doc/libffi.info and fficonfig.h.in, so add
them to .gitignore.
2014-03-16 16:19:46 -07:00
Josh Triplett
bad8948346 testsuite: Introduce a __STDCALL__ compiler-specific macro
Several tests want to use stdcall, which differs in syntax by compiler,
so introduce a macro for it in ffitest.h.
2014-03-16 15:27:07 -07:00
Josh Triplett
98a793fa36 testsuite: Common up the ifdef blocks for compiler-specific macros 2014-03-16 15:21:57 -07:00
Anthony Green
d948d0a729 Merge pull request #98 from joshtriplett/unconfigure.host
Merge configure.host into configure.ac
2014-03-16 10:53:48 -04:00
Josh Triplett
a86bd318e2 Merge configure.host into configure.ac
configure.host only has a single entry, and shows no signs of needing
more added.
2014-03-16 07:05:28 -07:00
Anthony Green
b61b472bd0 Update version to 3.1-rc0. Clean up README. 2014-03-16 09:45:55 -04:00
Anthony Green
7a64e7dbba Merge pull request #97 from joshtriplett/remove-more-generated-files
Remove more generated files
2014-03-16 09:39:08 -04:00
Anthony Green
11a5c5c39f Merge pull request #96 from joshtriplett/sawing-changelogs
Generate ChangeLog from git in make dist; remove it from version control
2014-03-16 09:38:47 -04:00
Josh Triplett
eef2e02a13 doc: Remove autogenerated info file and stamp 2014-03-16 06:26:03 -07:00
Josh Triplett
9fb403d3c5 fficonfig.h.in: Remove, configure generates it 2014-03-16 06:25:52 -07:00
Josh Triplett
1c68c07217 Generate ChangeLog from git in make dist
Archive the existing ChangeLog to ChangeLog.libffi-3.1
2014-03-16 06:16:20 -07:00
Josh Triplett
c65ed55e65 ChangeLog.v1: Fix typo in explanatory header. 2014-03-16 06:14:56 -07:00
Anthony Green
9a62a21f5c Add missing ChangeLog entry. Clean up some entries. 2014-03-16 09:03:57 -04:00
Anthony Green
9bc704c58c Merge pull request #95 from joshtriplett/news
README: Update news for 3.0.14
2014-03-16 08:41:00 -04:00
Josh Triplett
e892e581d1 README: Update news for 3.0.14 2014-03-16 05:39:23 -07:00
Anthony Green
694447aa29 Merge pull request #93 from joshtriplett/travis-dist
Make Travis check "make dist"
2014-03-16 08:32:05 -04:00
Josh Triplett
45a6c21efa .travis.yml: Test "make dist" too. 2014-03-16 05:29:08 -07:00
Anthony Green
fdc87f3b2e Merge pull request #85 from joshtriplett/stdcall
stdcall support on Linux
2014-03-16 08:05:51 -04:00
Josh Triplett
e1911f78df Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
Linux supports the stdcall calling convention, either via functions
explicitly declared with the stdcall attribute, or via code compiled
with -mrtd which effectively makes stdcall the default.

This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
non-Windows x86-32 platforms, as non-default calling conventions.
2014-03-16 05:05:06 -07:00
Anthony Green
7412b838d5 Merge pull request #90 from joshtriplett/win32-unifdef
prep_cif.c: Remove unnecessary ifdef for X86_WIN32
2014-03-16 07:58:16 -04:00
Anthony Green
c0cc5fdaa2 Merge pull request #89 from joshtriplett/travis32
.travis.yml: Test on both 32-bit and 64-bit
2014-03-16 07:57:59 -04:00
Josh Triplett
9531d05f64 prep_cif.c: Remove unnecessary ifdef for X86_WIN32
ffi_prep_cif_core had a special case for X86_WIN32, checking for
FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range
before returning FFI_BAD_ABI.  However, on X86_WIN32, FFI_THISCALL
already falls in that range, making the special case unnecessary.
Remove it.
2014-03-16 04:56:57 -07:00
Josh Triplett
b3a5da068a .travis.yml: Test on both 32-bit and 64-bit 2014-03-16 04:53:41 -07:00
Anthony Green
98b5296048 Merge pull request #94 from joshtriplett/esp-extra-stackery-perception
ChangeLog: Document testsuite changes to remove fragile stack pointer checks
2014-03-16 07:51:33 -04:00
Josh Triplett
f6dd184543 ChangeLog: Document testsuite changes to remove fragile stack pointer checks 2014-03-16 04:49:36 -07:00
Anthony Green
134ce4c026 Merge pull request #91 from joshtriplett/esp-extra-stackery-perception
testsuite: Remove fragile stack pointer checks
2014-03-16 07:47:17 -04:00
Josh Triplett
9c279328ee testsuite: Remove fragile stack pointer checks
testsuite/libffi.call/closure_stdcall.c and
testsuite/libffi.call/closure_thiscall.c include inline assembly to save
the stack pointer before and after the call, and compare the values.
However, compilers can and do leave the stack in different states for
these two pieces of inline assembly, such as by saving a temporary value
on the stack across the call; observed with gcc -Os, and verified as
spurious through careful inspection of disassembly.
2014-03-16 04:45:37 -07:00
Anthony Green
2680e9ea9b Merge pull request #88 from joshtriplett/such-precision-many-fail-wow
testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
2014-03-16 07:44:08 -04:00
Josh Triplett
82f8cb24a1 ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures 2014-03-16 04:40:45 -07:00
Josh Triplett
88d562a8b5 testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision
The test case testsuite/libffi.call/many_win32.c can spuriously fail due
to excess floating-point precision.  Instrumenting it with some printf
calls shows differences well above FLT_EPSILON.  (Note when
instrumenting it that multiple computations of the difference, such as
one in a print and another in the conditional, may produce different
results.)

Rather than complicating the test suite with architecture-specific flags
to avoid excess precision, just simplify the floating-point computation
to avoid a dependency on potential excess precision.
2014-03-16 04:39:37 -07:00
Josh Triplett
c00a49ecd1 testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
The test case testsuite/libffi.call/many.c can spuriously fail due to
excess floating-point precision.  Instrumenting it with some printf
calls shows differences well above FLT_EPSILON.  (Note when
instrumenting it that multiple computations of the difference, such as
one in a print and another in the conditional, may produce different
results.)

Rather than complicating the test suite with architecture-specific flags
to avoid excess precision, just simplify the floating-point computation
to avoid a dependency on potential excess precision.
2014-03-16 04:39:37 -07:00