@@ -62,15 +62,12 @@ pub fn walk_native_lib_search_dirs<R>(
6262 f ( & sess. target_tlib_path . dir . join ( "self-contained" ) , false ) ?;
6363 }
6464
65- let has_shared_llvm_apple_darwin =
66- sess. target . is_like_darwin && sess. target_tlib_path . dir . join ( "libLLVM.dylib" ) . exists ( ) ;
67-
6865 // Toolchains for some targets may ship `libunwind.a`, but place it into the main sysroot
6966 // library directory instead of the self-contained directories.
7067 // Sanitizer libraries have the same issue and are also linked by name on Apple targets.
7168 // The targets here should be in sync with `copy_third_party_objects` in bootstrap.
72- // On Apple targets, shared LLVM is linked by name, so when `libLLVM.dylib` is
73- // present in the target libdir, add that directory to the linker search path .
69+ // Finally there is shared LLVM library, which unlike compiler libraries, is linked by the name,
70+ // therefore requiring the search path for the linker.
7471 // FIXME: implement `-Clink-self-contained=+/-unwind,+/-sanitizers`, move the shipped libunwind
7572 // and sanitizers to self-contained directory, and stop adding this search path.
7673 // FIXME: On AIX this also has the side-effect of making the list of library search paths
@@ -80,8 +77,7 @@ pub fn walk_native_lib_search_dirs<R>(
8077 || sess. target . os == Os :: Linux
8178 || sess. target . os == Os :: Fuchsia
8279 || sess. target . is_like_aix
83- || sess. target . is_like_darwin
84- && ( !sess. sanitizers ( ) . is_empty ( ) || has_shared_llvm_apple_darwin)
80+ || sess. target . is_like_darwin && !sess. sanitizers ( ) . is_empty ( )
8581 || sess. target . os == Os :: Windows
8682 && sess. target . env == Env :: Gnu
8783 && sess. target . cfg_abi == CfgAbi :: Llvm
0 commit comments