Skip to content

Commit f694bc8

Browse files
committed
Add -Z external-sanitizer-runtime
This adds the unstable `-Z external-sanitizer-runtime` flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.
1 parent f62f490 commit f694bc8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,7 @@ fn add_sanitizer_libraries(
12021202
// Everywhere else the runtimes are currently distributed as static
12031203
// libraries which should be linked to executables only.
12041204
let needs_runtime = !sess.target.is_like_android
1205+
&& !sess.opts.unstable_opts.external_clangrt
12051206
&& match crate_type {
12061207
CrateType::Executable => true,
12071208
CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => {

compiler/rustc_session/src/options.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ options! {
16181618
"emit the bc module with thin LTO info (default: yes)"),
16191619
export_executable_symbols: bool = (false, parse_bool, [TRACKED],
16201620
"export symbols from executables, as if they were dynamic libraries"),
1621+
external_clangrt: bool = (false, parse_bool, [UNTRACKED],
1622+
"rely on user specified linker commands to find clangrt"),
16211623
extra_const_ub_checks: bool = (false, parse_bool, [TRACKED],
16221624
"turns on more checks to detect const UB, which can be slow (default: no)"),
16231625
#[rustc_lint_opt_deny_field_access("use `Session::fewer_names` instead of this field")]

0 commit comments

Comments
 (0)