[dart2wasm] Enable specific binaryen features and not blindly enable all features
We should not blindly use `--all-features` as that will tell
binaryen that it may use any features in the resulting wasm file
(even features not even finalized yet).
The default dart2wasm (without extra opt-in by the user into more
wasm features) should only enable wasm features that we require
and are available in browsers at the point when they shipped
WasmGC.
Change-Id: Ifdcc31d938e29048b50be3fd5692693dc80ecbd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436604
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
diff --git a/pkg/dartdev/lib/src/commands/compile.dart b/pkg/dartdev/lib/src/commands/compile.dart
index d983cbef..954cc6d 100644
--- a/pkg/dartdev/lib/src/commands/compile.dart
+++ b/pkg/dartdev/lib/src/commands/compile.dart
@@ -741,7 +741,13 @@
// file for the flags. So please keep the formatting.
final List<String> binaryenFlags = _flagList('''
- --all-features
+ --enable-gc
+ --enable-reference-types
+ --enable-multivalue
+ --enable-exception-handling
+ --enable-nontrapping-float-to-int
+ --enable-sign-ext
+
--closed-world
--traps-never-happen
--type-unfinalizing