about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/run-make-support/src/external_deps/c_cxx_compiler/gcc.rs11
-rw-r--r--tests/run-make/mte-ffi/rmake.rs17
2 files changed, 11 insertions, 17 deletions
diff --git a/src/tools/run-make-support/src/external_deps/c_cxx_compiler/gcc.rs b/src/tools/run-make-support/src/external_deps/c_cxx_compiler/gcc.rs
index 8bc82a1c676..e02c4f97255 100644
--- a/src/tools/run-make-support/src/external_deps/c_cxx_compiler/gcc.rs
+++ b/src/tools/run-make-support/src/external_deps/c_cxx_compiler/gcc.rs
@@ -1,7 +1,6 @@
 use std::path::Path;
 
 use crate::command::Command;
-use crate::env_var;
 
 /// Construct a gcc invocation.
 ///
@@ -23,15 +22,11 @@ crate::macros::impl_common_helpers!(Gcc);
 impl Gcc {
     /// Construct a `gcc` invocation. This assumes that *a* suitable `gcc` is available in the
     /// environment.
+    ///
+    /// Note that this does **not** prepopulate the `gcc` invocation with `CC_DEFAULT_FLAGS`.
     #[track_caller]
     pub fn new() -> Self {
-        let mut cmd = Command::new("gcc");
-
-        let default_cflags = env_var("CC_DEFAULT_FLAGS");
-        for flag in default_cflags.split(char::is_whitespace) {
-            cmd.arg(flag);
-        }
-
+        let cmd = Command::new("gcc");
         Self { cmd }
     }
 
diff --git a/tests/run-make/mte-ffi/rmake.rs b/tests/run-make/mte-ffi/rmake.rs
index f4fafb796e3..50f5f14191b 100644
--- a/tests/run-make/mte-ffi/rmake.rs
+++ b/tests/run-make/mte-ffi/rmake.rs
@@ -1,14 +1,12 @@
-// Tests that MTE tags and values stored in the top byte of a pointer (TBI) are
-// preserved across FFI boundaries (C <-> Rust).
-// This test does not require MTE: whilst the test will use MTE if available, if it is not,
-// arbitrary tag bits are set using TBI.
+//! Tests that MTE tags and values stored in the top byte of a pointer (TBI) are preserved across
+//! FFI boundaries (C <-> Rust). This test does not require MTE: whilst the test will use MTE if
+//! available, if it is not, arbitrary tag bits are set using TBI.
 
-// This test is only valid for AArch64.
-// The linker must be explicitly specified when cross-compiling, so it is limited to
-// `aarch64-unknown-linux-gnu`.
 //@ only-aarch64-unknown-linux-gnu
+// Reason: this test is only valid for AArch64 with `gcc`. The linker must be explicitly specified
+// when cross-compiling, so it is limited to `aarch64-unknown-linux-gnu`.
 
-use run_make_support::{cc, dynamic_lib_name, extra_c_flags, run, rustc, target};
+use run_make_support::{dynamic_lib_name, extra_c_flags, gcc, run, rustc, target};
 
 fn main() {
     run_test("int");
@@ -29,7 +27,8 @@ fn run_test(variant: &str) {
         .target(target())
         .linker("aarch64-linux-gnu-gcc")
         .run();
-    cc().input(format!("bar_{variant}.c"))
+    gcc()
+        .input(format!("bar_{variant}.c"))
         .input(dynamic_lib_name("foo"))
         .out_exe("test")
         .args(&flags)