@@ -395,24 +395,31 @@ path = "{intrinsic}/main.rs""#,
395
395
/* If there has been a linker explicitly set from the command line then
396
396
* we want to set it via setting it in the RUSTFLAGS*/
397
397
let mut rust_flags = "-Cdebuginfo=0" . to_string ( ) ;
398
- if let Some ( linker) = linker {
399
- rust_flags. push_str ( " -Clinker=" ) ;
400
- rust_flags. push_str ( linker) ;
401
- rust_flags. push_str ( " -Clink-args=-static" ) ;
402
- }
403
398
404
399
let cargo_command = format ! (
405
400
"cargo {toolchain} build --target {target} --release" ,
406
401
toolchain = toolchain,
407
402
target = target
408
403
) ;
409
404
410
- let output = Command :: new ( "sh" )
405
+ let mut command = Command :: new ( "sh" ) ;
406
+
407
+ command
411
408
. current_dir ( "rust_programs" )
412
409
. arg ( "-c" )
413
- . arg ( cargo_command)
414
- . env ( "RUSTFLAGS" , rust_flags)
415
- . output ( ) ;
410
+ . arg ( cargo_command) ;
411
+
412
+ if let Some ( linker) = linker {
413
+ rust_flags. push_str ( " -C linker=" ) ;
414
+ rust_flags. push_str ( linker) ;
415
+ rust_flags. push_str ( " -C link-args=-static" ) ;
416
+
417
+ command. env ( "CPPFLAGS" , "-fuse-ld=lld" ) ;
418
+ }
419
+
420
+ command. env ( "RUSTFLAGS" , rust_flags) ;
421
+ let output = command. output ( ) ;
422
+
416
423
if let Ok ( output) = output {
417
424
if output. status . success ( ) {
418
425
true
0 commit comments