File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,18 @@ impl Step for Llvm {
155
155
. define ( "WITH_POLLY" , "OFF" )
156
156
. define ( "LLVM_ENABLE_TERMINFO" , "OFF" )
157
157
. define ( "LLVM_ENABLE_LIBEDIT" , "OFF" )
158
- . define ( "LLVM_OCAML_INSTALL_PATH" , "usr/lib/ocaml" )
159
158
. define ( "LLVM_PARALLEL_COMPILE_JOBS" , build. jobs ( ) . to_string ( ) )
160
159
. define ( "LLVM_TARGET_ARCH" , target. split ( '-' ) . next ( ) . unwrap ( ) )
161
160
. define ( "LLVM_DEFAULT_TARGET_TRIPLE" , target) ;
162
161
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 ( ) ) ) ;
163
170
164
171
// This setting makes the LLVM tools link to the dynamic LLVM library,
165
172
// which saves both memory during parallel links and overall disk space
You can’t perform that action at this time.
0 commit comments