diff options
| author | bors <bors@rust-lang.org> | 2024-03-02 22:59:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-02 22:59:19 +0000 |
| commit | 0decdac390cfeedcd7f2f44c45f72c59c70d8143 (patch) | |
| tree | 373fbe344b85306b4bb3d048b0b9ab1952a25c06 /compiler/rustc_codegen_llvm/src/back/write.rs | |
| parent | 5119208fd78a77547c705d1695428c88d6791263 (diff) | |
| parent | 4c65eef26937b4ea9572eb953ebc523a6cab167b (diff) | |
| download | rust-0decdac390cfeedcd7f2f44c45f72c59c70d8143.tar.gz rust-0decdac390cfeedcd7f2f44c45f72c59c70d8143.zip | |
Auto merge of #121914 - Nadrieril:rollup-ol98ncg, r=Nadrieril
Rollup of 5 pull requests Successful merges: - #120761 (Add initial support for DataFlowSanitizer) - #121622 (Preserve same vtable pointer when cloning raw waker, to fix Waker::will_wake) - #121716 (match lowering: Lower bindings in a predictable order) - #121731 (Now that inlining, mir validation and const eval all use reveal-all, we won't be constraining hidden types here anymore) - #121841 (`f16` and `f128` step 2: intrinsics) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back/write.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/back/write.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs index 08aab849868..031bbd63361 100644 --- a/compiler/rustc_codegen_llvm/src/back/write.rs +++ b/compiler/rustc_codegen_llvm/src/back/write.rs @@ -519,12 +519,22 @@ pub(crate) unsafe fn llvm_optimize( let pgo_sample_use_path = get_pgo_sample_use_path(config); let is_lto = opt_stage == llvm::OptStage::ThinLTO || opt_stage == llvm::OptStage::FatLTO; let instr_profile_output_path = get_instr_profile_output_path(config); + let sanitize_dataflow_abilist: Vec<_> = config + .sanitizer_dataflow_abilist + .iter() + .map(|file| CString::new(file.as_str()).unwrap()) + .collect(); + let sanitize_dataflow_abilist_ptrs: Vec<_> = + sanitize_dataflow_abilist.iter().map(|file| file.as_ptr()).collect(); // Sanitizer instrumentation is only inserted during the pre-link optimization stage. let sanitizer_options = if !is_lto { Some(llvm::SanitizerOptions { sanitize_address: config.sanitizer.contains(SanitizerSet::ADDRESS), sanitize_address_recover: config.sanitizer_recover.contains(SanitizerSet::ADDRESS), sanitize_cfi: config.sanitizer.contains(SanitizerSet::CFI), + sanitize_dataflow: config.sanitizer.contains(SanitizerSet::DATAFLOW), + sanitize_dataflow_abilist: sanitize_dataflow_abilist_ptrs.as_ptr(), + sanitize_dataflow_abilist_len: sanitize_dataflow_abilist_ptrs.len(), sanitize_kcfi: config.sanitizer.contains(SanitizerSet::KCFI), sanitize_memory: config.sanitizer.contains(SanitizerSet::MEMORY), sanitize_memory_recover: config.sanitizer_recover.contains(SanitizerSet::MEMORY), |
