@@ -2065,16 +2065,16 @@ fn add_local_crate_metadata_objects(
2065
2065
}
2066
2066
2067
2067
/// Add sysroot and other globally set directories to the directory search list.
2068
- fn add_library_search_dirs ( cmd : & mut dyn Linker , sess : & Session , self_contained : bool ) {
2068
+ fn add_library_search_dirs ( _cmd : & mut dyn Linker , sess : & Session , self_contained : bool ) {
2069
2069
// The default library location, we need this to find the runtime.
2070
2070
// The location of crates will be determined as needed.
2071
- let lib_path = sess. target_filesearch ( PathKind :: All ) . get_lib_path ( ) ;
2072
- cmd. include_path ( & fix_windows_verbatim_for_gcc ( & lib_path) ) ;
2071
+ let _lib_path = sess. target_filesearch ( PathKind :: All ) . get_lib_path ( ) ;
2072
+ // cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
2073
2073
2074
2074
// Special directory with libraries used only in self-contained linkage mode
2075
2075
if self_contained {
2076
- let lib_path = sess. target_filesearch ( PathKind :: All ) . get_self_contained_lib_path ( ) ;
2077
- cmd. include_path ( & fix_windows_verbatim_for_gcc ( & lib_path) ) ;
2076
+ let _lib_path = sess. target_filesearch ( PathKind :: All ) . get_self_contained_lib_path ( ) ;
2077
+ // cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
2078
2078
}
2079
2079
}
2080
2080
@@ -2638,14 +2638,13 @@ fn add_local_native_libraries(
2638
2638
link_output_kind : LinkOutputKind ,
2639
2639
) {
2640
2640
if sess. opts . unstable_opts . link_native_libraries {
2641
- // User-supplied library search paths (-L on the command line). These are the same paths
2642
- // used to find Rust crates, so some of them may have been added already by the previous
2643
- // crate linking code. This only allows them to be found at compile time so it is still
2644
- // entirely up to outside forces to make sure that library can be found at runtime.
2645
- for search_path in sess. target_filesearch ( PathKind :: All ) . search_paths ( ) {
2646
- match search_path. kind {
2647
- PathKind :: Framework => cmd. framework_path ( & search_path. dir ) ,
2648
- _ => cmd. include_path ( & fix_windows_verbatim_for_gcc ( & search_path. dir ) ) ,
2641
+ for search_path in sess. target_filesearch ( PathKind :: Native ) . cli_search_paths ( ) {
2642
+ cmd. include_path ( & fix_windows_verbatim_for_gcc ( & search_path. dir ) ) ;
2643
+ }
2644
+ for search_path in sess. target_filesearch ( PathKind :: Framework ) . cli_search_paths ( ) {
2645
+ // Contrary to the `-L` docs only framework-specific paths are considered here.
2646
+ if search_path. kind != PathKind :: All {
2647
+ cmd. framework_path ( & search_path. dir ) ;
2649
2648
}
2650
2649
}
2651
2650
}
@@ -3012,9 +3011,9 @@ fn add_apple_sdk(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
3012
3011
// search path.
3013
3012
3014
3013
// The flags are called `-L` and `-F` both in Clang, ld64 and ldd.
3015
- let sdk_root = Path :: new ( & sdk_root) ;
3016
- cmd. include_path ( & sdk_root. join ( "System/iOSSupport/usr/lib" ) ) ;
3017
- cmd. framework_path ( & sdk_root. join ( "System/iOSSupport/System/Library/Frameworks" ) ) ;
3014
+ // let sdk_root = Path::new(&sdk_root);
3015
+ // cmd.include_path(&sdk_root.join("System/iOSSupport/usr/lib"));
3016
+ // cmd.framework_path(&sdk_root.join("System/iOSSupport/System/Library/Frameworks"));
3018
3017
}
3019
3018
}
3020
3019
0 commit comments