diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-03-30 12:59:40 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-04-20 13:21:40 +0200 |
| commit | d8bce01a04958337dc39b895655f8aa2e577b6d2 (patch) | |
| tree | 9e65e7563effc025a3e91e28618e791541d91c90 /src/librustc_codegen_ssa | |
| parent | 892c88b32f88777e9afcd3cdad6a0b2fa7ec526e (diff) | |
| download | rust-d8bce01a04958337dc39b895655f8aa2e577b6d2.tar.gz rust-d8bce01a04958337dc39b895655f8aa2e577b6d2.zip | |
Make link functions generic over archive builder
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/back/archive.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/librustc_codegen_ssa/back/archive.rs b/src/librustc_codegen_ssa/back/archive.rs index 0a16d1b03e2..cfe75b7b9bc 100644 --- a/src/librustc_codegen_ssa/back/archive.rs +++ b/src/librustc_codegen_ssa/back/archive.rs @@ -1,6 +1,7 @@ use rustc::session::Session; -use std::path::PathBuf; +use std::io; +use std::path::{Path, PathBuf}; pub fn find_library(name: &str, search_paths: &[PathBuf], sess: &Session) -> PathBuf { @@ -24,3 +25,17 @@ pub fn find_library(name: &str, search_paths: &[PathBuf], sess: &Session) sess.fatal(&format!("could not find native static library `{}`, \ perhaps an -L flag is missing?", name)); } + +pub trait ArchiveBuilder<'a> { + fn new(sess: &'a Session, output: &Path, input: Option<&Path>) -> Self; + + fn add_file(&mut self, path: &Path); + fn remove_file(&mut self, name: &str); + fn src_files(&mut self) -> Vec<String>; + + fn add_rlib(&mut self, path: &Path, name: &str, lto: bool, skip_objects: bool) -> io::Result<()>; + fn add_native_library(&mut self, name: &str); + fn update_symbols(&mut self); + + fn build(self); +} |
