source: trunk/src/gcc/libffi/README@ 1465

Last change on this file since 1465 was 1392, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 15.2 KB
Line 
1This directory contains the libffi package, which is not part of GCC but
2shipped with GCC as convenience.
3
4Status
5======
6
7libffi-2.00 has not been released yet! This is a development snapshot!
8
9libffi-1.20 was released on October 5, 1998. Check the libffi web
10page for updates: <URL:http://sources.redhat.com/libffi/>.
11
12
13What is libffi?
14===============
15
16Compilers for high level languages generate code that follow certain
17conventions. These conventions are necessary, in part, for separate
18compilation to work. One such convention is the "calling
19convention". The "calling convention" is essentially a set of
20assumptions made by the compiler about where function arguments will
21be found on entry to a function. A "calling convention" also specifies
22where the return value for a function is found.
23
24Some programs may not know at the time of compilation what arguments
25are to be passed to a function. For instance, an interpreter may be
26told at run-time about the number and types of arguments used to call
27a given function. Libffi can be used in such programs to provide a
28bridge from the interpreter program to compiled code.
29
30The libffi library provides a portable, high level programming
31interface to various calling conventions. This allows a programmer to
32call any function specified by a call interface description at run
33time.
34
35Ffi stands for Foreign Function Interface. A foreign function
36interface is the popular name for the interface that allows code
37written in one language to call code written in another language. The
38libffi library really only provides the lowest, machine dependent
39layer of a fully featured foreign function interface. A layer must
40exist above libffi that handles type conversions for values passed
41between the two languages.
42
43
44Supported Platforms and Prerequisites
45=====================================
46
47Libffi has been ported to:
48
49 SunOS 4.1.3 & Solaris 2.x (Sparc v8)
50
51 Irix 5.3 & 6.2 (System V/o32 & n32)
52
53 Intel x86 - Linux (System V ABI)
54
55 Alpha - Linux and OSF/1
56
57 m68k - Linux (System V ABI)
58
59 PowerPC - Linux (System V ABI, Darwin, AIX)
60
61 ARM - Linux (System V ABI)
62
63Libffi has been tested with the egcs 1.0.2 gcc compiler. Chances are
64that other versions will work. Libffi has also been built and tested
65with the SGI compiler tools.
66
67On PowerPC, the tests failed (see the note below).
68
69You must use GNU make to build libffi. SGI's make will not work.
70Sun's probably won't either.
71
72If you port libffi to another platform, please let me know! I assume
73that some will be easy (x86 NetBSD), and others will be more difficult
74(HP).
75
76
77Installing libffi
78=================
79
80[Note: before actually performing any of these installation steps,
81 you may wish to read the "Platform Specific Notes" below.]
82
83First you must configure the distribution for your particular
84system. Go to the directory you wish to build libffi in and run the
85"configure" program found in the root directory of the libffi source
86distribution.
87
88You may want to tell configure where to install the libffi library and
89header files. To do that, use the --prefix configure switch. Libffi
90will install under /usr/local by default.
91
92If you want to enable extra run-time debugging checks use the the
93--enable-debug configure switch. This is useful when your program dies
94mysteriously while using libffi.
95
96Another useful configure switch is --enable-purify-safety. Using this
97will add some extra code which will suppress certain warnings when you
98are using Purify with libffi. Only use this switch when using
99Purify, as it will slow down the library.
100
101Configure has many other options. Use "configure --help" to see them all.
102
103Once configure has finished, type "make". Note that you must be using
104GNU make. SGI's make will not work. Sun's probably won't either.
105You can ftp GNU make from prep.ai.mit.edu:/pub/gnu.
106
107To ensure that libffi is working as advertised, type "make test".
108
109To install the library and header files, type "make install".
110
111
112Using libffi
113============
114
115 The Basics