From 46777f0807cc1237167239b3a0925b7a49528d07 Mon Sep 17 00:00:00 2001 From: LongCat is Looong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Mon, 5 Oct 2020 17:48:19 -0700 Subject: [PATCH 1/6] test --- testing/scenario_app/compile_ios_jit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index 6c072066bfad3..497d348d3e157 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -85,7 +85,7 @@ echo "Compiling JIT Snapshot..." cp "$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" "$OUTDIR/App.framework/flutter_assets/vm_snapshot_data" -SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) +SYSROOT=$(xcrun --sdk iphonesimulator13.0 --show-sdk-path) echo "Using $SYSROOT as sysroot." echo "Creating stub App using $SYSROOT..." From 8f131dd2e67e7d0f939eff5cb1be17d0f5d361d5 Mon Sep 17 00:00:00 2001 From: LongCat is Looong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Thu, 8 Oct 2020 01:47:52 -0700 Subject: [PATCH 2/6] use ld in PATH --- testing/scenario_app/compile_ios_jit.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index 497d348d3e157..d0935a64737c3 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -85,7 +85,7 @@ echo "Compiling JIT Snapshot..." cp "$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" "$OUTDIR/App.framework/flutter_assets/vm_snapshot_data" -SYSROOT=$(xcrun --sdk iphonesimulator13.0 --show-sdk-path) +SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) echo "Using $SYSROOT as sysroot." echo "Creating stub App using $SYSROOT..." @@ -93,6 +93,7 @@ echo "Creating stub App using $SYSROOT..." echo "static const int Moo = 88;" | xcrun clang -x c \ -arch x86_64 \ -fembed-bitcode-marker \ + -fuse-ld=`which ld` \ -isysroot "$SYSROOT" \ -miphoneos-version-min=8.0 \ -dynamiclib \ From 959ab17ab6cbea569511fab14b5f339c8aa1b5b7 Mon Sep 17 00:00:00 2001 From: LongCat is Looong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Thu, 8 Oct 2020 11:24:27 -0700 Subject: [PATCH 3/6] update comments --- testing/scenario_app/compile_ios_jit.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index d0935a64737c3..e717c005beb9e 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -90,10 +90,16 @@ echo "Using $SYSROOT as sysroot." echo "Creating stub App using $SYSROOT..." +# Use the ld specified in PATH instead of the one from the active xcode +# toolchain (the default). +# +# When linking against a newer iOS SDK (newer SYSROOT) with an older version of +# clang, the linker from the old toolchain may refuse to link against new TAPI +# files provided in the new SDK. See: https://github.com/flutter/flutter/issues/65901 echo "static const int Moo = 88;" | xcrun clang -x c \ -arch x86_64 \ -fembed-bitcode-marker \ - -fuse-ld=`which ld` \ + -fuse-ld=$(which ld) \ -isysroot "$SYSROOT" \ -miphoneos-version-min=8.0 \ -dynamiclib \ From e43030b696729c4057d15d03e4ab26fb9664839d Mon Sep 17 00:00:00 2001 From: LongCat is Looong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Thu, 8 Oct 2020 13:34:55 -0700 Subject: [PATCH 4/6] use buildroot clang --- testing/scenario_app/compile_ios_jit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index e717c005beb9e..135238d2f29af 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -85,6 +85,7 @@ echo "Compiling JIT Snapshot..." cp "$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" "$OUTDIR/App.framework/flutter_assets/vm_snapshot_data" +LLVM_BIN_PATH="../../../buildtools/mac-x64/clang/bin" SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) echo "Using $SYSROOT as sysroot." @@ -96,10 +97,9 @@ echo "Creating stub App using $SYSROOT..." # When linking against a newer iOS SDK (newer SYSROOT) with an older version of # clang, the linker from the old toolchain may refuse to link against new TAPI # files provided in the new SDK. See: https://github.com/flutter/flutter/issues/65901 -echo "static const int Moo = 88;" | xcrun clang -x c \ +echo "static const int Moo = 88;" | $LLVM_BIN_PATH/clang -x c \ -arch x86_64 \ -fembed-bitcode-marker \ - -fuse-ld=$(which ld) \ -isysroot "$SYSROOT" \ -miphoneos-version-min=8.0 \ -dynamiclib \ From 669b1354545e5db064ead592c9adc85a59ec2f5a Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Fri, 9 Oct 2020 10:24:16 -0700 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Dan Field --- testing/scenario_app/compile_ios_jit.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index 135238d2f29af..b187b95190725 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -85,7 +85,7 @@ echo "Compiling JIT Snapshot..." cp "$DEVICE_TOOLS/../gen/flutter/lib/snapshot/vm_isolate_snapshot.bin" "$OUTDIR/App.framework/flutter_assets/vm_snapshot_data" -LLVM_BIN_PATH="../../../buildtools/mac-x64/clang/bin" +LLVM_BIN_PATH="${SCRIPT_DIR}/../../../buildtools/mac-x64/clang/bin" SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) echo "Using $SYSROOT as sysroot." @@ -97,7 +97,7 @@ echo "Creating stub App using $SYSROOT..." # When linking against a newer iOS SDK (newer SYSROOT) with an older version of # clang, the linker from the old toolchain may refuse to link against new TAPI # files provided in the new SDK. See: https://github.com/flutter/flutter/issues/65901 -echo "static const int Moo = 88;" | $LLVM_BIN_PATH/clang -x c \ +echo "static const int Moo = 88;" | "$LLVM_BIN_PATH/clang" -x c \ -arch x86_64 \ -fembed-bitcode-marker \ -isysroot "$SYSROOT" \ @@ -117,4 +117,3 @@ rm -rf "$SCRIPT_DIR/ios/Scenarios/App.framework" rm -rf "$SCRIPT_DIR/ios/Scenarios/Flutter.framework" cp -R "$OUTDIR/App.framework" "$SCRIPT_DIR/ios/Scenarios" cp -R "$DEVICE_TOOLS/../Flutter.framework" "$SCRIPT_DIR/ios/Scenarios" - From 74ce97033f57d0b41bbd40206f3d08965b29d293 Mon Sep 17 00:00:00 2001 From: LongCat is Looong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Fri, 9 Oct 2020 10:51:52 -0700 Subject: [PATCH 6/6] update comment --- testing/scenario_app/compile_ios_jit.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testing/scenario_app/compile_ios_jit.sh b/testing/scenario_app/compile_ios_jit.sh index 135238d2f29af..fe4b5a0eae59d 100755 --- a/testing/scenario_app/compile_ios_jit.sh +++ b/testing/scenario_app/compile_ios_jit.sh @@ -91,12 +91,8 @@ echo "Using $SYSROOT as sysroot." echo "Creating stub App using $SYSROOT..." -# Use the ld specified in PATH instead of the one from the active xcode -# toolchain (the default). -# -# When linking against a newer iOS SDK (newer SYSROOT) with an older version of -# clang, the linker from the old toolchain may refuse to link against new TAPI -# files provided in the new SDK. See: https://github.com/flutter/flutter/issues/65901 +# Use buildroot clang so we can override the linker to use in our LUCI recipe. +# See: https://github.com/flutter/flutter/issues/65901 echo "static const int Moo = 88;" | $LLVM_BIN_PATH/clang -x c \ -arch x86_64 \ -fembed-bitcode-marker \