From: Jay Freeman (saurik) Date: Tue, 19 Aug 2014 23:44:20 +0000 (-0700) Subject: Add workaround for a linker bug (and a test case). X-Git-Tag: v0.9.502~1 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/54602694a8902f04afe627be38a2b3ca5e94cf88 Add workaround for a linker bug (and a test case). --- diff --git a/libffi.sh b/libffi.sh index fa01534..ac980df 100755 --- a/libffi.sh +++ b/libffi.sh @@ -65,7 +65,10 @@ arch x86_64 x86_64-apple-darwin11 iphonesimulator ios-simulator 4.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[@]}" diff --git a/section.sh b/section.sh new file mode 100755 index 0000000..a7f2753 --- /dev/null +++ b/section.sh @@ -0,0 +1,14 @@ +#!/bin/bash +function run { sdk=$1; arch=$2; shift 2; xcrun --sdk "${sdk}" g++ -arch "${arch}" "$@" -o a \ + -isysroot "$(xcodebuild -sdk "${sdk}" -version Path)" \ + -x c <(echo "void CYListenServer(short port); int main() { CYListenServer(6667); return 0; }") \ + -framework Foundation -framework JavaScriptCore -framework Cycript; } +echo macosx +run macosx i386 -mmacosx-version-min=10.6 -F Cycript.osx "${flags[@]}" +run macosx x86_64 -mmacosx-version-min=10.6 -F Cycript.osx "${flags[@]}" +echo iphoneos +run iphoneos armv6 -miphoneos-version-min=4.0 -F Cycript.ios "${flags[@]}" +run iphoneos arm64 -miphoneos-version-min=7.0 -F Cycript.ios "${flags[@]}" +echo iphonesimulator +run iphonesimulator i386 -mios-simulator-version-min=4.0 -F Cycript.ios "${flags[@]}" +run iphonesimulator x86_64 -mios-simulator-version-min=4.0 -F Cycript.ios "${flags[@]}" -fobjc-abi-version=2 -fobjc-legacy-dispatch