File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1238,6 +1238,21 @@ impl Step for Compiletest {
12381238 . expect ( "Expected llvm-config to be contained in directory" ) ;
12391239 assert ! ( llvm_bin_path. is_dir( ) ) ;
12401240 cmd. arg ( "--llvm-bin-dir" ) . arg ( llvm_bin_path) ;
1241+
1242+ // If LLD is available, add it to the PATH
1243+ if builder. config . lld_enabled {
1244+ let lld_install_root = builder. ensure ( native:: Lld {
1245+ target : builder. config . build ,
1246+ } ) ;
1247+
1248+ let lld_bin_path = lld_install_root. join ( "bin" ) ;
1249+
1250+ let old_path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
1251+ let new_path = env:: join_paths ( std:: iter:: once ( lld_bin_path)
1252+ . chain ( env:: split_paths ( & old_path) ) )
1253+ . expect ( "Could not add LLD bin path to PATH" ) ;
1254+ cmd. env ( "PATH" , new_path) ;
1255+ }
12411256 }
12421257 }
12431258
You can’t perform that action at this time.
0 commit comments