@@ -21,7 +21,7 @@ use serde::Deserialize;
21
21
use crate :: builder:: Cargo ;
22
22
use crate :: builder:: { Builder , Kind , RunConfig , ShouldRun , Step } ;
23
23
use crate :: cache:: { Interned , INTERNER } ;
24
- use crate :: config:: { LlvmLibunwind , RustcLto , TargetSelection } ;
24
+ use crate :: config:: { LlvmLibunwind , TargetSelection } ;
25
25
use crate :: dist;
26
26
use crate :: native;
27
27
use crate :: tool:: SourceType ;
@@ -702,7 +702,7 @@ impl Step for Rustc {
702
702
}
703
703
704
704
// cfg(bootstrap): remove if condition once the bootstrap compiler supports dylib LTO
705
- if compiler. stage != 0 {
705
+ /* if compiler.stage != 0 {
706
706
match builder.config.rust_lto {
707
707
RustcLto::Thin | RustcLto::Fat => {
708
708
// Since using LTO for optimizing dylibs is currently experimental,
@@ -721,6 +721,22 @@ impl Step for Rustc {
721
721
}
722
722
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
723
723
}
724
+ }*/
725
+
726
+ if compiler. stage == 1 {
727
+ // let build_bin = builder.llvm_out(builder.config.build).join("build").join("bin");
728
+ // let clang = build_bin.join("clang");
729
+ // let clang = PathBuf::from("/projects/personal/llvm-project/build/install/bin/clang");
730
+ cargo. rustflag ( "-Clinker-plugin-lto" ) ;
731
+ // cargo.rustflag(&format!("-Clinker={}", clang.display()));
732
+ // cargo.rustflag("-Clink-arg=-fuse-ld=lld");
733
+
734
+ // let path = builder.ensure(CrtBeginEnd {
735
+ // target
736
+ // });
737
+ // cargo.rustflag(&format!("-Clink-args=-L{}", path.display()));
738
+ // cargo.rustflag(&format!("-Clink-args=-B{}", path.display()));
739
+ // cargo.rustflag(&format!("-Clink-args=--gcc-toolchain={}", path.display()));
724
740
}
725
741
726
742
builder. info ( & format ! (
0 commit comments