Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A portable foreign-function interface library.

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-BUILDTOOLS
NotificationsYou must be signed in to change notification settings

NativeScript/libffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build StatusBuild status

libffi-3.3-rc0 was released on April 2, 2018. Check the libffi webpage for updates: URL:http://sourceware.org/libffi/.

What is libffi?

Compilers for high level languages generate code that follow certainconventions. These conventions are necessary, in part, for separatecompilation to work. One such convention is the "callingconvention". The "calling convention" is essentially a set ofassumptions made by the compiler about where function arguments willbe found on entry to a function. A "calling convention" also specifieswhere the return value for a function is found.

Some programs may not know at the time of compilation what argumentsare to be passed to a function. For instance, an interpreter may betold at run-time about the number and types of arguments used to calla given function. Libffi can be used in such programs to provide abridge from the interpreter program to compiled code.

The libffi library provides a portable, high level programminginterface to various calling conventions. This allows a programmer tocall any function specified by a call interface description at runtime.

FFI stands for Foreign Function Interface. A foreign functioninterface is the popular name for the interface that allows codewritten in one language to call code written in another language. Thelibffi library really only provides the lowest, machine dependentlayer of a fully featured foreign function interface. A layer mustexist above libffi that handles type conversions for values passedbetween the two languages.

Supported Platforms

Libffi has been ported to many different platforms.

At the time of release, the following basic configurations have beentested:

ArchitectureOperating SystemCompiler
AArch64 (ARM64)iOSClang
AArch64LinuxGCC
AArch64WindowsMSVC
AlphaLinuxGCC
AlphaTru64GCC
ARCLinuxGCC
ARMLinuxGCC
ARMiOSGCC
ARMWindowsMSVC
AVR32LinuxGCC
BlackfinuClinuxGCC
HPPAHPUXGCC
IA-64LinuxGCC
M68KFreeMiNTGCC
M68KLinuxGCC
M68KRTEMSGCC
M88KOpenBSD/mvme88kGCC
MetaLinuxGCC
MicroBlazeLinuxGCC
MIPSIRIXGCC
MIPSLinuxGCC
MIPSRTEMSGCC
MIPS64LinuxGCC
MoxieBare metalGCC
Nios IILinuxGCC
OpenRISCLinuxGCC
PowerPC 32-bitAIXIBM XL C
PowerPC 64-bitAIXIBM XL C
PowerPCAMIGAGCC
PowerPCLinuxGCC
PowerPCMac OSXGCC
PowerPCFreeBSDGCC
PowerPC 64-bitFreeBSDGCC
PowerPC 64-bitLinux ELFv1GCC
PowerPC 64-bitLinux ELFv2GCC
RISC-V 32-bitLinuxGCC
RISC-V 64-bitLinuxGCC
S390LinuxGCC
S390XLinuxGCC
SPARCLinuxGCC
SPARCSolarisGCC
SPARCSolarisOracle Solaris Studio C
SPARC64LinuxGCC
SPARC64FreeBSDGCC
SPARC64SolarisOracle Solaris Studio C
TILE-Gx/TILEProLinuxGCC
VAXOpenBSD/vaxGCC
X86FreeBSDGCC
X86GNU HURDGCC
X86InterixGCC
X86kFreeBSDGCC
X86LinuxGCC
X86Mac OSXGCC
X86OpenBSDGCC
X86OS/2GCC
X86SolarisGCC
X86SolarisOracle Solaris Studio C
X86Windows/CygwinGCC
X86Windows/MingWGCC
X86-64FreeBSDGCC
X86-64LinuxGCC
X86-64Linux/x32GCC
X86-64OpenBSDGCC
X86-64SolarisOracle Solaris Studio C
X86-64Windows/CygwinGCC
X86-64Windows/MingWGCC
X86-64Mac OSXGCC
XtensaLinuxGCC

Please send additional platform test results tolibffi-discuss@sourceware.org.

Installing libffi

First you must configure the distribution for your particularsystem. Go to the directory you wish to build libffi in and run the"configure" program found in the root directory of the libffi sourcedistribution. Note that building libffi requires a C99 compatiblecompiler.

If you're building libffi directly from git hosted sources, configurewon't exist yet; run ./autogen.sh first. This will require that youinstall autoconf, automake and libtool.

You may want to tell configure where to install the libffi library andheader files. To do that, use the--prefix configure switch. Libffiwill install under /usr/local by default.

If you want to enable extra run-time debugging checks use the the--enable-debug configure switch. This is useful when your program diesmysteriously while using libffi.

Another useful configure switch is--enable-purify-safety. Using thiswill add some extra code which will suppress certain warnings when youare using Purify with libffi. Only use this switch when usingPurify, as it will slow down the library.

If you don't want to build documentation, use the--disable-docsconfigure switch.

It's also possible to build libffi on Windows platforms withMicrosoft's Visual C++ compiler. In this case, use the msvcc.shwrapper script during configuration like so:

