libffi-3.4.6 was released on February 18, 2024. Check the libffi web
page for updates: <URL:http://sourceware.org/libffi/>.
What is libffi?
===============
Compilers for high level languages generate code that follow certain
conventions. These conventions are necessary, in part, for separate
compilation to work. One such convention is the "calling
convention". The "calling convention" is essentially a set of
assumptions made by the compiler about where function arguments will
be found on entry to a function. A "calling convention" also specifies
where the return value for a function is found.
Some programs may not know at the time of compilation what arguments
are to be passed to a function. For instance, an interpreter may be
told at run-time about the number and types of arguments used to call
a given function. Libffi can be used in such programs to provide a
bridge from the interpreter program to compiled code.
The libffi library provides a portable, high level programming
interface to various calling conventions. This allows a programmer to
call any function specified by a call interface description at run
time.
FFI stands for Foreign Function Interface. A foreign function
interface is the popular name for the interface that allows code
written in one language to call code written in another language. The
libffi library really only provides the lowest, machine dependent
layer of a fully featured foreign function interface. A layer must
exist above libffi that handles type conversions for values passed
between the two languages.
Supported Platforms
===================
Libffi has been ported to many different platforms.
At the time of release, the following basic configurations have been
tested:
| Architecture | Operating System | Compiler |
| --------------- | ---------------- | ----------------------- |
| AArch64 (ARM64) | iOS | Clang |
| AArch64 | Linux | GCC |
| AArch64 | Windows | MSVC |
| Alpha | Linux | GCC |
| Alpha | Tru64 | GCC |
| ARC | Linux | GCC |
| ARC32 | Linux | GCC |
| ARC64 | Linux | GCC |
| ARM | Linux | GCC |
| ARM | iOS | GCC |
| ARM | Windows | MSVC |
| AVR32 | Linux | GCC |
| Blackfin | uClinux | GCC |
| CSKY | Linux | GCC |
| HPPA | HPUX | GCC |
| HPPA64 | HPUX | GCC |
| KVX | Linux | GCC |
| IA-64 | Linux | GCC |
| LoongArch64 | Linux | GCC |
| M68K | FreeMiNT | GCC |
| M68K | Linux | GCC |
| M68K | RTEMS | GCC |
| M88K | OpenBSD/mvme88k | GCC |
| Meta | Linux | GCC |
| MicroBlaze | Linux | GCC |
| MIPS | IRIX | GCC |
| MIPS | Linux | GCC |
| MIPS | RTEMS | GCC |
| MIPS64 | Linux | GCC |
| Moxie | Bare metal | GCC |
| Nios II | Linux | GCC |
| OpenRISC | Linux | GCC |
| PowerPC 32-bit | AIX | GCC |
| PowerPC 32-bit | AIX | IBM XL C |
| PowerPC 64-bit | AIX | IBM XL C |
| PowerPC | AMIGA | GCC |
| PowerPC | Linux | GCC |
| PowerPC | Mac OSX | GCC |
| PowerPC | FreeBSD | GCC |
| PowerPC 64-bit | FreeBSD | GCC |
| PowerPC 64-bit | Linux ELFv1 | GCC |
| PowerPC 64-bit | Linux ELFv2 | GCC |
| RISC-V 32-bit | Linux | GCC |
| RISC-V 64-bit | Linux | GCC |
| S390 | Linux | GCC |
| S390X | Linux | GCC |
| SPARC | Linux | GCC |
| SPARC | Solaris | GCC |
| SPARC | Solaris | Oracle Solaris Studio C |
| SPARC64 | Linux | GCC |
| SPARC64 | FreeBSD | GCC |
| SPARC64 | Solaris | Oracle Solaris Studio C |
| TILE-Gx/TILEPro | Linux | GCC |
| VAX | OpenBSD/vax | GCC |
| WASM32 | Emscripten | EMCC |
| X86 | FreeBSD | GCC |
| X86 | GNU HURD | GCC |
| X86 | Interix | GCC |
| X86 | kFreeBSD | GCC |
| X86 | Linux | GCC |
| X86 | OpenBSD | GCC |
| X86 | OS/2 | GCC |
| X86 | Solaris | GCC |
| X86 | Solaris | Oracle Solaris Studio C |
| X86 | Windows/Cygwin | GCC |
| X86 | Windows/MinGW | GCC |
| X86-64 | FreeBSD | GCC |
| X86-64 | Linux | GCC |
| X86-64 | Linux/x32 | GCC |
| X86-64 | OpenBSD | GCC |
| X86-64 | Solaris | Oracle Solaris Studio C |
| X86-64 | Windows/Cygwin | GCC |
| X86-64 | Windows/MinGW | GCC |
| X86-64 | Mac OSX | GCC |
| Xtensa | Linux | GCC |
Please send additional platform test results to
[email protected].
Installing libffi
=================
First you must configure the distribution for your particular
system. Go to the directory you wish to build libffi in and run the
"configure" program found in the root directory of the libffi source
distribution. Note that building libffi requires a C99 compatible
compiler.
If you're building libffi directly from git hosted sources, configure
won't exist yet; run ./autogen.sh first. This will require that you
install autoconf, automake and libtool.
You may want to tell configure where to install the libffi library and
header files. To do that, use the ``--prefix`` configure switch. Libffi
will 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 dies
mysteriously while using libffi.
Another useful configure switch is ``--enable-purify-safety``. Using this
will add some extra code which will suppress certain warnings when you
are using Purify with libffi. Only use this switch when using
Purify, as it will slow down the library.
If you don't want to build documentation, use the ``--disable-docs``
No module named '-ctypes' , libffi-3.4.6.tar.gz,libffi-devel 下载 ...
需积分: 0 56 浏览量
更新于2025-06-07
1
收藏 1.33MB GZ 举报
解决报错,linux centos 系统,安装 yum install libffi-devel
报错 No package libffi-devel available.
ModuleNotFoundError: No module named '_ctypes'
-----------------------------------------
1.下载 https://github.com/libffi/libffi/releases/download/v3.4.6/libffi-3.4.6.tar.gz 下载地址;
2.解压并编译安装
tar -xzf libffi-3.4.6.tar.gz
cd libffi-3.4.6
./configure --prefix=/usr/local # 默认安装到 /usr/local
make
sudo make install
3.配置动态链接
sudo ldconfig
4.验证安装
ls /usr/local/include/ffi.h # 确认头文件
ls /usr/local/lib/libffi.* # 确认库文件
5.重新编译python ,如果是为了修复 Python 的 _ctypes 模块,需重新编译 Python 并指定 libffi 路径
./configure --with-system-ffi --enable-optimizations
make && sudo make install
---------------------------------------------------

风中私语2022
- 粉丝: 9
最新资源
- 供电系统安全风险管理办法.doc
- 神经收集bp算法数学天然科学专业资料新版.pptx
- 互联网开发及应面试用求职简历模板.docx
- 基于51,52单片机的电子万年历的设计说明.doc
- 2020互联网销售工作总结.pdf
- 信息系统安全题库.doc
- 人教A版数学必修三课件:第一章--1.2.3基本算法语句(共63张PPT).ppt
- 上海证券交易所通信网络技术白皮书.doc
- 二元BCH码译码算法的优化与应用的开题报告.docx
- awtk-mvvm-C语言资源
- 综合布线中的七大子系统演示课件.ppt
- 灌云县侍庄中学2008-2009年网络安全培训计划.doc
- 计算机控制课程设计最小拍无波纹.doc
- 网络与信息安全自查表.docx
- 工作总结-工作总结范例-数据库课程工作总结.doc
- 人工智能与生活讲座1.ppt