diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2025-03-09 14:06:51 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2025-03-09 14:23:41 +0300 |
| commit | d577883f929b00b8a35204acef10e40f58f064d5 (patch) | |
| tree | 7c2393917e7f4d5f270bdb502544c5d795b85e9e /compiler/rustc_codegen_ssa/src/back | |
| parent | a96fa317d78c78a9de996afd317603c6970efc0d (diff) | |
| download | rust-d577883f929b00b8a35204acef10e40f58f064d5.tar.gz rust-d577883f929b00b8a35204acef10e40f58f064d5.zip | |
metadata: Ignore sysroot when doing the manual native lib search in rustc
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 3407117a06e..0ce0eb1b538 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -22,7 +22,9 @@ use rustc_fs_util::{fix_windows_verbatim_for_gcc, try_canonicalize}; use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; use rustc_macros::LintDiagnostic; use rustc_metadata::fs::{METADATA_FILENAME, copy_to_stdout, emit_wrapper_file}; -use rustc_metadata::{find_native_static_library, walk_native_lib_search_dirs}; +use rustc_metadata::{ + NativeLibSearchFallback, find_native_static_library, walk_native_lib_search_dirs, +}; use rustc_middle::bug; use rustc_middle::lint::lint_level; use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile; @@ -2129,19 +2131,15 @@ fn add_library_search_dirs( return; } - walk_native_lib_search_dirs( - sess, - self_contained_components, - apple_sdk_root, - |dir, is_framework| { - if is_framework { - cmd.framework_path(dir); - } else { - cmd.include_path(&fix_windows_verbatim_for_gcc(dir)); - } - ControlFlow::<()>::Continue(()) - }, - ); + let fallback = Some(NativeLibSearchFallback { self_contained_components, apple_sdk_root }); + walk_native_lib_search_dirs(sess, fallback, |dir, is_framework| { + if is_framework { + cmd.framework_path(dir); + } else { + cmd.include_path(&fix_windows_verbatim_for_gcc(dir)); + } + ControlFlow::<()>::Continue(()) + }); } /// Add options making relocation sections in the produced ELF files read-only |
