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.
This commit is contained in:
parent
3cbb93223f
commit
2a9d1ed538
2 changed files with 3 additions and 0 deletions
|
@ -1206,6 +1206,7 @@ fn add_sanitizer_libraries(
|
||||||
// Everywhere else the runtimes are currently distributed as static
|
// Everywhere else the runtimes are currently distributed as static
|
||||||
// libraries which should be linked to executables only.
|
// libraries which should be linked to executables only.
|
||||||
let needs_runtime = !sess.target.is_like_android
|
let needs_runtime = !sess.target.is_like_android
|
||||||
|
&& !sess.opts.unstable_opts.external_clangrt
|
||||||
&& match crate_type {
|
&& match crate_type {
|
||||||
CrateType::Executable => true,
|
CrateType::Executable => true,
|
||||||
CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => {
|
CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => {
|
||||||
|
|
|
@ -1645,6 +1645,8 @@ options! {
|
||||||
"emit the bc module with thin LTO info (default: yes)"),
|
"emit the bc module with thin LTO info (default: yes)"),
|
||||||
export_executable_symbols: bool = (false, parse_bool, [TRACKED],
|
export_executable_symbols: bool = (false, parse_bool, [TRACKED],
|
||||||
"export symbols from executables, as if they were dynamic libraries"),
|
"export symbols from executables, as if they were dynamic libraries"),
|
||||||
|
external_clangrt: bool = (false, parse_bool, [UNTRACKED],
|
||||||
|
"rely on user specified linker commands to find clangrt"),
|
||||||
extra_const_ub_checks: bool = (false, parse_bool, [TRACKED],
|
extra_const_ub_checks: bool = (false, parse_bool, [TRACKED],
|
||||||
"turns on more checks to detect const UB, which can be slow (default: no)"),
|
"turns on more checks to detect const UB, which can be slow (default: no)"),
|
||||||
#[rustc_lint_opt_deny_field_access("use `Session::fewer_names` instead of this field")]
|
#[rustc_lint_opt_deny_field_access("use `Session::fewer_names` instead of this field")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue