File tree 1 file changed +7
-3
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2099,10 +2099,14 @@ fn add_library_search_dirs(
2099
2099
2100
2100
// Toolchains for some targets may ship `libunwind.a`, but place it into the main sysroot
2101
2101
// library directory instead of the self-contained directories.
2102
+ // Sanitizer libraries have the same issue and are also linked by name on Apple targets.
2102
2103
// The targets here should be in sync with `copy_third_party_objects` in bootstrap.
2103
- // FIXME: implement `-Clink-self-contained=+/-unwind`, move the shipped libunwind
2104
- // to self-contained directory, and stop adding this search path.
2105
- if sess. target . vendor == "fortanix" || sess. target . os == "linux" || sess. target . os == "fuchsia"
2104
+ // FIXME: implement `-Clink-self-contained=+/-unwind,+/-sanitizers`, move the shipped libunwind
2105
+ // and sanitizers to self-contained directory, and stop adding this search path.
2106
+ if sess. target . vendor == "fortanix"
2107
+ || sess. target . os == "linux"
2108
+ || sess. target . os == "fuchsia"
2109
+ || sess. target . is_like_osx && !sess. opts . unstable_opts . sanitizer . is_empty ( )
2106
2110
{
2107
2111
let lib_path = sess. target_filesearch ( PathKind :: Native ) . get_lib_path ( ) ;
2108
2112
cmd. include_path ( & fix_windows_verbatim_for_gcc ( & lib_path) ) ;
You can’t perform that action at this time.
0 commit comments