@@ -9,7 +9,6 @@ use crate::Compiler;
9
9
use crate :: builder:: { Step , RunConfig , ShouldRun , Builder } ;
10
10
use crate :: util:: { exe, add_lib_path} ;
11
11
use crate :: compile;
12
- use crate :: native;
13
12
use crate :: channel:: GitInfo ;
14
13
use crate :: channel;
15
14
use crate :: cache:: Interned ;
@@ -698,56 +697,6 @@ impl<'a> Builder<'a> {
698
697
}
699
698
}
700
699
701
- // Add the llvm/bin directory to PATH since it contains lots of
702
- // useful, platform-independent tools
703
- if tool. uses_llvm_tools ( ) && !self . config . dry_run {
704
- let mut additional_paths = vec ! [ ] ;
705
-
706
- if let Some ( llvm_bin_path) = self . llvm_bin_path ( ) {
707
- additional_paths. push ( llvm_bin_path) ;
708
- }
709
-
710
- // If LLD is available, add that too.
711
- if self . config . lld_enabled {
712
- let lld_install_root = self . ensure ( native:: Lld {
713
- target : self . config . build ,
714
- } ) ;
715
-
716
- let lld_bin_path = lld_install_root. join ( "bin" ) ;
717
- additional_paths. push ( lld_bin_path) ;
718
- }
719
-
720
- if host. contains ( "windows" ) {
721
- // On Windows, PATH and the dynamic library path are the same,
722
- // so we just add the LLVM bin path to lib_path
723
- lib_paths. extend ( additional_paths) ;
724
- } else {
725
- let old_path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
726
- let new_path = env:: join_paths ( additional_paths. into_iter ( )
727
- . chain ( env:: split_paths ( & old_path) ) )
728
- . expect ( "Could not add LLVM bin path to PATH" ) ;
729
- cmd. env ( "PATH" , new_path) ;
730
- }
731
- }
732
-
733
700
add_lib_path ( lib_paths, cmd) ;
734
701
}
735
-
736
- fn llvm_bin_path ( & self ) -> Option < PathBuf > {
737
- if self . config . llvm_enabled ( ) {
738
- let llvm_config = self . ensure ( native:: Llvm {
739
- target : self . config . build ,
740
- emscripten : false ,
741
- } ) ;
742
-
743
- // Add the llvm/bin directory to PATH since it contains lots of
744
- // useful, platform-independent tools
745
- let llvm_bin_path = llvm_config. parent ( )
746
- . expect ( "Expected llvm-config to be contained in directory" ) ;
747
- assert ! ( llvm_bin_path. is_dir( ) ) ;
748
- Some ( llvm_bin_path. to_path_buf ( ) )
749
- } else {
750
- None
751
- }
752
- }
753
702
}
0 commit comments