diff options
| author | bors <bors@rust-lang.org> | 2021-05-30 23:38:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-05-30 23:38:10 +0000 |
| commit | aab93ca37f38f70869c5de47c1877e54579e9de2 (patch) | |
| tree | 20a277cf7f439e6827b4b50e3e043253382a6739 /compiler/rustc_session/src | |
| parent | c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b (diff) | |
| parent | 43764844399af82f407fe963fa708e8f90981ea4 (diff) | |
Auto merge of #85559 - 12101111:sanitizer-crt-static, r=nagisa
Diagnose use sanitizers with crt-static Fix: https://github.com/rust-lang/rust/issues/85459
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 70c45b0d7d3..4ba47985ce1 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1512,6 +1512,14 @@ fn validate_commandline_args_with_session_available(sess: &Session) { if let (Some(first), Some(second)) = (sanitizer_iter.next(), sanitizer_iter.next()) { sess.err(&format!("`-Zsanitizer={}` is incompatible with `-Zsanitizer={}`", first, second)); } + + // Cannot enable crt-static with sanitizers on Linux + if sess.crt_static(None) && !sess.opts.debugging_opts.sanitizer.is_empty() { + sess.err( + "Sanitizer is incompatible with statically linked libc, \ + disable it using `-C target-feature=-crt-static`", + ); + } } /// Holds data on the current incremental compilation session, if there is one. |
