Skip to content

Commit

Permalink
self-contained libc.a + liunwind.a
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Jul 30, 2024
1 parent 7694301 commit 66a962e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2065,16 +2065,20 @@ fn add_local_crate_metadata_objects(
}

/// Add sysroot and other globally set directories to the directory search list.
fn add_library_search_dirs(_cmd: &mut dyn Linker, sess: &Session, self_contained: bool) {
// The default library location, we need this to find the runtime.
// The location of crates will be determined as needed.
let _lib_path = sess.target_filesearch(PathKind::All).get_lib_path();
// cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));

fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained: bool) {
// Special directory with libraries used only in self-contained linkage mode
if self_contained {
let _lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
// cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
}

// The default library location, we need this to find the runtime.
// The location of crates will be determined as needed.
// `copy_third_party_objects`
if sess.target.vendor == "fortanix" || sess.target.os == "linux" || sess.target.os == "fuchsia"
{
let lib_path = sess.target_filesearch(PathKind::Native).get_lib_path();
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
}
}

Expand Down

0 comments on commit 66a962e

Please sign in to comment.