File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -497,18 +497,13 @@ impl Step for Llvm {
497497
498498 // https://llvm.org/docs/HowToCrossCompileLLVM.html
499499 if target != builder. config . build {
500- builder. ensure ( Llvm { target : builder. config . build } ) ;
501- // FIXME: if the llvm root for the build triple is overridden then we
502- // should use llvm-tblgen from there, also should verify that it
503- // actually exists most of the time in normal installs of LLVM.
504- let host_bin = builder. llvm_out ( builder. config . build ) . join ( "bin" ) ;
500+ let llvm_config = builder. ensure ( Llvm { target : builder. config . build } ) ;
501+ let llvm_bindir = output ( Command :: new ( & llvm_config) . arg ( "--bindir" ) ) ;
502+ let host_bin = Path :: new ( llvm_bindir. trim ( ) ) ;
505503 cfg. define ( "LLVM_TABLEGEN" , host_bin. join ( "llvm-tblgen" ) . with_extension ( EXE_EXTENSION ) ) ;
506504 // LLVM_NM is required for cross compiling using MSVC
507505 cfg. define ( "LLVM_NM" , host_bin. join ( "llvm-nm" ) . with_extension ( EXE_EXTENSION ) ) ;
508- cfg. define (
509- "LLVM_CONFIG_PATH" ,
510- host_bin. join ( "llvm-config" ) . with_extension ( EXE_EXTENSION ) ,
511- ) ;
506+ cfg. define ( "LLVM_CONFIG_PATH" , llvm_config) ;
512507 if builder. config . llvm_clang {
513508 let build_bin = builder. llvm_out ( builder. config . build ) . join ( "build" ) . join ( "bin" ) ;
514509 let clang_tblgen = build_bin. join ( "clang-tblgen" ) . with_extension ( EXE_EXTENSION ) ;
You can’t perform that action at this time.
0 commit comments