-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sanitizers: Create the rustc_sanitizers crate #123620
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
r? @davidtwco |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, lots of small comments, but this is otherwise a clear improvement
/// This crate contains the source code for providing support for the sanitizers to the Rust | ||
/// compiler. | ||
pub mod cfi; | ||
pub mod kcfi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we could probably simplify the file structure a little bit here, it's mostly an aesthetic concern so only if you agree:
rustc_sanitizers
|- lib.rs
|- cfi.rs (containing what is in cfi/typeid/mod.rs)
|- kcfi.rs (containing what is in kcfi/typeid/mod.rs)
\- typeid/* (private mod, containing what is in cfi/typeid/itanium_cxx_abi now)
It's also possible that this doesn't make sense anticipating some of the other things you want to move to this crate that exists elsewhere at the moment, but if we're only anticipating things that we might do by having this structure (e.g. manglings other than itanium), then we can change to this structure when we're adding that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I thought about it too. The reason I ended up doing it this way was because I'm anticipating two things:
- Move as much as possible of CFI and KCFI related source code to cfi/mod.rs and kcfi/mod.rs (e.g., source code at declare.rs and builder.rs as cfi::emit_type_test and kcfi::emit_kcfi_bundle).
- Add possibly at least an additional encoding for Microsoft XFG and cross-language Microsoft XFG (but we might want to discuss if the rustc_sanitizers crate is the right place for it), or a more coarse-grained encoding for cross-language CFI compatibility with other languages.
What do you think?
compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/transform.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs
Outdated
Show resolved
Hide resolved
cc37b8e
to
5e9d4df
Compare
Create the rustc_sanitizers crate and move the source code for the CFI and KCFI sanitizers to it. Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
5e9d4df
to
1f0f2c4
Compare
@rustbot ready |
@bors r+ |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#122768 (Use the more informative generic type inference failure error on method calls on raw pointers) - rust-lang#123620 (sanitizers: Create the rustc_sanitizers crate) - rust-lang#123624 ([rustdoc] [GUI tests] Make theme switching closer to reality) - rust-lang#123636 (Update books) - rust-lang#123647 (rustdoc: slightly clean up the synthesis of blanket impls) - rust-lang#123648 (Avoid ICEing without the pattern_types feature gate) - rust-lang#123649 (KCFI: Use legal charset in shim encoding) - rust-lang#123652 (Fix UI tests with dist-vendored dependencies) - rust-lang#123655 (Remove unimplemented!() from BinOp::ty() function) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123620 - rcvalle:rust-create-rustc-sanitizers, r=davidtwco sanitizers: Create the rustc_sanitizers crate Create the `rustc_sanitizers` crate and move the source code for the CFI and KCFI sanitizers to it. The tracking issue for reviewing and moving sanitizers into a compiler crate is rust-lang#123619. This is part of our work to organize and stabilize support for the sanitizers. (See our roadmap at https://hackmd.io/`@rcvalle/S1Ou9K6H6.)`
Create the
rustc_sanitizers
crate and move the source code for the CFI and KCFI sanitizers to it. The tracking issue for reviewing and moving sanitizers into a compiler crate is #123619. This is part of our work to organize and stabilize support for the sanitizers. (See our roadmap at https://hackmd.io/@rcvalle/S1Ou9K6H6.)