dblnz opened PR #11304 from dblnz:no-std-debug-builtins to bytecodealliance:main:
Description
This PR takes care of enabling the compilation of
gdb_jit_intmodule in thejit-debugcrate to ensure the native debugging also works inno_stdenvironments.The
This work has been discussed in #wasmtime > Debugging a wasm module in a hyperlight guest.
Summary
- Make
jit-debugcrate#![no_std]whenperf_jitdebugis not enabled- Make
gdb_jit_intmodule build inno_stdenvironment- Use std when
perf_jitdebugis enabled because theperf_jitdebugmodule does not run inno_stdenvironment- Split
debug-builtinsfeature intodebug-builtinsandperf-builtinsto individually toggle:
- theno_stdgdb_jit_intmodule by usingdebug-builtins
- the stdperf_jitdebugmodule usingperf-builtins. NOTE: They can be both enabled, but it won't supportno_std.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dblnz requested alexcrichton for a review on PR #11304.
dblnz requested wasmtime-core-reviewers for a review on PR #11304.
dblnz requested wasmtime-default-reviewers for a review on PR #11304.
dblnz updated PR #11304.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
I forget how we ended up at the organization
alexcrichton edited PR review comment.
alexcrichton edited PR review comment.
alexcrichton edited PR review comment.
dblnz edited PR #11304:
Description
This PR takes care of enabling the compilation of
gdb_jit_intmodule in thejit-debugcrate to ensure the native debugging also works inno_stdenvironments.My aim is to have this in for the LTS version 36.0.0 :smiley:
This work has been discussed in #wasmtime > Debugging a wasm module in a hyperlight guest.
Summary
- Make
jit-debugcrate#![no_std]whenperf_jitdebugis not enabled- Make
gdb_jit_intmodule build inno_stdenvironment- Use std when
perf_jitdebugis enabled because theperf_jitdebugmodule does not run inno_stdenvironment- Split
debug-builtinsfeature intodebug-builtinsandperf-builtinsto individually toggle:
- theno_stdgdb_jit_intmodule by usingdebug-builtins
- the stdperf_jitdebugmodule usingperf-builtins. NOTE: They can be both enabled, but it won't supportno_std.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Can this condition be massaged a bit to still include the
has_host_compiler_backendconditional somehow? (or something like that)Previously it was a nice property that compiling Wasmtime to an unknown/unsupported platform wouldn't involve compiling any C code and I'd ideally like to preserve that. An example situation where C code is not needed is a platform using Pulley even when debug-builtins is enabled because in such a situation the builtins aren't actually used by anything.
alexcrichton created PR review comment:
This unfortunately is a dependency we cannot use. Spinning on contention is almost never the right concurrency primitive as it's only particularly useful in a kernel setting when interrupts are disabled for example. I also unfortunately do not have a great answer of what to do as an alternative. The best I can think of is "panic on contention" in no_std mode but still use a real
std::sync::Mutexin std mode.
alexcrichton created PR review comment:
I think it'd be best to skip this feature and have this force-enabled as part of the
profilingfeature, this separate feature doesn't actually enable anything otherwise in Wasmtime itself
dblnz submitted PR review.
dblnz created PR review comment:
Ok, thanks for the comment. I wasn't sure what the right decision was here.
I think panic inno_stdmode should be fine
dblnz edited PR review comment.
dblnz submitted PR review.
dblnz created PR review comment:
Hmm, I see, I followed the
debug-builtinsfeature and noticed it depends on some symbols from the C, and I thought that fordebug-builtinsthis will be needed.
I'll have another look
dblnz updated PR #11304.
dblnz updated PR #11304.
dblnz submitted PR review.
dblnz created PR review comment:
The idea I had in mind was that before this change,
debug-builtinsalso enabled the perf_jitdump, so when compilingwasmtime-cliand providing--features debug-builtinsnow it won't enable theperf_jitdumpanymore.
I had added aperf-builtinsso that this option could be enabled from thewasmtime-cli.I have taken your advice and force-enabled
perf_jitdumpas part ofprofiling. Let me know if you'd like to change
dblnz updated PR #11304.
dblnz updated PR #11304.
dblnz requested alexcrichton for a review on PR #11304.
alexcrichton updated PR #11304.
alexcrichton commented on PR #11304:
I've pushed a few commits as feedback here. Mind double-checking them and confirming they're ok for you?
I've pushed a few commits as feedback here. Mind double-checking them and confirming they're ok for you?
It looks good from my point of view.
Nice touch with the use of optional feature enablement.
"wasmtime-jit-debug?/std",
alexcrichton submitted PR review.
dblnz updated PR #11304.
alexcrichton merged PR #11304.
Last updated: Dec 06 2025 at 06:05 UTC