File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/rustc_metadata/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ pub fn walk_native_lib_search_dirs<R>(
5757 f ( & sess. target_tlib_path . dir . join ( "self-contained" ) , false ) ?;
5858 }
5959
60+ let has_shared_llvm_apple_darwin =
61+ sess. target . is_like_darwin && sess. target_tlib_path . dir . join ( "libLLVM.dylib" ) . exists ( ) ;
62+
6063 // Toolchains for some targets may ship `libunwind.a`, but place it into the main sysroot
6164 // library directory instead of the self-contained directories.
6265 // Sanitizer libraries have the same issue and are also linked by name on Apple targets.
@@ -72,7 +75,8 @@ pub fn walk_native_lib_search_dirs<R>(
7275 || sess. target . os == Os :: Linux
7376 || sess. target . os == Os :: Fuchsia
7477 || sess. target . is_like_aix
75- || sess. target . is_like_darwin && !sess. sanitizers ( ) . is_empty ( )
78+ || sess. target . is_like_darwin
79+ && ( !sess. sanitizers ( ) . is_empty ( ) || has_shared_llvm_apple_darwin)
7680 || sess. target . os == Os :: Windows
7781 && sess. target . env == Env :: Gnu
7882 && sess. target . abi == Abi :: Llvm
You can’t perform that action at this time.
0 commit comments