Add initial support for DataFlowSanitizer
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
This commit is contained in:
parent
eaee1e9453
commit
dee4e02102
20 changed files with 678 additions and 10 deletions
|
@ -1221,6 +1221,9 @@ fn add_sanitizer_libraries(
|
|||
if sanitizer.contains(SanitizerSet::ADDRESS) {
|
||||
link_sanitizer_runtime(sess, flavor, linker, "asan");
|
||||
}
|
||||
if sanitizer.contains(SanitizerSet::DATAFLOW) {
|
||||
link_sanitizer_runtime(sess, flavor, linker, "dfsan");
|
||||
}
|
||||
if sanitizer.contains(SanitizerSet::LEAK) {
|
||||
link_sanitizer_runtime(sess, flavor, linker, "lsan");
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ pub struct ModuleConfig {
|
|||
|
||||
pub sanitizer: SanitizerSet,
|
||||
pub sanitizer_recover: SanitizerSet,
|
||||
pub sanitizer_dataflow_abilist: Vec<String>,
|
||||
pub sanitizer_memory_track_origins: usize,
|
||||
|
||||
// Flags indicating which outputs to produce.
|
||||
|
@ -197,6 +198,10 @@ impl ModuleConfig {
|
|||
),
|
||||
|
||||
sanitizer: if_regular!(sess.opts.unstable_opts.sanitizer, SanitizerSet::empty()),
|
||||
sanitizer_dataflow_abilist: if_regular!(
|
||||
sess.opts.unstable_opts.sanitizer_dataflow_abilist.clone(),
|
||||
Vec::new()
|
||||
),
|
||||
sanitizer_recover: if_regular!(
|
||||
sess.opts.unstable_opts.sanitizer_recover,
|
||||
SanitizerSet::empty()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue