Skip to content

riscv64: do not build wasm-opt, matching what the Yocto recipe does - #26

Merged
jwinarske merged 1 commit into
mainfrom
jw/riscv64-no-wasm-opt
Sep 3, 2026
Merged

riscv64: do not build wasm-opt, matching what the Yocto recipe does#26
jwinarske merged 1 commit into
mainfrom
jw/riscv64-no-wasm-opt

Conversation

@jwinarske

Copy link
Copy Markdown
Contributor

riscv64 has failed in Build Debug since 3.47.1, linking wasm-opt with nine
duplicate __cxa* symbols defined both by the vendored libcxxabi and by the
target libc++.a in the pinned clang toolchain. See #24.

upstream flutter/tools/gn already drops that target when it builds the Dart SDK
in-tree, with the comment "it doesn't build properly with our gn
configuration"
. The exclusion sits in the is_host_build() branch -- host
builds, linux arm64 and mac -- so a cross build with no prebuilt Dart SDK for its
target never reaches it. flutter/prebuilts carries linux-x64 and
linux-arm64 only, which is why x86_64 and arm64 build clean: they copy a
prebuilt SDK and never build wasm-opt at all.

meta-flutter's flutter-engine recipe has passed
--gn-args=dart_include_wasm_opt=false since it hit the same wall, and its
riscv64 builds work. Doing the same here is preferable to patching tools/gn:
the option is upstream and its value is appended after the computed args, so it
wins.

Nothing in an embedder build wants wasm-opt; it is dart2wasm tooling. Dropping it
also takes roughly 7000 targets out of the riscv64 build.

Validated on a804b261 from this branch with release=false
(run):
Build Debug, Build Release and Build Profile all pass, where Debug
previously died at target 7209 of 14380.

Only the riscv64 workflow is touched. x86_64 and arm64 use a prebuilt SDK, so the
flag would be inert for them.

The riscv64 build fails linking wasm-opt with nine duplicate __cxa*
symbols, defined both by the vendored libcxxabi and by the target
libc++.a that ships with the pinned clang toolchain.

upstream flutter/tools/gn already drops that target when it builds the
Dart SDK in-tree, with the comment "it doesn't build properly with our gn
configuration". The exclusion sits in the is_host_build() branch, which
is only host builds, linux arm64 and mac, so a cross build with no
prebuilt Dart SDK for its target never reaches it. flutter/prebuilts
carries linux-x64 and linux-arm64 only, which is why x86_64 and arm64
build clean: they copy a prebuilt SDK and never build wasm-opt at all.

meta-flutter's flutter-engine recipe has passed
--gn-args=dart_include_wasm_opt=false since it hit the same wall, and its
riscv64 builds work. Do the same here rather than patch tools/gn: the
option is upstream and its value is appended after the computed args, so
it wins.

Nothing in an embedder build wants wasm-opt; it is dart2wasm tooling.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit debdf6d into main Sep 3, 2026
3 checks passed
@jwinarske
jwinarske deleted the jw/riscv64-no-wasm-opt branch September 3, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant