Skip to content

Commit a6dac70

Browse files
committed
tests/run-make: update mte-ffi to use gcc as the c compiler explicitly
1 parent 98c771c commit a6dac70

File tree

2 files changed

+11
-17
lines changed
  • src/tools/run-make-support/src/external_deps/c_cxx_compiler
  • tests/run-make/mte-ffi

2 files changed

+11
-17
lines changed

Diff for: src/tools/run-make-support/src/external_deps/c_cxx_compiler/gcc.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::path::Path;
22

33
use crate::command::Command;
4-
use crate::env_var;
54

65
/// Construct a gcc invocation.
76
///
@@ -23,15 +22,11 @@ crate::macros::impl_common_helpers!(Gcc);
2322
impl Gcc {
2423
/// Construct a `gcc` invocation. This assumes that *a* suitable `gcc` is available in the
2524
/// environment.
25+
///
26+
/// Note that this does **not** prepopulate the `gcc` invocation with `CC_DEFAULT_FLAGS`.
2627
#[track_caller]
2728
pub fn new() -> Self {
28-
let mut cmd = Command::new("gcc");
29-
30-
let default_cflags = env_var("CC_DEFAULT_FLAGS");
31-
for flag in default_cflags.split(char::is_whitespace) {
32-
cmd.arg(flag);
33-
}
34-
29+
let cmd = Command::new("gcc");
3530
Self { cmd }
3631
}
3732

Diff for: tests/run-make/mte-ffi/rmake.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
// Tests that MTE tags and values stored in the top byte of a pointer (TBI) are
2-
// preserved across FFI boundaries (C <-> Rust).
3-
// This test does not require MTE: whilst the test will use MTE if available, if it is not,
4-
// arbitrary tag bits are set using TBI.
1+
//! Tests that MTE tags and values stored in the top byte of a pointer (TBI) are preserved across
2+
//! FFI boundaries (C <-> Rust). This test does not require MTE: whilst the test will use MTE if
3+
//! available, if it is not, arbitrary tag bits are set using TBI.
54
6-
// This test is only valid for AArch64.
7-
// The linker must be explicitly specified when cross-compiling, so it is limited to
8-
// `aarch64-unknown-linux-gnu`.
95
//@ only-aarch64-unknown-linux-gnu
6+
// Reason: this test is only valid for AArch64 with `gcc`. The linker must be explicitly specified
7+
// when cross-compiling, so it is limited to `aarch64-unknown-linux-gnu`.
108

11-
use run_make_support::{cc, dynamic_lib_name, extra_c_flags, run, rustc, target};
9+
use run_make_support::{dynamic_lib_name, extra_c_flags, gcc, run, rustc, target};
1210

1311
fn main() {
1412
run_test("int");
@@ -29,7 +27,8 @@ fn run_test(variant: &str) {
2927
.target(target())
3028
.linker("aarch64-linux-gnu-gcc")
3129
.run();
32-
cc().input(format!("bar_{variant}.c"))
30+
gcc()
31+
.input(format!("bar_{variant}.c"))
3332
.input(dynamic_lib_name("foo"))
3433
.out_exe("test")
3534
.args(&flags)

0 commit comments

Comments
 (0)