Use --closed-world flag in both stage 1 and stage 2 in opt builds.
Without this, stage 1 can emit something that is not valid in a closed world and stage 2 will fail to even load it.
@@ -56,6 +56,7 @@ def _impl_j2wasm_application(ctx):
args.add("--enable-strings")
args.add("--enable-nontrapping-float-to-int")
args.add("--nominal")
+ args.add("--closed-world")
args.add("--traps-never-happen")
args.add("--debuginfo")
@@ -214,7 +215,6 @@ def j2wasm_application(name, defines = dict(), **kwargs):
# Optimization flags (affecting passes in general) included at top.
"--partial-inlining-ifs=4",
"-fimfs=50",
- "--closed-world",
# Specific list of passes:
"--gufa",
# Get several rounds of -O3 before intrinsic lowering.
