Skip to content

Commit f24b0d3

Browse files
committed
Add comment to explain why CG_RUSTFLAGS is needed
1 parent bbc5473 commit f24b0d3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

build_system/src/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
150150
"debug"
151151
};
152152

153+
// We have a different environment variable than RUSTFLAGS to make sure those flags are only
154+
// sent to rustc_codegen_gcc and not the LLVM backend.
153155
if let Ok(cg_rustflags) = std::env::var("CG_RUSTFLAGS") {
154156
rustflags.push(' ');
155157
rustflags.push_str(&cg_rustflags);

build_system/src/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ impl ConfigInfo {
381381
}
382382

383383
// This environment variable is useful in case we want to change options of rustc commands.
384+
// We have a different environment variable than RUSTFLAGS to make sure those flags are
385+
// only sent to rustc_codegen_gcc and not the LLVM backend.
384386
if let Some(cg_rustflags) = env.get("CG_RUSTFLAGS") {
385387
rustflags.extend_from_slice(&split_args(&cg_rustflags)?);
386388
}

0 commit comments

Comments
 (0)