File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,14 @@ impl Step for Llvm {
159159 . define ( "LLVM_TARGET_ARCH" , target. split ( '-' ) . next ( ) . unwrap ( ) )
160160 . define ( "LLVM_DEFAULT_TARGET_TRIPLE" , target) ;
161161
162+ // By default, LLVM will automatically find OCaml and, if it finds it,
163+ // install the LLVM bindings in LLVM_OCAML_INSTALL_PATH, which defaults
164+ // to /usr/bin/ocaml.
165+ // This causes problem for non-root builds of Rust. Side-step the issue
166+ // by setting LLVM_OCAML_INSTALL_PATH to a relative path, so it installs
167+ // in the prefix.
168+ cfg. define ( "LLVM_OCAML_INSTALL_PATH" ,
169+ env:: var_os ( "LLVM_OCAML_INSTALL_PATH" ) . unwrap_or_else ( || "usr/lib/ocaml" . into ( ) ) ) ;
162170
163171 // This setting makes the LLVM tools link to the dynamic LLVM library,
164172 // which saves both memory during parallel links and overall disk space
You can’t perform that action at this time.
0 commit comments