Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions testing/scenario_app/compile_ios_jit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,19 @@ 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="${SCRIPT_DIR}/../../../buildtools/mac-x64/clang/bin"
SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path)
echo "Using $SYSROOT as sysroot."

echo "Creating stub App using $SYSROOT..."

echo "static const int Moo = 88;" | xcrun clang -x c \
# Use the ld specified in PATH instead of the one from the active xcode
# toolchain (the default).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: update this comment to reflect actual change please

#
# 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 \
-arch x86_64 \
-fembed-bitcode-marker \
-isysroot "$SYSROOT" \
Expand All @@ -110,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"