flags+=(-fno-stack-protector)
flags+=(-O3 -g3)
+ if [[ ${arch} == arm* && ${arch} != arm64 ]]; then
+ flags+=(-mthumb)
+ fi
+
cd "libffi.${arch}"
- CC="clang -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]}" ../libffi/configure --host="${host}"
+ CC="clang -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../libffi/configure --host="${host}"
make
cd ..
}
-arch armv6 arm-apple-darwin10 iphoneos iphoneos 2.0
+arch armv6 arm-apple-darwin10 iphoneos iphoneos 2.0 -mllvm -arm-reserve-r9
arch armv7 arm-apple-darwin10 iphoneos iphoneos 2.0
arch armv7s arm-apple-darwin10 iphoneos iphoneos 2.0
arch arm64 aarch64-apple-darwin11 iphoneos iphoneos 2.0
libffi=()
for arch in "${archs[@]}"; do
- libffi+=(libffi."${arch}"/.libs/libffi.a)
+ a=libffi."${arch}"/.libs/libffi.a
+ # sectionForAddress(...) address not in any section file '...' for architecture i386
+ ar m "${a}" src/prep_cif.o
+ libffi+=("${a}")
done
lipo -create -output libffi.a "${libffi[@]}"