File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,8 @@ fn build_clif_sysroot_for_triple(
216
216
}
217
217
218
218
// Build sysroot
219
- let mut rustflags = vec ! [ "-Zforce-unstable-if-unmarked" . to_owned( ) ] ;
219
+ let mut rustflags =
220
+ vec ! [ "-Zforce-unstable-if-unmarked" . to_owned( ) , "-Cembed-bitcode=yes" . to_owned( ) ] ;
220
221
if !panic_unwind_support {
221
222
rustflags. push ( "-Cpanic=abort" . to_owned ( ) ) ;
222
223
}
@@ -245,8 +246,6 @@ fn build_clif_sysroot_for_triple(
245
246
prefix. to_str( ) . unwrap( )
246
247
) ) ;
247
248
}
248
- rustflags. push ( "-Clto=thin" . to_owned ( ) ) ;
249
- rustflags. push ( "-Zdylib-lto" . to_owned ( ) ) ;
250
249
rustflags. push ( "-Cembed-bitcode=yes" . to_owned ( ) ) ;
251
250
compiler. rustflags . extend ( rustflags) ;
252
251
let mut build_cmd = STANDARD_LIBRARY . build ( & compiler, dirs) ;
@@ -258,7 +257,6 @@ fn build_clif_sysroot_for_triple(
258
257
if compiler. triple . contains ( "apple" ) {
259
258
build_cmd. env ( "CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO" , "packed" ) ;
260
259
}
261
- build_cmd. env ( "CARGO_PROFILE_RELEASE_LTO" , "thin" ) ;
262
260
spawn_and_wait ( build_cmd) ;
263
261
264
262
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