Skip to content

Commit 7a1010d

Browse files
committed
Exclude wasm-opt from from-source Dart SDK builds
When the Dart SDK is built from source (i.e. no usable prebuilt is available for the target, such as for riscv64 Linux cross builds), exclude the wasm-opt target. Binaryen's wasm-opt is built with exceptions enabled and links the toolchain libc++, whose bundled libcxxabi exception symbols collide with the no-exceptions stubs in the engine's libcxxabi. The prebuilt Dart SDK already ships a wasm-opt binary for platforms that have one, so this only affects from-source builds.
1 parent 9347202 commit 7a1010d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • engine/src/flutter/tools

‎engine/src/flutter/tools/gn‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,16 @@ def to_gn_args(args):
719719
# dartdevc, web SDK kernel and source files.
720720
gn_args['dart_platform_sdk'] = not args.full_dart_sdk
721721

722+
# When the Dart SDK is built from source (i.e. no usable prebuilt is
723+
# available for the target, such as for riscv64 Linux cross builds), exclude
724+
# the wasm-opt target. Binaryen's wasm-opt is built with exceptions enabled
725+
# and links the toolchain libc++, whose bundled libcxxabi exception symbols
726+
# collide with the no-exceptions stubs in the engine's libcxxabi. The
727+
# prebuilt Dart SDK already ships a wasm-opt binary for platforms that have
728+
# one, so this only affects from-source builds.
729+
if not gn_args.get('flutter_prebuilt_dart_sdk'):
730+
gn_args['dart_include_wasm_opt'] = False
731+
722732
if args.build_glfw_shell is not None:
723733
gn_args['build_glfw_shell'] = args.build_glfw_shell
724734

0 commit comments

Comments
 (0)