0

I know that someone already asked this question but it isn`t up to date anymore. Most of the links are dead and the commands are not relevant anymore.

I have read these

Compile IOS program from linux commandline

How to cross-compile clang/llvm for iOS?

For example, I have been trying to compile silversearcher-ag for my iPhone 6 (jailbroken). This is the project link https://github.com/ggreer/the_silver_searcher.

I am targeting iOS 12.4.

These are the commands that I`ve tried

./configure CC=/home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target/bin/arm-apple-darwin11-clang CXX=/home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target/bin/arm-apple-darwin11-clang++ --host=arm-apple-darwin11

make

I am using cctools-port to cross compile the project. My compiled cctools toolchain is located under /home/growtopiajaw/Desktop/cctools-port-master/usage_examples/ios_toolchain/target and below is how the toolchain`s directory structure looks like cctools directory structure

This is my configure log: https://del.dog/nugibonury

This is my make log:

CC       src/ignore.o
In file included from src/ignore.c:11:
./src/options.h:7:10: fatal error: 'pcre.h' file not found
#include <pcre.h>
         ^~~~~~~~
1 error generated.
make: *** [Makefile:494: src/ignore.o] Error 1

This is my GitHub repository containing the cross compile toolchain https://github.com/GrowtopiaJaw/arm-apple-darwin11

Siguza
  • 21,155
  • 6
  • 52
  • 89

1 Answers1

0

Apple does not ship PCRE. You need to get the headers and dylib/tbd files manually.

If you're using checkra1n or unc0ver, then the deb on the APT repo contains headers as well, so you could just use that.

If you plan to package this into an APT/dpkg file, make sure to add pcre as a dependency.

Siguza
  • 21,155
  • 6
  • 52
  • 89
  • Since iOS uses clang and this project is basically built upon gcc, I can’t seems to compile this project on iOS as well. Trying both Clang with LLVM version 5 and Clang version 10, ./configure complains about clang not being able to executable files. This is my configure log https://del.dog/torrimaduj and this is the full config.log https://del.dog/mabangesta – Growtopia Jaw Dec 06 '20 at 09:42
  • That is most likely due to your toolchain running out of `/var` - shebangs have been thoroughly crippled by the sandbox. :/ – Siguza Dec 06 '20 at 12:31
  • is there any way to overcome this though either by cross compiling on linux or on the phone itself. I really have no idea what to do anymore – Growtopia Jaw Dec 06 '20 at 12:40
  • Yes, cross-compiling is perfectly possible, and it seems you were already trying that anyway. Just download the deb I linked to, extract the `data.tar.lzma` inside it, and either merge the `usr/include` and `usr/lib` folders with your project, or pass them through with `-I` and `-L`. – Siguza Dec 06 '20 at 12:48
  • yup, thanks. that works. but i was wondering if this could be applied on other projects. it seems that some gcc flags are not available on clang for example -Wlogical-op – Growtopia Jaw Dec 06 '20 at 13:06