-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #132773 - jakos-sec:fix-asan-win32, r=jieyouxu
PassWrapper: disable UseOdrIndicator for Asan Win32 As described in https://reviews.llvm.org/D137227 UseOdrIndicator should be disabled on Windows since link.exe does not support duplicate weak definitions. Fixes #124390. Credits also belong to `@1c3t3a` who worked with me on this. We are currently testing this on a Windows machine.
- Loading branch information
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//! Check that crates can be linked together with `-Z sanitizer=address` on msvc. | ||
//! See <https://github.com/rust-lang/rust/issues/124390>. | ||
//@ run-pass | ||
//@ compile-flags:-Zsanitizer=address | ||
//@ aux-build: asan_odr_win-2.rs | ||
//@ only-windows-msvc | ||
|
||
extern crate othercrate; | ||
|
||
fn main() { | ||
let result = std::panic::catch_unwind(|| { | ||
println!("hello!"); | ||
}); | ||
assert!(result.is_ok()); | ||
|
||
othercrate::exposed_func(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ no-prefer-dynamic | ||
//@ compile-flags: -Z sanitizer=address | ||
#![crate_name = "othercrate"] | ||
#![crate_type = "rlib"] | ||
|
||
pub fn exposed_func() { | ||
let result = std::panic::catch_unwind(|| { | ||
println!("hello!"); | ||
}); | ||
assert!(result.is_ok()); | ||
} |