• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..12-Apr-2021-

.travis/H12-Apr-2021-2621

doc/H12-Apr-2021-11,30410,222

include/H12-Apr-2021-736586

libffi.xcodeproj/H12-Apr-2021-1,0441,032

m4/H12-Apr-2021-10,4109,478

man/H12-Apr-2021-298277

msvc_build/aarch64/H12-Apr-2021-957636

src/H03-May-2022-46,10732,015

testsuite/H12-Apr-2021-20,30815,085

.appveyor.ymlH A D20-Aug-20192.9 KiB7265

.gitignoreH A D20-Aug-2019476 3938

.travis.ymlH A D20-Aug-2019877 3529

ChangeLog.libffiH A D01-Nov-201719.7 KiB585460

ChangeLog.libffi-3.1H A D01-Nov-2017205.6 KiB6,0014,598

ChangeLog.libgcjH A D01-Nov-20171.1 KiB4126

ChangeLog.v1H A D01-Nov-201722.5 KiB765459

LICENSEH A D01-Nov-20171.1 KiB2218

LICENSE-BUILDTOOLSH A D20-Aug-201918.2 KiB353290

Makefile.amH A D20-Aug-20195.8 KiB169136

READMEH A D01-Nov-201716 KiB455364

README.mdH A D20-Aug-201918.4 KiB471378

acinclude.m4H A D13-Mar-202117.2 KiB493461

autogen.shH A D01-Nov-201732 31

config.guessH A D15-Oct-202043.2 KiB1,4811,288

config.subH A D15-Oct-202035.3 KiB1,8021,661

configure.acH A D13-Mar-202111.9 KiB397339

configure.hostH A D03-May-20225.9 KiB304268

generate-darwin-source-and-headers.pyH A D01-Nov-20176.5 KiB204157

libffi.map.inH A D01-Nov-20171.4 KiB8170

libffi.pc.inH A D01-Nov-2017279 1210

libtool-ldflagsH A D01-Nov-20173.3 KiB10732

libtool-versionH A D01-Nov-20171.1 KiB3029

msvcc.shH A D20-Aug-20198.3 KiB354256

stamp-h.inH A D01-Nov-201710 21

README