path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"

For 64-bit Windows builds, useCC="path/to/msvcc.sh -m64" andCXX="path/to/msvcc.sh -m64". You may also need to specify--build appropriately.

It is also possible to build libffi on Windows platforms with the LLVMproject's clang-cl compiler, like below:

path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"

When building with MSVC under a MingW environment, you may need toremove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'command. ('cygpath' is not present in MingW, and is not required whenusing MingW-style paths.)

To build static library for ARM64 with MSVC using visual studio solution, msvc_build folder haveaarch64/Ffi_staticLib.slnrequired header files in aarch64/aarch64_include/

SPARC Solaris builds require the use of the GNU assembler and linker.PointAS andLD environment variables at those tool prior toconfiguration.

For iOS builds, thelibffi.xcodeproj Xcode project is available.

Configure has many other options. Useconfigure --help to see them all.

Once configure has finished, type "make". Note that you must be usingGNU make. You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .

To ensure that libffi is working as advertised, type "make check".This will require that you have DejaGNU installed.

To install the library and header files, typemake install.

History

See the git log for details athttp://github.com/libffi/libffi.

3.3 TBD    Add RISC-V support.    New API in support of GO closures.    Default to Microsoft's 64 bit long double ABI with Visual C++.    GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.    Many new tests cases and bug fixes.    Add windows on arm64 (WOA) support.    Add Windows 32-bit arm support.    3.2.1 Nov-12-14    Build fix for non-iOS AArch64 targets.3.2 Nov-11-14    Add C99 Complex Type support (currently only supported on      s390).    Add support for PASCAL and REGISTER calling conventions on x86      Windows/Linux.    Add OpenRISC and Cygwin-64 support.    Bug fixes.3.1 May-19-14    Add AArch64 (ARM64) iOS support.    Add Nios II support.    Add m88k and DEC VAX support.    Add support for stdcall, thiscall, and fastcall on non-Windows      32-bit x86 targets such as Linux.    Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi      fixes.    Make the testsuite more robust: eliminate several spurious      failures, and respect the $CC and $CXX environment variables.    Archive off the manually maintained ChangeLog in favor of git      log.3.0.13 Mar-17-13    Add Meta support.    Add missing Moxie bits.    Fix stack alignment bug on 32-bit x86.    Build fix for m68000 targets.    Build fix for soft-float Power targets.    Fix the install dir location for some platforms when building      with GCC (OS X, Solaris).    Fix Cygwin regression.3.0.12 Feb-11-13    Add Moxie support.    Add AArch64 support.    Add Blackfin support.    Add TILE-Gx/TILEPro support.    Add MicroBlaze support.    Add Xtensa support.    Add support for PaX enabled kernels with MPROTECT.    Add support for native vendor compilers on      Solaris and AIX.    Work around LLVM/GCC interoperability issue on x86_64.3.0.11 Apr-11-12    Lots of build fixes.    Add support for variadic functions (ffi_prep_cif_var).    Add Linux/x32 support.    Add thiscall, fastcall and MSVC cdecl support on Windows.    Add Amiga and newer MacOS support.    Add m68k FreeMiNT support.    Integration with iOS' xcode build tools.    Fix Octeon and MC68881 support.    Fix code pessimizations.3.0.10 Aug-23-11    Add support for Apple's iOS.    Add support for ARM VFP ABI.    Add RTEMS support for MIPS and M68K.    Fix instruction cache clearing problems on      ARM and SPARC.    Fix the N64 build on mips-sgi-irix6.5.    Enable builds with Microsoft's compiler.    Enable x86 builds with Oracle's Solaris compiler.    Fix support for calling code compiled with Oracle's Sparc      Solaris compiler.    Testsuite fixes for Tru64 Unix.    Additional platform support.3.0.9 Dec-31-09    Add AVR32 and win64 ports.  Add ARM softfp support.    Many fixes for AIX, Solaris, HP-UX, *BSD.    Several PowerPC and x86-64 bug fixes.    Build DLL for windows.3.0.8 Dec-19-08    Add *BSD, BeOS, and PA-Linux support.3.0.7 Nov-11-08    Fix for ppc FreeBSD.    (thanks to Andreas Tobler)3.0.6 Jul-17-08    Fix for closures on sh.    Mark the sh/sh64 stack as non-executable.    (both thanks to Kaz Kojima)3.0.5 Apr-3-08    Fix libffi.pc file.    Fix #define ARM for IcedTea users.    Fix x86 closure bug.3.0.4 Feb-24-08    Fix x86 OpenBSD configury.3.0.3 Feb-22-08    Enable x86 OpenBSD thanks to Thomas Heller, and      x86-64 FreeBSD thanks to Björn König and Andreas Tobler.    Clean up test instruction in README.3.0.2 Feb-21-08    Improved x86 FreeBSD support.    Thanks to Björn König.3.0.1 Feb-15-08    Fix instruction cache flushing bug on MIPS.    Thanks to David Daney.3.0.0 Feb-15-08    Many changes, mostly thanks to the GCC project.    Cygnus Solutions is now Red Hat.  [10 years go by...]1.20 Oct-5-98    Raffaele Sena produces ARM port.1.19 Oct-5-98    Fixed x86 long double and long long return support.    m68k bug fixes from Andreas Schwab.    Patch for DU assembler compatibility for the Alpha from Richard      Henderson.1.18 Apr-17-98    Bug fixes and MIPS configuration changes.1.17 Feb-24-98    Bug fixes and m68k port from Andreas Schwab. PowerPC port from    Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.1.16 Feb-11-98    Richard Henderson produces Alpha port.1.15 Dec-4-97    Fixed an n32 ABI bug. New libtool, auto* support.1.14 May-13-97    libtool is now used to generate shared and static libraries.    Fixed a minor portability problem reported by Russ McManus    <mcmanr@eq.gs.com>.1.13 Dec-2-96    Added --enable-purify-safety to keep Purify from complaining      about certain low level code.    Sparc fix for calling functions with < 6 args.    Linux x86 a.out fix.1.12 Nov-22-96    Added missing ffi_type_void, needed for supporting void return       types. Fixed test case for non MIPS machines. Cygnus Support       is now Cygnus Solutions. 1.11 Oct-30-96    Added notes about GNU make.1.10 Oct-29-96    Added configuration fix for non GNU compilers.1.09 Oct-29-96    Added --enable-debug configure switch. Clean-ups based on LCLint     feedback. ffi_mips.h is always installed. Many configuration     fixes. Fixed ffitest.c for sparc builds.1.08 Oct-15-96    Fixed n32 problem. Many clean-ups.1.07 Oct-14-96    Gordon Irlam rewrites v8.S again. Bug fixes.1.06 Oct-14-96    Gordon Irlam improved the sparc port. 1.05 Oct-14-96    Interface changes based on feedback.1.04 Oct-11-96    Sparc port complete (modulo struct passing bug).1.03 Oct-10-96    Passing struct args, and returning struct values works for    all architectures/calling conventions. Expanded tests.1.02 Oct-9-96    Added SGI n32 support. Fixed bugs in both o32 and Linux support.    Added "make test".1.01 Oct-8-96    Fixed float passing bug in mips version. Restructured some    of the code. Builds cleanly with SGI tools.1.00 Oct-7-96    First release. No public announcement.

