问题
I'm trying to use libffi in one of my projects, but I can't seem to compile for iOS (or macOS, for that matter). Here is one of the various errors I've encountered while building for the iOS Simulator:
bash: src/arm/gentramp.sh: No such file or directory
Update 1: Since the question remains unanswered, I've decided to open an issue at the official repository as well.
Update 2: Question has been answered and the issue has been closed!
回答1:
generate-darwin-source-and-headers.py and the libffi.xcodeproj need to be updated to include all currently relevant source files.
The gentramp.sh script is not needed anymore and the current upstream xcodeproj is not up to date either with compilation settings and to be included source files for 64-bit on iOS. A patched fork can be found at https://github.com/ksjogo/libffi
回答2:
If you check the repository you will see that the file you require was deleted in this commit. You can find the last version of this file here.
回答3:
Please make sure you are following the installing libffi instructions released on the TBD or git project: https://github.com/libffi/libffi
Here some of the main Highlights:
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.
If you're building libffi directly from version control, configure won't
exist yet; run ./autogen.sh
first.
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.
For iOS builds, the 'libffi.xcodeproj
' Xcode project is available.
Configure has many other options. Use "configure --help
" to see them all.
Once configure has finished, type "make
". Note that you must be using
GNU 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, type "make install
".
Alternatively, try merging one of the following git projects to your project in order to include the missing files. Please make sure the files are not outdated before merging.
1 https://github.com/pandamonia/libffi-iOS
2 https://github.com/influitive/libffi-iOS
3 https://github.com/landonf/libffi-ios
来源:https://stackoverflow.com/questions/32156260/how-do-i-compile-libffi-for-ios-macos