Skip to content

Commit 6d63072

Browse files
committed
Separating the back folder between backend-agnostic and LLVM-specific code
1 parent b2c66a2 commit 6d63072

30 files changed

+3079
-2763
lines changed

src/Cargo.lock

+14
Original file line numberDiff line numberDiff line change
@@ -2132,10 +2132,24 @@ dependencies = [
21322132
name = "rustc_codegen_ssa"
21332133
version = "0.0.0"
21342134
dependencies = [
2135+
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
2136+
"cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
2137+
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
2138+
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
2139+
"memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
2140+
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
21352141
"rustc 0.0.0",
2142+
"rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
2143+
"rustc_allocator 0.0.0",
2144+
"rustc_apfloat 0.0.0",
2145+
"rustc_codegen_utils 0.0.0",
21362146
"rustc_data_structures 0.0.0",
2147+
"rustc_errors 0.0.0",
2148+
"rustc_fs_util 0.0.0",
2149+
"rustc_incremental 0.0.0",
21372150
"rustc_mir 0.0.0",
21382151
"rustc_target 0.0.0",
2152+
"serialize 0.0.0",
21392153
"syntax 0.0.0",
21402154
"syntax_pos 0.0.0",
21412155
]

src/librustc_codegen_llvm/back/archive.rs

+1-23
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use std::ptr;
1818
use std::str;
1919

2020
use back::bytecode::RLIB_BYTECODE_EXTENSION;
21+
use rustc_codegen_ssa::back::archive::find_library;
2122
use libc;
2223
use llvm::archive_ro::{ArchiveRO, Child};
2324
use llvm::{self, ArchiveKind};
@@ -52,29 +53,6 @@ enum Addition {
5253
},
5354
}
5455

55-
pub fn find_library(name: &str, search_paths: &[PathBuf], sess: &Session)
56-
-> PathBuf {
57-
// On Windows, static libraries sometimes show up as libfoo.a and other
58-
// times show up as foo.lib
59-
let oslibname = format!("{}{}{}",
60-
sess.target.target.options.staticlib_prefix,
61-
name,
62-
sess.target.target.options.staticlib_suffix);
63-
let unixlibname = format!("lib{}.a", name);
64-
65-
for path in search_paths {
66-
debug!("looking for {} inside {:?}", name, path);
67-
let test = path.join(&oslibname);
68-
if test.exists() { return test }
69-
if oslibname != unixlibname {
70-
let test = path.join(&unixlibname);
71-
if test.exists() { return test }
72-
}
73-
}
74-
sess.fatal(&format!("could not find native static library `{}`, \
75-
perhaps an -L flag is missing?", name));
76-
}
77-
7856
fn is_relevant_child(c: &Child) -> bool {
7957
match c.name() {
8058
Some(name) => !name.contains("SYMDEF"),

0 commit comments

Comments
 (0)