1 This directory contains the libffi package, which is not part of GCC but
2 shipped with GCC as convenience.
7 libffi-3.0.9 was released on December 31, 2009. Check the libffi web
8 page for updates: <URL:http://sourceware.org/libffi/>.
14 Compilers for high level languages generate code that follow certain
15 conventions. These conventions are necessary, in part, for separate
16 compilation to work. One such convention is the "calling
17 convention". The "calling convention" is essentially a set of
18 assumptions made by the compiler about where function arguments will
19 be found on entry to a function. A "calling convention" also specifies
20 where the return value for a function is found.
22 Some programs may not know at the time of compilation what arguments
23 are to be passed to a function. For instance, an interpreter may be
24 told at run-time about the number and types of arguments used to call
25 a given function. Libffi can be used in such programs to provide a
26 bridge from the interpreter program to compiled code.
28 The libffi library provides a portable, high level programming
29 interface to various calling conventions. This allows a programmer to
30 call any function specified by a call interface description at run
33 FFI stands for Foreign Function Interface. A foreign function
34 interface is the popular name for the interface that allows code
35 written in one language to call code written in another language. The
36 libffi library really only provides the lowest, machine dependent
37 layer of a fully featured foreign function interface. A layer must
38 exist above libffi that handles type conversions for values passed
39 between the two languages.
45 Libffi has been ported to many different platforms.
46 For specific configuration details and testing status, please
47 refer to the wiki page here:
49 http://www.moxielogic.org/wiki/index.php?title=Libffi_3.0.9
51 At the time of release, the following basic configurations have been
54 |--------------+------------------|
55 | Architecture | Operating System |
56 |--------------+------------------|
81 | X86 | Windows/Cygwin |
82 | X86 | Windows/MingW |
86 |--------------+------------------|
88 Please send additional platform test results to
89 libffi-discuss@sourceware.org and feel free to update the wiki page
95 First you must configure the distribution for your particular
96 system. Go to the directory you wish to build libffi in and run the
97 "configure" program found in the root directory of the libffi source
100 You may want to tell configure where to install the libffi library and
101 header files. To do that, use the --prefix configure switch. Libffi
102 will install under /usr/local by default.
104 If you want to enable extra run-time debugging checks use the the
105 --enable-debug configure switch. This is useful when your program dies
106 mysteriously while using libffi.
108 Another useful configure switch is --enable-purify-safety. Using this
109 will add some extra code which will suppress certain warnings when you
110 are using Purify with libffi. Only use this switch when using
111 Purify, as it will slow down the library.
113 Configure has many other options. Use "configure --help" to see them all.
115 Once configure has finished, type "make". Note that you must be using
116 GNU make. You can ftp GNU make from prep.ai.mit.edu:/pub/gnu.
118 To ensure that libffi is working as advertised, type "make check".
119 This will require that you have DejaGNU installed.
121 To install the library and header files, type "make install".
127 See the ChangeLog files for details.
130 Add AVR32 and win64 ports. Add ARM softfp support.
131 Many fixes for AIX, Solaris, HP-UX, *BSD.
132 Several PowerPC and x86-64 bug fixes.
133 Build DLL for windows.
136 Add *BSD, BeOS, and PA-Linux support.
140 (thanks to Andreas Tobler)
143 Fix for closures on sh.
144 Mark the sh/sh64 stack as non-executable.
145 (both thanks to Kaz Kojima)
149 Fix #define ARM for IcedTea users.
153 Fix x86 OpenBSD configury.
156 Enable x86 OpenBSD thanks to Thomas Heller, and
157 x86-64 FreeBSD thanks to Björn König and Andreas Tobler.
158 Clean up test instruction in README.
161 Improved x86 FreeBSD support.
162 Thanks to Björn König.
165 Fix instruction cache flushing bug on MIPS.
166 Thanks to David Daney.
169 Many changes, mostly thanks to the GCC project.
170 Cygnus Solutions is now Red Hat.
175 Raffaele Sena produces ARM port.
178 Fixed x86 long double and long long return support.
179 m68k bug fixes from Andreas Schwab.
180 Patch for DU assembler compatibility for the Alpha from Richard
184 Bug fixes and MIPS configuration changes.
187 Bug fixes and m68k port from Andreas Schwab. PowerPC port from
188 Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.
191 Richard Henderson produces Alpha port.
194 Fixed an n32 ABI bug. New libtool, auto* support.
197 libtool is now used to generate shared and static libraries.
198 Fixed a minor portability problem reported by Russ McManus
202 Added --enable-purify-safety to keep Purify from complaining
203 about certain low level code.
204 Sparc fix for calling functions with < 6 args.
208 Added missing ffi_type_void, needed for supporting void return
209 types. Fixed test case for non MIPS machines. Cygnus Support
210 is now Cygnus Solutions.
213 Added notes about GNU make.
216 Added configuration fix for non GNU compilers.
219 Added --enable-debug configure switch. Clean-ups based on LCLint
220 feedback. ffi_mips.h is always installed. Many configuration
221 fixes. Fixed ffitest.c for sparc builds.
224 Fixed n32 problem. Many clean-ups.
227 Gordon Irlam rewrites v8.S again. Bug fixes.
230 Gordon Irlam improved the sparc port.
233 Interface changes based on feedback.
236 Sparc port complete (modulo struct passing bug).
239 Passing struct args, and returning struct values works for
240 all architectures/calling conventions. Expanded tests.
243 Added SGI n32 support. Fixed bugs in both o32 and Linux support.
247 Fixed float passing bug in mips version. Restructured some
248 of the code. Builds cleanly with SGI tools.
251 First release. No public announcement.
257 libffi was originally written by Anthony Green <green@redhat.com>.
259 The developers of the GNU Compiler Collection project have made
260 innumerable valuable contributions. See the ChangeLog file for
263 Some of the ideas behind libffi were inspired by Gianni Mariani's free
264 gencall library for Silicon Graphics machines.
266 The closure mechanism was designed and implemented by Kresten Krab
269 Major processor architecture ports were contributed by the following
272 alpha Richard Henderson
274 cris Simon Posnjak, Hans-Peter Nilsson
279 mips Anthony Green, Casey Marshall
281 pa Randolph Chung, Dave Anglin, Andreas Tobler
282 powerpc Geoffrey Keating, Andreas Tobler,
283 David Edelsohn, John Hornkvist
284 powerpc64 Jakub Jelinek
285 s390 Gerhard Tonn, Ulrich Weigand
288 sparc Anthony Green, Gordon Irlam
289 x86 Anthony Green, Jon Beniston
292 Jesper Skov and Andrew Haley both did more than their fair share of
293 stepping through the code and tracking down bugs.
295 Thanks also to Tom Tromey for bug fixes, documentation and
298 Thanks to Jim Blandy, who provided some useful feedback on the libffi
301 Andreas Tobler has done a tremendous amount of work on the testsuite.
303 Alex Oliva solved the executable page problem for SElinux.
305 The list above is almost certainly incomplete and inaccurate. I'm
306 happy to make corrections or additions upon request.
308 If you have a problem, or have found a bug, please send a note to