@@ -971,7 +971,7 @@ impl Step for Compiletest {
971
971
972
972
// Only pass correct values for these flags for the `run-make` suite as it
973
973
// requires that a C++ compiler was configured which isn't always the case.
974
- if !builder. config . dry_run && suite == "run-make-fulldeps " {
974
+ if !builder. config . dry_run && mode == "run-make" {
975
975
let llvm_components = output ( Command :: new ( & llvm_config) . arg ( "--components" ) ) ;
976
976
let llvm_cxxflags = output ( Command :: new ( & llvm_config) . arg ( "--cxxflags" ) ) ;
977
977
cmd. arg ( "--cc" ) . arg ( builder. cc ( target) )
@@ -982,15 +982,26 @@ impl Step for Compiletest {
982
982
if let Some ( ar) = builder. ar ( target) {
983
983
cmd. arg ( "--ar" ) . arg ( ar) ;
984
984
}
985
+
986
+ // Add the llvm/bin directory to PATH since it contains lots of
987
+ // useful, platform-independent tools
988
+ let llvm_bin_path = llvm_config. parent ( )
989
+ . expect ( "Expected llvm-config to be contained in directory" ) ;
990
+ assert ! ( llvm_bin_path. is_dir( ) ) ;
991
+ let old_path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
992
+ let new_path = env:: join_paths ( iter:: once ( llvm_bin_path. to_path_buf ( ) )
993
+ . chain ( env:: split_paths ( & old_path) ) )
994
+ . expect ( "" ) ;
995
+ cmd. env ( "PATH" , new_path) ;
985
996
}
986
997
}
987
- if suite == "run-make-fulldeps " && !builder. config . llvm_enabled {
998
+ if mode == "run-make" && !builder. config . llvm_enabled {
988
999
builder. info (
989
1000
& format ! ( "Ignoring run-make test suite as they generally don't work without LLVM" ) ) ;
990
1001
return ;
991
1002
}
992
1003
993
- if suite != "run-make-fulldeps " {
1004
+ if mode != "run-make" {
994
1005
cmd. arg ( "--cc" ) . arg ( "" )
995
1006
. arg ( "--cxx" ) . arg ( "" )
996
1007
. arg ( "--cflags" ) . arg ( "" )
0 commit comments