mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
tests/run-make: update mte-ffi
to use gcc
as the c compiler explicitly
This commit is contained in:
parent
98c771c187
commit
a6dac708f5
@ -1,7 +1,6 @@
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::command::Command;
|
use crate::command::Command;
|
||||||
use crate::env_var;
|
|
||||||
|
|
||||||
/// Construct a gcc invocation.
|
/// Construct a gcc invocation.
|
||||||
///
|
///
|
||||||
@ -23,15 +22,11 @@ crate::macros::impl_common_helpers!(Gcc);
|
|||||||
impl Gcc {
|
impl Gcc {
|
||||||
/// Construct a `gcc` invocation. This assumes that *a* suitable `gcc` is available in the
|
/// Construct a `gcc` invocation. This assumes that *a* suitable `gcc` is available in the
|
||||||
/// environment.
|
/// environment.
|
||||||
|
///
|
||||||
|
/// Note that this does **not** prepopulate the `gcc` invocation with `CC_DEFAULT_FLAGS`.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let mut cmd = Command::new("gcc");
|
let cmd = Command::new("gcc");
|
||||||
|
|
||||||
let default_cflags = env_var("CC_DEFAULT_FLAGS");
|
|
||||||
for flag in default_cflags.split(char::is_whitespace) {
|
|
||||||
cmd.arg(flag);
|
|
||||||
}
|
|
||||||
|
|
||||||
Self { cmd }
|
Self { cmd }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
// Tests that MTE tags and values stored in the top byte of a pointer (TBI) are
|
//! Tests that MTE tags and values stored in the top byte of a pointer (TBI) are preserved across
|
||||||
// preserved across FFI boundaries (C <-> Rust).
|
//! FFI boundaries (C <-> Rust). This test does not require MTE: whilst the test will use MTE if
|
||||||
// This test does not require MTE: whilst the test will use MTE if available, if it is not,
|
//! available, if it is not, arbitrary tag bits are set using TBI.
|
||||||
// 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
|
//@ 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() {
|
fn main() {
|
||||||
run_test("int");
|
run_test("int");
|
||||||
@ -29,7 +27,8 @@ fn run_test(variant: &str) {
|
|||||||
.target(target())
|
.target(target())
|
||||||
.linker("aarch64-linux-gnu-gcc")
|
.linker("aarch64-linux-gnu-gcc")
|
||||||
.run();
|
.run();
|
||||||
cc().input(format!("bar_{variant}.c"))
|
gcc()
|
||||||
|
.input(format!("bar_{variant}.c"))
|
||||||
.input(dynamic_lib_name("foo"))
|
.input(dynamic_lib_name("foo"))
|
||||||
.out_exe("test")
|
.out_exe("test")
|
||||||
.args(&flags)
|
.args(&flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user