alexcrichton opened issue #11610:
This is an issue spawned from this comment where currently Wasmtime has a number of methods on
Configwhich are prefixed withcranelift_*. The original intention of this was to clearly indicate that these are Cranelift-specific features and not related to other compilers. The way things have evolved over time, however, is that when Winch is enabled we also use Cranelift to generate trampolines. Additionally many Cranelift settings also affect Winch since it's using many of the same ISA primitives and flags and such.Given all that while these options are technically correct in that they only affect Cranelift they're also confusing in that they also affect Winch-configured builds. It's probably worth considering renaming these methods to avoid "cranelift" in the name and just say that they're "compiler" related. We can document some of them and their applicability to certain compiler backends (e.g. Winch doesn't respect opt_level for its generated code)
alexcrichton added the wasmtime:api label to Issue #11610.
saulecabrera commented on issue #11610:
Regarding the the applicability to certain compiler backends, should a configuration error be returned if a particular setting doesn't affect/is not applicable to a certain backend to further reduce any confusion regarding the matrix of settings/backends? e.g.,
cranelift_pccorcranelift_regalloc_algorithmdon't really affect Winch, so I think that an option in such cases would be to validate the applicability of such settings, similar to what we do for runtime features that are not supported by Winch, but that are by Cranelift.
alexcrichton commented on issue #11610:
On one hand, I agree, but on the other hand Winch uses Cranelift for trampolines so technically all Cranelift settings affect those. I'm not sure if we can say up front whether any setting would be critical for trampolines in terms of "you have to be able to set this even when using Winch or otherwise the system won't work".
It would make it much cleaner conceptually, though, if we could deny all Cranelift-specific settings when using Winch.
Last updated: Dec 06 2025 at 06:05 UTC