Skip to content

Commit fc210a8

Browse files
committed
Make rust build pass LLVM_RUSTLLVM to C++ compiler
1 parent ce50bed commit fc210a8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/bootstrap/compile.rs

+4
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
199199
if !build.unstable_features {
200200
cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1");
201201
}
202+
// Flag that rust llvm is in use
203+
if build.config.target_config.get(target).is_none() {
204+
cargo.env("LLVM_RUSTLLVM", "1");
205+
}
202206
cargo.env("LLVM_CONFIG", build.llvm_config(target));
203207
if build.config.llvm_static_stdcpp {
204208
cargo.env("LLVM_STATIC_STDCPP",

src/librustc_llvm/build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ fn main() {
112112
cfg.flag(&flag);
113113
}
114114

115+
if env::var_os("LLVM_RUSTLLVM").is_some() {
116+
cfg.flag("-DLLVM_RUSTLLVM");
117+
}
118+
115119
cfg.file("../rustllvm/ExecutionEngineWrapper.cpp")
116120
.file("../rustllvm/PassWrapper.cpp")
117121
.file("../rustllvm/RustWrapper.cpp")

0 commit comments

Comments
 (0)