Does anyone know the correct flags to pass to make in order to cross compile LuaJIT for the iOS Simulator? I managed to get it running on a device, but I am having trouble building for the simulator, I can't find a working example anywhere on the webs.
Thanks!!
Inside LuaJIT checkout (I'm using v2.1 branch):
IXCODE=`xcode-select -p`
ISDK=$IXCODE/Platforms/iPhoneSimulator.platform/Developer
ISDKVER=iPhoneSimulator8.1.sdk
ISDKP=/usr/bin/
ISDKF="-arch i386 -isysroot $ISDK/SDKs/$ISDKVER"
make clean
make HOST_CFLAGS="-arch i386" HOST_LDFLAGS="-arch i386" TARGET=x86 CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
This is the error message I am getting:
ld: building for MacOSX, but linking against dylib built for iOS Simulator file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/lib/libSystem.dylib' for architecture i386
Building for armv7 works:
IXCODE=`xcode-select -p`
ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer
ISDKVER=iPhoneOS8.1.sdk
ISDKP=/usr/bin/
ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
make clean
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
TARGET_FLAGS
in quotes. - Colonel Thirty Two-pagezero_size 10000 -image_base 100000000
. If you get this error from an iPhone simulator, that may be the case. - user3125367L
isNULL
indeed, thanks!! It turns out that the problem is only with the simulator architecture, it works on the phone, so I am going to edit my post to reflect this. - naartjie