cctools-port/usage_examples/ios_toolchain
2019-11-06 17:54:58 +01:00
..
build.sh Fixes to make cctools and ld64 work on Android 2019-11-06 17:54:58 +01:00
README Add TAPIv2 support 2017-04-01 20:42:35 +02:00
wrapper.c Fixes to make cctools and ld64 work on Android 2019-11-06 17:54:58 +01:00

PREREQUISITES:

See cctools/ld64 README + libssl-dev, git, bash, cmake and a jailbroken iOS device

--------------------------------------------------------------------------------

USAGE:

Please ensure you have read and understood the Xcode license terms before
building this toolchain: https://www.apple.com/legal/sla/docs/xcode.pdf.

[LLVM_DSYMUTIL=llvm-dsymutil] ./build.sh /path/to/sdk.tar.* <target cpu>

Target CPU should be one of armv6, armv7, armv7s and arm64.

This will build an iOS toolchain prefixed with
arm-apple-darwin11-*

You can then use arm-apple-darwin11-clang / arm apple-darwin11-clang++
to build your applications.

---

IPHONEOS_DEPLOYMENT_TARGET can be used to target older iOS versions.

For example:

export IPHONEOS_DEPLOYMENT_TARGET=5.0

will target iOS 5.0.

--------------------------------------------------------------------------------

ISSUES:

ISSUE: clang: error: invalid version number in '-miphoneos-version-min=10.2'
SOLUTION: Targeting iOS >= 10.0 requires Clang >= 4.0.

--------------------------------------------------------------------------------

PACKAGING THE SDK:

Ensure you have read and understood the Xcode license terms before continuing.
=> https://www.apple.com/legal/sla/docs/xcode.pdf

Packaging recents SDKs requires Mac OS Sierra.

Download Xcode 8.2.1 and extract its content. Then issue the following commands:

SDK=$(ls -l Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs | grep " -> iPhoneOS.sdk" | head -n1 | awk '{print $9}')
cp -r Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk /tmp/$SDK 1>/dev/null
cp -r Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 /tmp/$SDK/usr/include/c++ 1>/dev/null
pushd /tmp
tar -cvzf $SDK.tar.gz $SDK
rm -rf $SDK
mv $SDK.tar.gz ~
popd

The SDK should be now in your home directory.