Authors & Credits

libffi was originally written by Anthony Greengreen@moxielogic.com.

The developers of the GNU Compiler Collection project have madeinnumerable valuable contributions. See the ChangeLog file fordetails.

Some of the ideas behind libffi were inspired by Gianni Mariani's freegencall library for Silicon Graphics machines.

The closure mechanism was designed and implemented by Kresten KrabThorup.

Major processor architecture ports were contributed by the followingdevelopers:

aarch64             Marcus Shawcroft, James Greenhalghalpha               Richard Hendersonarm                 Raffaele Senablackfin            Alexandre Keunecke I. de Mendoncacris                Simon Posnjak, Hans-Peter Nilssonfrv                 Anthony Greenia64                Hans Boehmm32r                Kazuhiro Inaokam68k                Andreas Schwabm88k                Miod Vallatmicroblaze          Nathan Rossimips                Anthony Green, Casey Marshallmips64              David Daneymoxie               Anthony Greennios ii             Sandra Loosemoreopenrisc            Sebastian Mackepa                  Randolph Chung, Dave Anglin, Andreas Toblerpowerpc             Geoffrey Keating, Andreas Tobler,                    David Edelsohn, John Hornkvistpowerpc64           Jakub Jelineks390                Gerhard Tonn, Ulrich Weigandsh                  Kaz Kojimash64                Kaz Kojimasparc               Anthony Green, Gordon Irlamtile-gx/tilepro     Walter Leevax                 Miod Vallatx86                 Anthony Green, Jon Benistonx86-64              Bo Thorsenxtensa              Chris Zankel

Jesper Skov and Andrew Haley both did more than their fair share ofstepping through the code and tracking down bugs.

Thanks also to Tom Tromey for bug fixes, documentation andconfiguration help.

Thanks to Jim Blandy, who provided some useful feedback on the libffiinterface.

Andreas Tobler has done a tremendous amount of work on the testsuite.

Alex Oliva solved the executable page problem for SElinux.

The list above is almost certainly incomplete and inaccurate. I'mhappy to make corrections or additions upon request.

If you have a problem, or have found a bug, please send a note to theauthor atgreen@moxielogic.com, or the project mailing list atlibffi-discuss@sourceware.org.

About

A portable foreign-function interface library.

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-BUILDTOOLS

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Languages

  • C65.3%
  • Assembly18.0%
  • Roff10.0%
  • M44.1%
  • Shell1.2%
  • Makefile0.6%
  • Other0.8%

[8]ページ先頭

©2009-2025 Movatter.jp