X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/c1d3e52e58e86c49f9d04e06ae8e0ece4b98250c..0a4d6bce78c5cd6fa45e62365bdf22e9edde61bf:/apple-libffi.sh?ds=sidebyside diff --git a/apple-libffi.sh b/apple-libffi.sh index 4c99e1c..7982b0a 100755 --- a/apple-libffi.sh +++ b/apple-libffi.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# Cycript - Optimizing JavaScript Compiler/Runtime -# Copyright (C) 2009-2015 Jay Freeman (saurik) +# Cycript - The Truly Universal Scripting Language +# Copyright (C) 2009-2016 Jay Freeman (saurik) # GNU Affero General Public License, Version 3 {{{ # @@ -19,56 +19,4 @@ # along with this program. If not, see . # }}} -set -e - -archs=() -function arch() { - local arch=$1 - local host=$2 - local sdk=$3 - local os=$4 - local min=$5 - shift 5 - - rm -rf "libffi.${arch}" - if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then - return - fi - - archs+=("${arch}") - mkdir "libffi.${arch}" - - flags=() - flags+=(-isysroot "${isysroot}") - flags+=(-m${os}-version-min="${min}") - flags+=(-no-integrated-as) - 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}" - make - cd .. -} - -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 - -arch i386 i386-apple-darwin10 iphonesimulator ios-simulator 4.0 -arch x86_64 x86_64-apple-darwin11 iphonesimulator ios-simulator 4.0 - -libffi=() -for arch in "${archs[@]}"; do - 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[@]}" +exec ./apple-lib.sh ffi -DPAGE_MAX_SIZE=16384 -DPAGE_MAX_SHIFT=14 -fno-stack-protector