File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,7 +212,8 @@ fn build_clif_sysroot_for_triple(
212212 }
213213
214214 // Build sysroot
215- let mut rustflags = vec ! [ "-Zforce-unstable-if-unmarked" . to_owned( ) ] ;
215+ let mut rustflags =
216+ vec ! [ "-Zforce-unstable-if-unmarked" . to_owned( ) , "-Cembed-bitcode=yes" . to_owned( ) ] ;
216217 if !panic_unwind_support {
217218 rustflags. push ( "-Cpanic=abort" . to_owned ( ) ) ;
218219 }
@@ -235,8 +236,6 @@ fn build_clif_sysroot_for_triple(
235236 rustflags. push ( "--remap-path-prefix" . to_owned ( ) ) ;
236237 rustflags. push ( format ! ( "library/={}/library" , prefix. to_str( ) . unwrap( ) ) ) ;
237238 }
238- rustflags. push ( "-Clto=thin" . to_owned ( ) ) ;
239- rustflags. push ( "-Zdylib-lto" . to_owned ( ) ) ;
240239 rustflags. push ( "-Cembed-bitcode=yes" . to_owned ( ) ) ;
241240 compiler. rustflags . extend ( rustflags) ;
242241 let mut build_cmd = STANDARD_LIBRARY . build ( & compiler, dirs) ;
@@ -254,7 +253,6 @@ fn build_clif_sysroot_for_triple(
254253 if env:: var_os ( "CARGO_BUILD_INCREMENTAL" ) . is_none ( ) {
255254 build_cmd. env ( "CARGO_BUILD_INCREMENTAL" , "true" ) ;
256255 }
257- build_cmd. env ( "CARGO_PROFILE_RELEASE_LTO" , "thin" ) ;
258256 spawn_and_wait ( build_cmd) ;
259257
260258 for entry in fs:: read_dir ( build_dir. join ( "build" ) )
Original file line number Diff line number Diff line change @@ -221,13 +221,17 @@ impl CodegenBackend for CraneliftCodegenBackend {
221221 #[ cfg( not( feature = "jit" ) ) ]
222222 tcx. dcx ( ) . fatal ( "jit support was disabled when compiling rustc_codegen_cranelift" ) ;
223223 } else {
224+ if tcx. sess . opts . cg . linker_plugin_lto . enabled ( ) {
225+ #[ cfg( feature = "lto" ) ]
226+ return driver:: lto:: run_lto ( tcx) ;
227+
228+ #[ cfg( not( feature = "lto" ) ) ]
229+ tcx. dcx ( ) . fatal ( "LTO support was disabled when compiling rustc_codegen_cranelift" ) ;
230+ }
231+
224232 match tcx. sess . lto ( ) {
225233 Lto :: No | Lto :: ThinLocal => driver:: aot:: run_aot ( tcx) ,
226234 Lto :: Thin | Lto :: Fat => {
227- if tcx. is_compiler_builtins ( LOCAL_CRATE ) {
228- return driver:: aot:: run_aot ( tcx) ;
229- }
230-
231235 #[ cfg( feature = "lto" ) ]
232236 return driver:: lto:: run_lto ( tcx) ;
233237
You can’t perform that action at this time.
0 commit comments