about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2025-01-24 10:48:53 -0500
committerAntoni Boucher <bouanto@zoho.com>2025-01-24 10:49:00 -0500
commitf24b0d358ac32af14994657865e1b4493550dc7a (patch)
tree13a4268aecd509d03aa0ac710c7aeba87743ab5e
parentbbc54734de5dc39200b31936308fb9c4069531d2 (diff)
downloadrust-f24b0d358ac32af14994657865e1b4493550dc7a.tar.gz
rust-f24b0d358ac32af14994657865e1b4493550dc7a.zip
Add comment to explain why CG_RUSTFLAGS is needed
-rw-r--r--build_system/src/build.rs2
-rw-r--r--build_system/src/config.rs2
2 files changed, 4 insertions, 0 deletions
diff --git a/build_system/src/build.rs b/build_system/src/build.rs
index d0ced211a61..a027c82a0b5 100644
--- a/build_system/src/build.rs
+++ b/build_system/src/build.rs
@@ -150,6 +150,8 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
         "debug"
     };
 
+    // We have a different environment variable than RUSTFLAGS to make sure those flags are only
+    // sent to rustc_codegen_gcc and not the LLVM backend.
     if let Ok(cg_rustflags) = std::env::var("CG_RUSTFLAGS") {
         rustflags.push(' ');
         rustflags.push_str(&cg_rustflags);
diff --git a/build_system/src/config.rs b/build_system/src/config.rs
index 37b4b68950e..f10eee2651a 100644
--- a/build_system/src/config.rs
+++ b/build_system/src/config.rs
@@ -381,6 +381,8 @@ impl ConfigInfo {
         }
 
         // This environment variable is useful in case we want to change options of rustc commands.
+        // We have a different environment variable than RUSTFLAGS to make sure those flags are
+        // only sent to rustc_codegen_gcc and not the LLVM backend.
         if let Some(cg_rustflags) = env.get("CG_RUSTFLAGS") {
             rustflags.extend_from_slice(&split_args(&cg_rustflags)?);
         }