Add x86_64-unknown-linux-gnu{m,t}san target which enables {M,T}San by default#152757
Open
jakos-sec wants to merge 1 commit intorust-lang:mainfrom
Open
Add x86_64-unknown-linux-gnu{m,t}san target which enables {M,T}San by default#152757jakos-sec wants to merge 1 commit intorust-lang:mainfrom
jakos-sec wants to merge 1 commit intorust-lang:mainfrom
Conversation
… by default Similar like we've done it for `x86_64-unknown-linux-gnuasan`, in order to distribute sanitizer instrumented standard libraries without introducing new rustc flags, this adds a new dedicated target. With the target, we can distribute the instrumented standard libraries through a separate rustup component.
Collaborator
|
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
Collaborator
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
lqd
reviewed
Feb 17, 2026
|
|
||
| **Tier: 2** | ||
|
|
||
| Target mirroring `x86_64-unknown-linux-gnu` with LeakSanitizer enabled by |
Member
There was a problem hiding this comment.
Lsan is probably the next target to propose :3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Analogous to the ASan target (#149644), this adds targets for MSan and TSan.
As suggested, in order to distribute sanitizer instrumented standard libraries without introducing new rustc flags, this adds a new dedicated target. With the target, we can distribute the instrumented standard libraries through a separate rustup component.
The target is useful to anyone who wants to use MSan/TSan with a stable compiler or the ease to not have to recompiled all standard libraries for full coverage.
I pledge myself and the folks from the Exploit Mitigations Project Group (rcvalle@ & 1c3t3a@) as target maintainers to fix target-specific issues and educate the Rust community about their use.
Understood. The target should not have negative impact for anyone not using it.
src/doc/rustc/src/platform-support/x86_64-unknown-linux-gnu{m,t}san.mdshould provide the necessary documentation on how to build the target or compile programs with it. In the way the target can be emulated it should not differ from the tier 1 targetx86_64-unknown-linux-gnu.The baseline expectation mirror
x86_64-unknown-linux-gnu.This has been outlined sufficiently. We should not enable MSan/TSan in the default target and are therefore creating a new tier 2 target to bridge the gap until
build-stdstabilized.All of std that is supported by
x86_64-unknown-linux-gnuis also supported.The entire point is to have more security instead of less ;) The safety properties provided are already present in the compiler, just not enabled by default.
Understood.
Understood and the reason for introducing the tier 2 target.
Understood.
Understood.
Understood. No need to use this target as the host (no benefit of having MSan/TSan enabled for compiling).
Understood, no legal differences between this target and
x86_64-unknown-linux-gnu.Understood.
Understood.
Requirements for tier 3 are listed below.
I pledge to do my best maintaining it and we can also include the folks from the Exploit Mitigations Project Group (rcvalle@ & 1c3t3a@).
We've chosen
x86_64-unknown-linux-gnu{m,t}sanas the name which was suggested on #t-compiler/major changes > Create new Tier 2 targets with sanitizers… compiler-team#951 @ 💬. We've mergedx86_64-unknown-linux-gnuasanand are now following up with the MSan and TSan targetsThere should be no confusion, it's clear that it's the original target with MSan/TSan enabled.
Only letters, numbers and dashes used.
There are no unusual requirements to build or use it. It's the original
x86_64-unknown-linux-gnutarget with MSan/TSan enabled as a default sanitizer.There are no license implications.
Given, by reusing the existing MSan/TSan code.
There are no new dependencies/features required.
It's using open source tools only.
There are no such terms present.
Understood.
Understood.
The goal is to have MSan/TSan instrumented standard library variants of the existing
x86_64-unknown-linux-gnutarget, so all should be present.I think the explanation in platform support doc is enough to make this aspect clear.
Understood.
Understood.
I don't believe this PR is affected by this.
The target should work on all rustc versions that correctly compile for
x86_64-unknown-linux-gnu.