Repository navigation
Create new Tier 2 targets with sanitizers enabled by default #951
Description
Activity
- addedT-compilerAdd this label so rfcbot knows to poll the compiler teamAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcA proposal to make a major change to rustc
on Dec 12, 2025 Important
This issue is not meant to be used for technical discussion. There is a Zulip stream for that.
Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.cc @rust-lang/compilerConcerns or objections can formally be registered here by adding a comment.
@rustbot concern reason-for-concern <description of the concern>Concerns can be lifted with:
@rustbot resolve reason-for-concernSee documentation at https://forge.rust-lang.org
- addedto-announceAnnounce this issue on triage meetingAnnounce this issue on triage meeting
on Dec 12, 2025 - changed the title
[-]Create new targets with sanitizers enabled by default[/-][+]Create new Tier 2 targets with sanitizers enabled by default[/+]on Dec 12, 2025 @rustbot second
- addedfinal-comment-periodThe FCP has started, most (if not all) team members are in agreementThe FCP has started, most (if not all) team members are in agreement
on Jan 7, 2026 The final comment period is now complete, this major change is now accepted. 🎉
As the automated representative, I want to express gratitude to the author for their work and everyone else who contributed to this major change proposal.
If you think this major change shouldn't have been accepted, feel free to remove the
major-change-acceptedlabel and reopen this issue.Note
Further progress is now tracked over at rust-lang/rust#151253.
- addedmajor-change-acceptedA major change proposal that was acceptedA major change proposal that was acceptedand removedfinal-comment-periodThe FCP has started, most (if not all) team members are in agreementThe FCP has started, most (if not all) team members are in agreement
on Jan 17, 2026 - locked as resolved and limited conversation to collaborators
on Jan 17, 2026 - removedto-announceAnnounce this issue on triage meetingAnnounce this issue on triage meeting
on Jan 29, 2026
Proposal
In the efforts of the Rust goal Rust Stabilization of MemorySanitizer and ThreadSanitizer Support, we are looking for a solution to distribute prebuilt sanitizer instrumented standard libraries. This was requested by previous reviews, in order to stabilize sanitizers that require all code to be instrumented since otherwise they generate false positives (like the MemorySanitizer and ThreadSanitizer). Currently the only way to realistically use those is with -Z build-std, but if we stabilize the sanitizers, it is odd to still be dependent on another unstable flag. This will also benefit other sanitizers (such as ASAN) to reduce false negatives.
The MCP (#943) for it resulted in the suggestion to, instead of the initially proposed rustc flag to choose a different
rustlibpath, make new targets which have (e.g.) ASAN enabled by default and we can use rustup to distribute standard libraries for those targets which are automatically instrumented.I've started with rust-lang/rust#149644, but in order to distribute the prebuilt standard libraries it needs to be a Tier 2 target (hence this MCP).
I started with the target for ASAN, but ideally we would like to do the same for (MSAN, TSAN, LeakSanitizer). Particularly MSAN and TSAN need instrumented standard libraries since without whole binary instrumentation they cause false positives.
As for the naming the most voted name on zulip (#t-compiler/major changes > Create new Tier 2 targets with sanitizers… compiler-team#951 @ 💬.) for an ASAN enabled
x86_64-unknown-linux-gnutarget was:x86_64-unknown-linux-gnuasanFor completeness:
x86_64-unknown-linux-gnu-asan(would require a cc-rs change (Add support for targets like x86_64-unknown-linux-gnu-asan cc-rs#1629))x86_64-asan-linux-gnu(the vendor is almost not used (apparently windows 7 does make use of it))x86_64-unknown_asan-linux-gnu: Appending tounknowninstead of replacing it.x86_64_asan-unknown-linux-gnu: compiling sanitizer rt complains since the LLVM sees:Compiler-RT supported architectures: x86_64_asan(which is not a valid ARCH).x86_64-unknown-linux_asan-gnu: worked but I'm not sure if that's ideal either (will probably break some things parsing-linux-gnu.Mentors or Reviewers
Mentor/Reviewer: rcvalle
Process
The main points of the Major Change Process are as follows:
@rustbot secondor kickoff a team FCP with@rfcbot fcp $RESOLUTION.You can read more about Major Change Proposals on forge.