Warn when using LTO
This commit is contained in:
parent
aa5c49cf2f
commit
a3f378754b
1 changed files with 5 additions and 1 deletions
|
@ -162,7 +162,11 @@ impl<'clif, 'tcx, B: Backend + 'static> CodegenCx<'clif, 'tcx, B> {
|
||||||
struct CraneliftCodegenBackend;
|
struct CraneliftCodegenBackend;
|
||||||
|
|
||||||
impl CodegenBackend for CraneliftCodegenBackend {
|
impl CodegenBackend for CraneliftCodegenBackend {
|
||||||
fn init(&self, _sess: &Session) {}
|
fn init(&self, sess: &Session) {
|
||||||
|
if sess.lto() != rustc_session::config::Lto::No {
|
||||||
|
sess.warn("LTO is not supported. You may get a linker error.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
|
fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync> {
|
||||||
Box::new(crate::metadata::CraneliftMetadataLoader)
|
Box::new(crate::metadata::CraneliftMetadataLoader)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue