Support linking from a .rlink file
Flag `-Z no-link` was previously introduced, which allows creating an `.rlink` file to perform compilation without linking. This change enables linking from an `.rlink` file.
This commit is contained in:
parent
fc07615c49
commit
a47fdb99c0
7 changed files with 57 additions and 8 deletions
|
@ -39,7 +39,7 @@ use syntax::expand::allocator::AllocatorKind;
|
|||
|
||||
use rustc::dep_graph::DepGraph;
|
||||
use rustc::middle::cstore::{EncodedMetadata, MetadataLoaderDyn};
|
||||
use rustc::session::config::{OptLevel, OutputFilenames, PrintRequest};
|
||||
use rustc::session::config::{self, OptLevel, OutputFilenames, PrintRequest};
|
||||
use rustc::session::Session;
|
||||
use rustc::ty::{self, TyCtxt};
|
||||
use rustc::util::common::ErrorReported;
|
||||
|
@ -308,7 +308,7 @@ impl CodegenBackend for LlvmCodegenBackend {
|
|||
let rlink_data = json::encode(&codegen_results).map_err(|err| {
|
||||
sess.fatal(&format!("failed to encode rlink: {}", err));
|
||||
})?;
|
||||
let rlink_file = outputs.with_extension("rlink");
|
||||
let rlink_file = outputs.with_extension(config::RLINK_EXT);
|
||||
fs::write(&rlink_file, rlink_data).map_err(|err| {
|
||||
sess.fatal(&format!("failed to write file {}: {}", rlink_file.display(), err));
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue