Adjust PTXLinker LTO logic and CLI
This commit is contained in:
parent
8d53c9247c
commit
6f86a70ea1
@ -6,7 +6,7 @@ RUN apt-get install -y --no-install-recommends \
|
||||
cmake sudo gdb
|
||||
|
||||
# FIXME: setup `ptx-linker` CI for automatic binary releases.
|
||||
RUN curl -sL https://github.com/denzp/rust-ptx-linker/releases/download/v0.9.0-alpha/rust-ptx-linker.linux64.tar.gz | \
|
||||
RUN curl -sL https://github.com/denzp/rust-ptx-linker/releases/download/v0.9.0-alpha.1/rust-ptx-linker.linux64.tar.gz | \
|
||||
tar -xzvC /usr/bin
|
||||
|
||||
COPY scripts/sccache.sh /scripts/
|
||||
|
@ -13,7 +13,7 @@ use rustc::hir::def_id::{LOCAL_CRATE, CrateNum};
|
||||
use rustc::middle::dependency_format::Linkage;
|
||||
use rustc::session::Session;
|
||||
use rustc::session::config::{self, CrateType, OptLevel, DebugInfo,
|
||||
CrossLangLto};
|
||||
CrossLangLto, Lto};
|
||||
use rustc::ty::TyCtxt;
|
||||
use rustc_target::spec::{LinkerFlavor, LldFlavor};
|
||||
use serialize::{json, Encoder};
|
||||
@ -1118,14 +1118,13 @@ impl<'a> Linker for PtxLinker<'a> {
|
||||
}
|
||||
|
||||
fn optimize(&mut self) {
|
||||
self.cmd.arg(match self.sess.opts.optimize {
|
||||
OptLevel::No => "-O0",
|
||||
OptLevel::Less => "-O1",
|
||||
OptLevel::Default => "-O2",
|
||||
OptLevel::Aggressive => "-O3",
|
||||
OptLevel::Size => "-Os",
|
||||
OptLevel::SizeMin => "-Os"
|
||||
});
|
||||
match self.sess.lto() {
|
||||
Lto::Thin | Lto::Fat | Lto::ThinLocal => {
|
||||
self.cmd.arg("-Olto");
|
||||
},
|
||||
|
||||
Lto::No => { },
|
||||
};
|
||||
}
|
||||
|
||||
fn output_filename(&mut self, path: &Path) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user