1Status
2======
3
4libffi-4?? was released on TBD.  Check the libffi web
5page for updates: <URL:http://sourceware.org/libffi/>.
6
7
8What is libffi?
9===============
10
11Compilers for high level languages generate code that follow certain
12conventions. These conventions are necessary, in part, for separate
13compilation to work. One such convention is the "calling
14convention". The "calling convention" is essentially a set of
15assumptions made by the compiler about where function arguments will
16be found on entry to a function. A "calling convention" also specifies
17where the return value for a function is found.
18
19Some programs may not know at the time of compilation what arguments
20are to be passed to a function. For instance, an interpreter may be
21told at run-time about the number and types of arguments used to call
22a given function. Libffi can be used in such programs to provide a
23bridge from the interpreter program to compiled code.
24
25The libffi library provides a portable, high level programming
26interface to various calling conventions. This allows a programmer to
27call any function specified by a call interface description at run
28time.
29
30FFI stands for Foreign Function Interface.  A foreign function
31interface is the popular name for the interface that allows code
32written in one language to call code written in another language. The
33libffi library really only provides the lowest, machine dependent
34layer of a fully featured foreign function interface. A layer must
35exist above libffi that handles type conversions for values passed
36between the two languages.
37
38
39Supported Platforms
40===================
41
42Libffi has been ported to many different platforms.
43For specific configuration details and testing status, please
44refer to the wiki page here:
45
46 http://www.moxielogic.org/wiki/index.php?title=Libffi_3.2
47
48At the time of release, the following basic configurations have been
49tested:
50
51|-----------------+------------------+-------------------------|
52| Architecture    | Operating System | Compiler                |
53|-----------------+------------------+-------------------------|
54| AArch64 (ARM64) | iOS              | Clang                   |
55| AArch64         | Linux            | GCC                     |
56| Alpha           | Linux            | GCC                     |
57| Alpha           | Tru64            | GCC                     |
58| ARC             | Linux            | GCC                     |
59| ARM             | Linux            | GCC                     |
60| ARM             | iOS              | GCC                     |
61| AVR32           | Linux            | GCC                     |
62| Blackfin        | uClinux          | GCC                     |
63| HPPA            | HPUX             | GCC                     |
64| IA-64           | Linux            | GCC                     |
65| M68K            | FreeMiNT         | GCC                     |
66| M68K            | Linux            | GCC                     |
67| M68K            | RTEMS            | GCC                     |
68| M88K            | OpenBSD/mvme88k  | GCC                     |
69| Meta            | Linux            | GCC                     |
70| MicroBlaze      | Linux            | GCC                     |
71| MIPS            | IRIX             | GCC                     |
72| MIPS            | Linux            | GCC                     |
73| MIPS            | RTEMS            | GCC                     |
74| MIPS64          | Linux            | GCC                     |
75| Moxie           | Bare metal       | GCC                     |
76| Nios II         | Linux            | GCC                     |
77| OpenRISC        | Linux            | GCC                     |
78| PowerPC 32-bit  | AIX              | IBM XL C                |
79| PowerPC 64-bit  | AIX              | IBM XL C                |
80| PowerPC         | AMIGA            | GCC                     |
81| PowerPC         | Linux            | GCC                     |
82| PowerPC         | Mac OSX          | GCC                     |
83| PowerPC         | FreeBSD          | GCC                     |
84| PowerPC 64-bit  | FreeBSD          | GCC                     |
85| PowerPC 64-bit  | Linux ELFv1      | GCC                     |
86| PowerPC 64-bit  | Linux ELFv2      | GCC                     |
87| S390            | Linux            | GCC                     |
88| S390X           | Linux            | GCC                     |
89| SPARC           | Linux            | GCC                     |
90| SPARC           | Solaris          | GCC                     |
91| SPARC           | Solaris          | Oracle Solaris Studio C |
92| SPARC64         | Linux            | GCC                     |
93| SPARC64         | FreeBSD          | GCC                     |
94| SPARC64         | Solaris          | Oracle Solaris Studio C |
95| TILE-Gx/TILEPro | Linux            | GCC                     |
96| VAX             | OpenBSD/vax      | GCC                     |
97| X86             | FreeBSD          | GCC                     |
98| X86             | GNU HURD         | GCC                     |
99| X86             | Interix          | GCC                     |
100| X86             | kFreeBSD         | GCC                     |
101| X86             | Linux            | GCC                     |
102| X86             | Mac OSX          | GCC                     |
103| X86             | OpenBSD          | GCC                     |
104| X86             | OS/2             | GCC                     |
105| X86             | Solaris          | GCC                     |
106| X86             | Solaris          | Oracle Solaris Studio C |
107| X86             | Windows/Cygwin   | GCC                     |
108| X86             | Windows/MingW    | GCC                     |
109| X86-64          | FreeBSD          | GCC                     |
110| X86-64          | Linux            | GCC                     |
111| X86-64          | Linux/x32        | GCC                     |
112| X86-64          | OpenBSD          | GCC                     |
113| X86-64          | Solaris          | Oracle Solaris Studio C |
114| X86-64          | Windows/Cygwin   | GCC                     |
115| X86-64          | Windows/MingW    | GCC                     |
116| X86-64          | Mac OSX          | GCC                     |
117| Xtensa          | Linux            | GCC                     |
118|-----------------+------------------+-------------------------|
119
120Please send additional platform test results to
121libffi-discuss@sourceware.org and feel free to update the wiki page
122above.
123
124Installing libffi
125=================
126
127First you must configure the distribution for your particular
128system. Go to the directory you wish to build libffi in and run the
129"configure" program found in the root directory of the libffi source
130distribution.
131
132If you're building libffi directly from version control, configure won't
133exist yet; run ./autogen.sh first.
134
135You may want to tell configure where to install the libffi library and
136header files. To do that, use the --prefix configure switch.  Libffi
137will install under /usr/local by default.
138
139If you want to enable extra run-time debugging checks use the the
140--enable-debug configure switch. This is useful when your program dies
141mysteriously while using libffi.
142
143Another useful configure switch is --enable-purify-safety. Using this
144will add some extra code which will suppress certain warnings when you
145are using Purify with libffi. Only use this switch when using
146Purify, as it will slow down the library.
147
148If you don't want to build documentation, use the --disable-docs
149configure switch.
150
151It's also possible to build libffi on Windows platforms with
152Microsoft's Visual C++ compiler.  In this case, use the msvcc.sh
153wrapper script during configuration like so:
154
155path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"
156
157For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
158CXX="path/to/msvcc.sh -m64".  You may also need to specify --build
159appropriately.
160
161It is also possible to build libffi on Windows platforms with the LLVM
162project's clang-cl compiler, like below:
163
164path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
165
166When building with MSVC under a MingW environment, you may need to
167remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
168command.  ('cygpath' is not present in MingW, and is not required when
169using MingW-style paths.)
170
171For iOS builds, the 'libffi.xcodeproj' Xcode project is available.
172
173Configure has many other options. Use "configure --help" to see them all.
174
175Once configure has finished, type "make". Note that you must be using
176GNU make.  You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .
177
178To ensure that libffi is working as advertised, type "make check".
179This will require that you have DejaGNU installed.
180
181To install the library and header files, type "make install".
182
183
184History
185=======
186
187See the git log for details at http://github.com/libffi/libffi.
188
1894.0 TBD
190        New API in support of GO closures.
191
1923.2.1 Nov-12-14
193        Build fix for non-iOS AArch64 targets.
194
1953.2 Nov-11-14
196        Add C99 Complex Type support (currently only supported on
197          s390).
198	Add support for PASCAL and REGISTER calling conventions on x86
199	  Windows/Linux.
200	Add OpenRISC and Cygwin-64 support.
201        Bug fixes.
202
2033.1 May-19-14
204        Add AArch64 (ARM64) iOS support.
205        Add Nios II support.
206        Add m88k and DEC VAX support.
207	Add support for stdcall, thiscall, and fastcall on non-Windows
208	  32-bit x86 targets such as Linux.
209	Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi
210	  fixes.
211	Make the testsuite more robust: eliminate several spurious
212	  failures, and respect the $CC and $CXX environment variables.
213	Archive off the manually maintained ChangeLog in favor of git
214	  log.
215
2163.0.13 Mar-17-13
217	Add Meta support.
218	Add missing Moxie bits.
219	Fix stack alignment bug on 32-bit x86.
220	Build fix for m68000 targets.
221	Build fix for soft-float Power targets.
222	Fix the install dir location for some platforms when building
223	  with GCC (OS X, Solaris).
224	Fix Cygwin regression.
225
2263.0.12 Feb-11-13
227        Add Moxie support.
228	Add AArch64 support.
229	Add Blackfin support.
230	Add TILE-Gx/TILEPro support.
231	Add MicroBlaze support.
232	Add Xtensa support.
233	Add support for PaX enabled kernels with MPROTECT.
234	Add support for native vendor compilers on
235	  Solaris and AIX.
236	Work around LLVM/GCC interoperability issue on x86_64.
237
2383.0.11 Apr-11-12
239        Lots of build fixes.
240	Add support for variadic functions (ffi_prep_cif_var).
241	Add Linux/x32 support.
242	Add thiscall, fastcall and MSVC cdecl support on Windows.
243	Add Amiga and newer MacOS support.
244	Add m68k FreeMiNT support.
245	Integration with iOS' xcode build tools.
246	Fix Octeon and MC68881 support.
247	Fix code pessimizations.
248
2493.0.10 Aug-23-11
250        Add support for Apple's iOS.
251	Add support for ARM VFP ABI.
252        Add RTEMS support for MIPS and M68K.
253	Fix instruction cache clearing problems on
254	  ARM and SPARC.
255	Fix the N64 build on mips-sgi-irix6.5.
256	Enable builds with Microsoft's compiler.
257	Enable x86 builds with Oracle's Solaris compiler.
258	Fix support for calling code compiled with Oracle's Sparc
259	  Solaris compiler.
260	Testsuite fixes for Tru64 Unix.
261	Additional platform support.
262
2633.0.9 Dec-31-09
264        Add AVR32 and win64 ports.  Add ARM softfp support.
265	Many fixes for AIX, Solaris, HP-UX, *BSD.
266	Several PowerPC and x86-64 bug fixes.
267	Build DLL for windows.
268
2693.0.8 Dec-19-08
270        Add *BSD, BeOS, and PA-Linux support.
271
2723.0.7 Nov-11-08
273        Fix for ppc FreeBSD.
274	(thanks to Andreas Tobler)
275
2763.0.6 Jul-17-08
277        Fix for closures on sh.
278	Mark the sh/sh64 stack as non-executable.
279	(both thanks to Kaz Kojima)
280
2813.0.5 Apr-3-08
282        Fix libffi.pc file.
283	Fix #define ARM for IcedTea users.
284	Fix x86 closure bug.
285
2863.0.4 Feb-24-08
287        Fix x86 OpenBSD configury.
288
2893.0.3 Feb-22-08
290        Enable x86 OpenBSD thanks to Thomas Heller, and
291	x86-64 FreeBSD thanks to Björn König and Andreas Tobler.
292	Clean up test instruction in README.
293
2943.0.2 Feb-21-08
295        Improved x86 FreeBSD support.
296	Thanks to Björn König.
297
2983.0.1 Feb-15-08
299        Fix instruction cache flushing bug on MIPS.
300	Thanks to David Daney.
301
3023.0.0 Feb-15-08
303        Many changes, mostly thanks to the GCC project.
304	Cygnus Solutions is now Red Hat.
305
306  [10 years go by...]
307
3081.20 Oct-5-98
309	Raffaele Sena produces ARM port.
310
3111.19 Oct-5-98
312	Fixed x86 long double and long long return support.
313	m68k bug fixes from Andreas Schwab.
314	Patch for DU assembler compatibility for the Alpha from Richard
315	Henderson.
316
3171.18 Apr-17-98
318	Bug fixes and MIPS configuration changes.
319
3201.17 Feb-24-98
321	Bug fixes and m68k port from Andreas Schwab. PowerPC port from
322	Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.
323
3241.16 Feb-11-98
325	Richard Henderson produces Alpha port.
326
3271.15 Dec-4-97
328	Fixed an n32 ABI bug. New libtool, auto* support.
329
3301.14 May-13-97
331	libtool is now used to generate shared and static libraries.
332	Fixed a minor portability problem reported by Russ McManus
333	<mcmanr@eq.gs.com>.
334
3351.13 Dec-2-96
336	Added --enable-purify-safety to keep Purify from complaining
337	about certain low level code.
338	Sparc fix for calling functions with < 6 args.
339	Linux x86 a.out fix.
340
3411.12 Nov-22-96
342	Added missing ffi_type_void, needed for supporting void return
343	types. Fixed test case for non MIPS machines. Cygnus Support
344	is now Cygnus Solutions.
345
3461.11 Oct-30-96
347	Added notes about GNU make.
348
3491.10 Oct-29-96
350	Added configuration fix for non GNU compilers.
351
3521.09 Oct-29-96
353	Added --enable-debug configure switch. Clean-ups based on LCLint
354	feedback. ffi_mips.h is always installed. Many configuration
355	fixes. Fixed ffitest.c for sparc builds.
356
3571.08 Oct-15-96
358	Fixed n32 problem. Many clean-ups.
359
3601.07 Oct-14-96
361	Gordon Irlam rewrites v8.S again. Bug fixes.
362
3631.06 Oct-14-96
364	Gordon Irlam improved the sparc port.
365
3661.05 Oct-14-96
367	Interface changes based on feedback.
368
3691.04 Oct-11-96
370	Sparc port complete (modulo struct passing bug).
371
3721.03 Oct-10-96
373	Passing struct args, and returning struct values works for
374	all architectures/calling conventions. Expanded tests.
375
3761.02 Oct-9-96
377	Added SGI n32 support. Fixed bugs in both o32 and Linux support.
378	Added "make test".
379
3801.01 Oct-8-96
381	Fixed float passing bug in mips version. Restructured some
382	of the code. Builds cleanly with SGI tools.
383
3841.00 Oct-7-96
385	First release. No public announcement.
386
387
388Authors & Credits
389=================
390
391libffi was originally written by Anthony Green <green@moxielogic.com>.
392
393The developers of the GNU Compiler Collection project have made
394innumerable valuable contributions.  See the ChangeLog file for
395details.
396
397Some of the ideas behind libffi were inspired by Gianni Mariani's free
398gencall library for Silicon Graphics machines.
399
400The closure mechanism was designed and implemented by Kresten Krab
401Thorup.
402
403Major processor architecture ports were contributed by the following
404developers:
405
406aarch64		Marcus Shawcroft, James Greenhalgh
407alpha		Richard Henderson
408arm		Raffaele Sena
409blackfin        Alexandre Keunecke I. de Mendonca
410cris		Simon Posnjak, Hans-Peter Nilsson
411frv		Anthony Green
412ia64		Hans Boehm
413m32r		Kazuhiro Inaoka
414m68k		Andreas Schwab
415m88k		Miod Vallat
416microblaze	Nathan Rossi
417mips		Anthony Green, Casey Marshall
418mips64		David Daney
419moxie		Anthony Green
420nios ii		Sandra Loosemore
421openrisc        Sebastian Macke
422pa		Randolph Chung, Dave Anglin, Andreas Tobler
423powerpc		Geoffrey Keating, Andreas Tobler,
424			 David Edelsohn, John Hornkvist
425powerpc64	Jakub Jelinek
426s390		Gerhard Tonn, Ulrich Weigand
427sh		Kaz Kojima
428sh64		Kaz Kojima
429sparc		Anthony Green, Gordon Irlam
430tile-gx/tilepro Walter Lee
431vax		Miod Vallat
432x86		Anthony Green, Jon Beniston
433x86-64		Bo Thorsen
434xtensa		Chris Zankel
435
436Jesper Skov and Andrew Haley both did more than their fair share of
437stepping through the code and tracking down bugs.
438
439Thanks also to Tom Tromey for bug fixes, documentation and
440configuration help.
441
442Thanks to Jim Blandy, who provided some useful feedback on the libffi
443interface.
444
445Andreas Tobler has done a tremendous amount of work on the testsuite.
446
447Alex Oliva solved the executable page problem for SElinux.
448
449The list above is almost certainly incomplete and inaccurate.  I'm
450happy to make corrections or additions upon request.
451
452If you have a problem, or have found a bug, please send a note to the
453author at green@moxielogic.com, or the project mailing list at
454libffi-discuss@sourceware.org.
455

README.md

1Status
2======
3
4[![Build Status](https://travis-ci.org/libffi/libffi.svg?branch=master)](https://travis-ci.org/libffi/libffi)
5[![Build status](https://ci.appveyor.com/api/projects/status/8lko9vagbx4w2kxq?svg=true)](https://ci.appveyor.com/project/atgreen/libffi)
6
7libffi-3.3-rc0 was released on April 2, 2018.  Check the libffi web
8page for updates: <URL:http://sourceware.org/libffi/>.
9
10
11What is libffi?
12===============
13
14Compilers for high level languages generate code that follow certain
15conventions. These conventions are necessary, in part, for separate
16compilation to work. One such convention is the "calling
17convention". The "calling convention" is essentially a set of
18assumptions made by the compiler about where function arguments will
19be found on entry to a function. A "calling convention" also specifies
20where the return value for a function is found.
21
22Some programs may not know at the time of compilation what arguments
23are to be passed to a function. For instance, an interpreter may be
24told at run-time about the number and types of arguments used to call
25a given function. Libffi can be used in such programs to provide a
26bridge from the interpreter program to compiled code.
27
28The libffi library provides a portable, high level programming
29interface to various calling conventions. This allows a programmer to
30call any function specified by a call interface description at run
31time.
32
33FFI stands for Foreign Function Interface.  A foreign function
34interface is the popular name for the interface that allows code
35written in one language to call code written in another language. The
36libffi library really only provides the lowest, machine dependent
37layer of a fully featured foreign function interface. A layer must
38exist above libffi that handles type conversions for values passed
39between the two languages.
40
41
42Supported Platforms
43===================
44
45Libffi has been ported to many different platforms.
46
47At the time of release, the following basic configurations have been
48tested:
49
50| Architecture    | Operating System | Compiler                |
51| --------------- | ---------------- | ----------------------- |
52| AArch64 (ARM64) | iOS              | Clang                   |
53| AArch64         | Linux            | GCC                     |
54| AArch64         | Windows          | MSVC                    |
55| Alpha           | Linux            | GCC                     |
56| Alpha           | Tru64            | GCC                     |
57| ARC             | Linux            | GCC                     |
58| ARM             | Linux            | GCC                     |
59| ARM             | iOS              | GCC                     |
60| ARM             | Windows          | MSVC                    |
61| AVR32           | Linux            | GCC                     |
62| Blackfin        | uClinux          | GCC                     |
63| HPPA            | HPUX             | GCC                     |
64| IA-64           | Linux            | GCC                     |
65| M68K            | FreeMiNT         | GCC                     |
66| M68K            | Linux            | GCC                     |
67| M68K            | RTEMS            | GCC                     |
68| M88K            | OpenBSD/mvme88k  | GCC                     |
69| Meta            | Linux            | GCC                     |
70| MicroBlaze      | Linux            | GCC                     |
71| MIPS            | IRIX             | GCC                     |
72| MIPS            | Linux            | GCC                     |
73| MIPS            | RTEMS            | GCC                     |
74| MIPS64          | Linux            | GCC                     |
75| Moxie           | Bare metal       | GCC                     |
76| Nios II         | Linux            | GCC                     |
77| OpenRISC        | Linux            | GCC                     |
78| PowerPC 32-bit  | AIX              | IBM XL C                |
79| PowerPC 64-bit  | AIX              | IBM XL C                |
80| PowerPC         | AMIGA            | GCC                     |
81| PowerPC         | Linux            | GCC                     |
82| PowerPC         | Mac OSX          | GCC                     |
83| PowerPC         | FreeBSD          | GCC                     |
84| PowerPC 64-bit  | FreeBSD          | GCC                     |
85| PowerPC 64-bit  | Linux ELFv1      | GCC                     |
86| PowerPC 64-bit  | Linux ELFv2      | GCC                     |
87| RISC-V 32-bit   | Linux            | GCC                     |
88| RISC-V 64-bit   | Linux            | GCC                     |
89| S390            | Linux            | GCC                     |
90| S390X           | Linux            | GCC                     |
91| SPARC           | Linux            | GCC                     |
92| SPARC           | Solaris          | GCC                     |
93| SPARC           | Solaris          | Oracle Solaris Studio C |
94| SPARC64         | Linux            | GCC                     |
95| SPARC64         | FreeBSD          | GCC                     |
96| SPARC64         | Solaris          | Oracle Solaris Studio C |
97| TILE-Gx/TILEPro | Linux            | GCC                     |
98| VAX             | OpenBSD/vax      | GCC                     |
99| X86             | FreeBSD          | GCC                     |
100| X86             | GNU HURD         | GCC                     |
101| X86             | Interix          | GCC                     |
102| X86             | kFreeBSD         | GCC                     |
103| X86             | Linux            | GCC                     |
104| X86             | Mac OSX          | GCC                     |
105| X86             | OpenBSD          | GCC                     |
106| X86             | OS/2             | GCC                     |
107| X86             | Solaris          | GCC                     |
108| X86             | Solaris          | Oracle Solaris Studio C |
109| X86             | Windows/Cygwin   | GCC                     |
110| X86             | Windows/MingW    | GCC                     |
111| X86-64          | FreeBSD          | GCC                     |
112| X86-64          | Linux            | GCC                     |
113| X86-64          | Linux/x32        | GCC                     |
114| X86-64          | OpenBSD          | GCC                     |
115| X86-64          | Solaris          | Oracle Solaris Studio C |
116| X86-64          | Windows/Cygwin   | GCC                     |
117| X86-64          | Windows/MingW    | GCC                     |
118| X86-64          | Mac OSX          | GCC                     |
119| Xtensa          | Linux            | GCC                     |
120
121Please send additional platform test results to
122libffi-discuss@sourceware.org.
123
124Installing libffi
125=================
126
127First you must configure the distribution for your particular
128system. Go to the directory you wish to build libffi in and run the
129"configure" program found in the root directory of the libffi source
130distribution.  Note that building libffi requires a C99 compatible
131compiler.
132
133If you're building libffi directly from git hosted sources, configure
134won't exist yet; run ./autogen.sh first.  This will require that you
135install autoconf, automake and libtool.
136
137You may want to tell configure where to install the libffi library and
138header files. To do that, use the ``--prefix`` configure switch.  Libffi
139will install under /usr/local by default.
140
141If you want to enable extra run-time debugging checks use the the
142``--enable-debug`` configure switch. This is useful when your program dies
143mysteriously while using libffi.
144
145Another useful configure switch is ``--enable-purify-safety``. Using this
146will add some extra code which will suppress certain warnings when you
147are using Purify with libffi. Only use this switch when using
148Purify, as it will slow down the library.
149
150If you don't want to build documentation, use the ``--disable-docs``
151configure switch.
152
153It's also possible to build libffi on Windows platforms with
154Microsoft's Visual C++ compiler.  In this case, use the msvcc.sh
155wrapper script during configuration like so:
156
157    path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"
158
159For 64-bit Windows builds, use ``CC="path/to/msvcc.sh -m64"`` and
160``CXX="path/to/msvcc.sh -m64"``.  You may also need to specify
161``--build`` appropriately.
162
163It is also possible to build libffi on Windows platforms with the LLVM
164project's clang-cl compiler, like below:
165
166    path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
167
168When building with MSVC under a MingW environment, you may need to
169remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
170command.  ('cygpath' is not present in MingW, and is not required when
171using MingW-style paths.)
172
173To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder have
174   aarch64/Ffi_staticLib.sln
175   required header files in aarch64/aarch64_include/
176
177
178SPARC Solaris builds require the use of the GNU assembler and linker.
179Point ``AS`` and ``LD`` environment variables at those tool prior to
180configuration.
181
182For iOS builds, the ``libffi.xcodeproj`` Xcode project is available.
183
184Configure has many other options. Use ``configure --help`` to see them all.
185
186Once configure has finished, type "make". Note that you must be using
187GNU make.  You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .
188
189To ensure that libffi is working as advertised, type "make check".
190This will require that you have DejaGNU installed.
191
192To install the library and header files, type ``make install``.
193
194
195History
196=======
197
198See the git log for details at http://github.com/libffi/libffi.
199
200    3.3 TBD
201        Add RISC-V support.
202        New API in support of GO closures.
203        Default to Microsoft's 64 bit long double ABI with Visual C++.
204        GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
205        Many new tests cases and bug fixes.
206        Add windows on arm64 (WOA) support.
207        Add Windows 32-bit arm support.
208
209    3.2.1 Nov-12-14
210        Build fix for non-iOS AArch64 targets.
211
212    3.2 Nov-11-14
213        Add C99 Complex Type support (currently only supported on
214          s390).
215        Add support for PASCAL and REGISTER calling conventions on x86
216          Windows/Linux.
217        Add OpenRISC and Cygwin-64 support.
218        Bug fixes.
219
220    3.1 May-19-14
221        Add AArch64 (ARM64) iOS support.
222        Add Nios II support.
223        Add m88k and DEC VAX support.
224        Add support for stdcall, thiscall, and fastcall on non-Windows
225          32-bit x86 targets such as Linux.
226        Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi
227          fixes.
228        Make the testsuite more robust: eliminate several spurious
229          failures, and respect the $CC and $CXX environment variables.
230        Archive off the manually maintained ChangeLog in favor of git
231          log.
232
233    3.0.13 Mar-17-13
234        Add Meta support.
235        Add missing Moxie bits.
236        Fix stack alignment bug on 32-bit x86.
237        Build fix for m68000 targets.
238        Build fix for soft-float Power targets.
239        Fix the install dir location for some platforms when building
240          with GCC (OS X, Solaris).
241        Fix Cygwin regression.
242
243    3.0.12 Feb-11-13
244        Add Moxie support.
245        Add AArch64 support.
246        Add Blackfin support.
247        Add TILE-Gx/TILEPro support.
248        Add MicroBlaze support.
249        Add Xtensa support.
250        Add support for PaX enabled kernels with MPROTECT.
251        Add support for native vendor compilers on
252          Solaris and AIX.
253        Work around LLVM/GCC interoperability issue on x86_64.
254
255    3.0.11 Apr-11-12
256        Lots of build fixes.
257        Add support for variadic functions (ffi_prep_cif_var).
258        Add Linux/x32 support.
259        Add thiscall, fastcall and MSVC cdecl support on Windows.
260        Add Amiga and newer MacOS support.
261        Add m68k FreeMiNT support.
262        Integration with iOS' xcode build tools.
263        Fix Octeon and MC68881 support.
264        Fix code pessimizations.
265
266    3.0.10 Aug-23-11
267        Add support for Apple's iOS.
268        Add support for ARM VFP ABI.
269        Add RTEMS support for MIPS and M68K.
270        Fix instruction cache clearing problems on
271          ARM and SPARC.
272        Fix the N64 build on mips-sgi-irix6.5.
273        Enable builds with Microsoft's compiler.
274        Enable x86 builds with Oracle's Solaris compiler.
275        Fix support for calling code compiled with Oracle's Sparc
276          Solaris compiler.
277        Testsuite fixes for Tru64 Unix.
278        Additional platform support.
279
280    3.0.9 Dec-31-09
281        Add AVR32 and win64 ports.  Add ARM softfp support.
282        Many fixes for AIX, Solaris, HP-UX, *BSD.
283        Several PowerPC and x86-64 bug fixes.
284        Build DLL for windows.
285
286    3.0.8 Dec-19-08
287        Add *BSD, BeOS, and PA-Linux support.
288
289    3.0.7 Nov-11-08
290        Fix for ppc FreeBSD.
291        (thanks to Andreas Tobler)
292
293    3.0.6 Jul-17-08
294        Fix for closures on sh.
295        Mark the sh/sh64 stack as non-executable.
296        (both thanks to Kaz Kojima)
297
298    3.0.5 Apr-3-08
299        Fix libffi.pc file.
300        Fix #define ARM for IcedTea users.
301        Fix x86 closure bug.
302
303    3.0.4 Feb-24-08
304        Fix x86 OpenBSD configury.
305
306    3.0.3 Feb-22-08
307        Enable x86 OpenBSD thanks to Thomas Heller, and
308          x86-64 FreeBSD thanks to Björn König and Andreas Tobler.
309        Clean up test instruction in README.
310
311    3.0.2 Feb-21-08
312        Improved x86 FreeBSD support.
313        Thanks to Björn König.
314
315    3.0.1 Feb-15-08
316        Fix instruction cache flushing bug on MIPS.
317        Thanks to David Daney.
318
319    3.0.0 Feb-15-08
320        Many changes, mostly thanks to the GCC project.
321        Cygnus Solutions is now Red Hat.
322
323      [10 years go by...]
324
325    1.20 Oct-5-98
326        Raffaele Sena produces ARM port.
327
328    1.19 Oct-5-98
329        Fixed x86 long double and long long return support.
330        m68k bug fixes from Andreas Schwab.
331        Patch for DU assembler compatibility for the Alpha from Richard
332          Henderson.
333
334    1.18 Apr-17-98
335        Bug fixes and MIPS configuration changes.
336
337    1.17 Feb-24-98
338        Bug fixes and m68k port from Andreas Schwab. PowerPC port from
339        Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.
340
341    1.16 Feb-11-98
342        Richard Henderson produces Alpha port.
343
344    1.15 Dec-4-97
345        Fixed an n32 ABI bug. New libtool, auto* support.
346
347    1.14 May-13-97
348        libtool is now used to generate shared and static libraries.
349        Fixed a minor portability problem reported by Russ McManus
350        <mcmanr@eq.gs.com>.
351
352    1.13 Dec-2-96
353        Added --enable-purify-safety to keep Purify from complaining
354          about certain low level code.
355        Sparc fix for calling functions with < 6 args.
356        Linux x86 a.out fix.
357
358    1.12 Nov-22-96
359        Added missing ffi_type_void, needed for supporting void return
360          types. Fixed test case for non MIPS machines. Cygnus Support
361          is now Cygnus Solutions.
362
363    1.11 Oct-30-96
364        Added notes about GNU make.
365
366    1.10 Oct-29-96
367        Added configuration fix for non GNU compilers.
368
369    1.09 Oct-29-96
370        Added --enable-debug configure switch. Clean-ups based on LCLint
371        feedback. ffi_mips.h is always installed. Many configuration
372        fixes. Fixed ffitest.c for sparc builds.
373
374    1.08 Oct-15-96
375        Fixed n32 problem. Many clean-ups.
376
377    1.07 Oct-14-96
378        Gordon Irlam rewrites v8.S again. Bug fixes.
379
380    1.06 Oct-14-96
381        Gordon Irlam improved the sparc port.
382
383    1.05 Oct-14-96
384        Interface changes based on feedback.
385
386    1.04 Oct-11-96
387        Sparc port complete (modulo struct passing bug).
388
389    1.03 Oct-10-96
390        Passing struct args, and returning struct values works for
391        all architectures/calling conventions. Expanded tests.
392
393    1.02 Oct-9-96
394        Added SGI n32 support. Fixed bugs in both o32 and Linux support.
395        Added "make test".
396
397    1.01 Oct-8-96
398        Fixed float passing bug in mips version. Restructured some
399        of the code. Builds cleanly with SGI tools.
400
401    1.00 Oct-7-96
402        First release. No public announcement.
403
404Authors & Credits
405=================
406
407libffi was originally written by Anthony Green <green@moxielogic.com>.
408
409The developers of the GNU Compiler Collection project have made
410innumerable valuable contributions.  See the ChangeLog file for
411details.
412
413Some of the ideas behind libffi were inspired by Gianni Mariani's free
414gencall library for Silicon Graphics machines.
415
416The closure mechanism was designed and implemented by Kresten Krab
417Thorup.
418
419Major processor architecture ports were contributed by the following
420developers:
421
422    aarch64             Marcus Shawcroft, James Greenhalgh
423    alpha               Richard Henderson
424    arm                 Raffaele Sena
425    blackfin            Alexandre Keunecke I. de Mendonca
426    cris                Simon Posnjak, Hans-Peter Nilsson
427    frv                 Anthony Green
428    ia64                Hans Boehm
429    m32r                Kazuhiro Inaoka
430    m68k                Andreas Schwab
431    m88k                Miod Vallat
432    microblaze          Nathan Rossi
433    mips                Anthony Green, Casey Marshall
434    mips64              David Daney
435    moxie               Anthony Green
436    nios ii             Sandra Loosemore
437    openrisc            Sebastian Macke
438    pa                  Randolph Chung, Dave Anglin, Andreas Tobler
439    powerpc             Geoffrey Keating, Andreas Tobler,
440                        David Edelsohn, John Hornkvist
441    powerpc64           Jakub Jelinek
442    s390                Gerhard Tonn, Ulrich Weigand
443    sh                  Kaz Kojima
444    sh64                Kaz Kojima
445    sparc               Anthony Green, Gordon Irlam
446    tile-gx/tilepro     Walter Lee
447    vax                 Miod Vallat
448    x86                 Anthony Green, Jon Beniston
449    x86-64              Bo Thorsen
450    xtensa              Chris Zankel
451
452Jesper Skov and Andrew Haley both did more than their fair share of
453stepping through the code and tracking down bugs.
454
455Thanks also to Tom Tromey for bug fixes, documentation and
456configuration help.
457
458Thanks to Jim Blandy, who provided some useful feedback on the libffi
459interface.
460
461Andreas Tobler has done a tremendous amount of work on the testsuite.
462
463Alex Oliva solved the executable page problem for SElinux.
464
465The list above is almost certainly incomplete and inaccurate.  I'm
466happy to make corrections or additions upon request.
467
468If you have a problem, or have found a bug, please send a note to the
469author at green@moxielogic.com, or the project mailing list at
470libffi-discuss@sourceware.org.
471