#14369·meson

Building rust libstd with Meson

Author: AndarwinuxCreated Mar 14, 2025Updated Sep 12, 2026
Labelslanguage:rustdependencies:cargo

In cargo-based rust projects, I can conveniently use -Zbuild-std to include libstd as a normal dependency, which is useful for tier 3 targets that don't have a prebuilt libstd or for situations where libstd needs to be rebuilt for some reason, such as LTO and CFI. I'm trying to understand how to do the same for meson-based rust projects, and I didn't find any information on this, so I opened this issue.

I have the following questions: Does meson rust assume that libstd is always provided by the installed rust toolchain? How does meson rust build code for targets that don't have a prebuilt std? Is it possible for meson rust to support something like build-std?

Thanks!