Skip to content

Commit 1891141

Browse files
authored
Rollup merge of rust-lang#121207 - chriswailes:z-external-clangrt, r=michaelwoerister
Add `-Z external-clangrt` This adds the unstable `-Z external-clangrt` flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.
2 parents 6423b56 + f1d594e commit 1891141

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,7 @@ fn add_sanitizer_libraries(
12061206
// Everywhere else the runtimes are currently distributed as static
12071207
// libraries which should be linked to executables only.
12081208
let needs_runtime = !sess.target.is_like_android
1209+
&& !sess.opts.unstable_opts.external_clangrt
12091210
&& match crate_type {
12101211
CrateType::Executable => true,
12111212
CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => {

compiler/rustc_session/src/options.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,8 @@ options! {
16451645
"emit the bc module with thin LTO info (default: yes)"),
16461646
export_executable_symbols: bool = (false, parse_bool, [TRACKED],
16471647
"export symbols from executables, as if they were dynamic libraries"),
1648+
external_clangrt: bool = (false, parse_bool, [UNTRACKED],
1649+
"rely on user specified linker commands to find clangrt"),
16481650
extra_const_ub_checks: bool = (false, parse_bool, [TRACKED],
16491651
"turns on more checks to detect const UB, which can be slow (default: no)"),
16501652
#[rustc_lint_opt_deny_field_access("use `Session::fewer_names` instead of this field")]

0 commit comments

Comments
 (0)