File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,6 @@ fn build_clif_sysroot_for_triple(
245
245
prefix. to_str( ) . unwrap( )
246
246
) ) ;
247
247
}
248
- rustflags. push ( "-Clto=thin" . to_owned ( ) ) ;
249
- rustflags. push ( "-Zdylib-lto" . to_owned ( ) ) ;
250
248
rustflags. push ( "-Cembed-bitcode=yes" . to_owned ( ) ) ;
251
249
compiler. rustflags . extend ( rustflags) ;
252
250
let mut build_cmd = STANDARD_LIBRARY . build ( & compiler, dirs) ;
@@ -258,7 +256,6 @@ fn build_clif_sysroot_for_triple(
258
256
if compiler. triple . contains ( "apple" ) {
259
257
build_cmd. env ( "CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO" , "packed" ) ;
260
258
}
261
- build_cmd. env ( "CARGO_PROFILE_RELEASE_LTO" , "thin" ) ;
262
259
spawn_and_wait ( build_cmd) ;
263
260
264
261
for entry in fs:: read_dir ( build_dir. join ( "deps" ) ) . unwrap ( ) {
Original file line number Diff line number Diff line change @@ -240,13 +240,17 @@ impl CodegenBackend for CraneliftCodegenBackend {
240
240
#[ cfg( not( feature = "jit" ) ) ]
241
241
tcx. dcx ( ) . fatal ( "jit support was disabled when compiling rustc_codegen_cranelift" ) ;
242
242
} else {
243
+ if tcx. sess . opts . cg . linker_plugin_lto . enabled ( ) {
244
+ #[ cfg( feature = "lto" ) ]
245
+ return driver:: lto:: run_aot ( tcx) ;
246
+
247
+ #[ cfg( not( feature = "lto" ) ) ]
248
+ tcx. dcx ( ) . fatal ( "LTO support was disabled when compiling rustc_codegen_cranelift" ) ;
249
+ }
250
+
243
251
match tcx. sess . lto ( ) {
244
252
Lto :: No | Lto :: ThinLocal => driver:: aot:: run_aot ( tcx) ,
245
253
Lto :: Thin | Lto :: Fat => {
246
- if tcx. crate_name ( LOCAL_CRATE ) == sym:: compiler_builtins {
247
- return driver:: aot:: run_aot ( tcx) ;
248
- }
249
-
250
254
#[ cfg( feature = "lto" ) ]
251
255
return driver:: lto:: run_aot ( tcx) ;
252
256
You can’t perform that action at this time.
0 commit comments