How to compile libffi for iOS and macOS?

I am trying to use libffi in one of my projects, but I cannot compile for iOS (or macOS, for that matter). Here is one of the various errors that I encountered while creating for iOS Simulator:

bash: src/arm/gentramp.sh: No such file or directory 

Update 1: Since the question remains unanswered, I decided to open issue in the official repository.

Update 2: The question was answered and the problem was closed!

+4
source share
3 answers

generate-darwin-source-and-headers.py, and libffi.xcodeproj needs to be updated to include all current matching source files.

Now the gentramp.sh script is no longer needed, and the current upstream xcodeproj is not updated with either compilation settings or source files for 64-bit iOS. The patched fork can be found at https://github.com/ksjogo/libffi

+1
source

If you check the repository, you will see that the requested file has been deleted in this commit . You can find the latest version of this file here .

+2
source

Please make sure that you follow the libffi instructions issued in the TBD or git project: https://github.com/libffi/libffi

Here are some of the highlights:

First you must configure the distribution for your specific system. Change to the directory where you want to embed libffi and run the "configure" found in the root directory of the libffi source distribution.

If you create libffi directly from source control, configure will not exist; run ./autogen.sh first.

You can specify where to install the libffi library and header files. To do this, use the --prefix configure switch. Libffi will be installed by default /usr/local .

If you want to enable additional debugging checks at runtime, use the --enable-debug configure switch. This is useful when your program dies mysteriously when using libffi.

Another useful configuration switch is --enable-purify-safety . Using this will add additional code that will suppress certain warnings when you use Purify with libffi. Use this switch only when using Clean, as this will slow down the library .

For iOS builds, the " libffi.xcodeproj " Xcode project is available.

There are many other options to configure. Use " configure --help " to see all of them.

After the configuration is complete, enter " make ". Note that you must use GNU make. You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .

To make libffi work as advertised, enter " make check ". This will require the installation of DejaGNU .

To install the library and header files, enter " make install ".

Alternatively, try combining one of the following git projects into a project to include missing files. Before merging, make sure the files are not outdated.

1 https://github.com/pandamonia/libffi-iOS

2 https://github.com/influitive/libffi-iOS

3 https://github.com/landonf/libffi-ios

0
source

All Articles