Skip to content

Commit 66a962e

Browse files
committed
self-contained libc.a + liunwind.a
1 parent 7694301 commit 66a962e

File tree

1 file changed

+12
-8
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+12
-8
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -2065,16 +2065,20 @@ fn add_local_crate_metadata_objects(
20652065
}
20662066

20672067
/// 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) {
2069-
// The default library location, we need this to find the runtime.
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));
2073-
2068+
fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: bool) {
20742069
// Special directory with libraries used only in self-contained linkage mode
20752070
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));
2071+
let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
2072+
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
2073+
}
2074+
2075+
// The default library location, we need this to find the runtime.
2076+
// The location of crates will be determined as needed.
2077+
// `copy_third_party_objects`
2078+
if sess.target.vendor == "fortanix" || sess.target.os == "linux" || sess.target.os == "fuchsia"
2079+
{
2080+
let lib_path = sess.target_filesearch(PathKind::Native).get_lib_path();
2081+
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
20782082
}
20792083
}
20802084

0 commit comments

Comments
 (0)