Skip to content

Commit 3e759cf

Browse files
Auto merge of #142300 - jieyouxu:exp-partial-revert-141576, r=<try>
[EXPERIMENTAL] Revert `mte-ffi` changes Based on > > it failed on aarch64 (on the new aarch64-gnu-llvm-19-1 job introduced in this PR) > > This feature requires ARMv8.5 or higher. And it has to be enabled. Maybe the CI job runner does not support this extension? Let's revert the changes to this test in #141576. However, I can't explain why the test manages to *pass* on `aarch64-gnu` but not `aarch64-gnu-llvm-1` #141600. ### References - https://www.kernel.org/doc/html/v5.10/arm64/memory-tagging-extension.html try-job: aarch64-gnu
2 parents c83e217 + 1f9346c commit 3e759cf

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

tests/run-make/mte-ffi/bar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME(#141600) the mte-ffi test doesn't fail in aarch64-gnu
2-
31
#ifndef __BAR_H
42
#define __BAR_H
53

tests/run-make/mte-ffi/bar_float.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <stdint.h>
44
#include "bar.h"
55

6-
extern void foo(float*);
6+
extern void foo(char*);
77

8-
void bar(float *ptr) {
8+
void bar(char *ptr) {
99
if (((uintptr_t)ptr >> 56) != 0x1f) {
1010
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
1111
exit(1);

tests/run-make/mte-ffi/bar_int.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
extern void foo(unsigned int *);
77

8-
void bar(unsigned int *ptr) {
8+
void bar(char *ptr) {
99
if (((uintptr_t)ptr >> 56) != 0x1f) {
1010
fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
1111
exit(1);

tests/run-make/mte-ffi/bar_string.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33
#include <stdint.h>
4-
#include <string.h>
54
#include "bar.h"
65

76
extern void foo(char*);
@@ -33,7 +32,7 @@ int main(void)
3332

3433
// Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
3534
// and a different value in the ignored top 4 bits.
36-
ptr = (char *)((uintptr_t)ptr | 0x1fl << 56);
35+
ptr = (unsigned int *)((uintptr_t)ptr | 0x1fl << 56);
3736

3837
if (mte_enabled()) {
3938
set_tag(ptr);

tests/run-make/mte-ffi/rmake.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ fn main() {
1616
}
1717

1818
fn run_test(variant: &str) {
19+
let gcc_version =
20+
std::process::Command::new("aarch64-linux-gnu-gcc").arg("-v").output().unwrap();
21+
eprintln!("gcc_version: {}", String::from_utf8(gcc_version.stderr).unwrap());
22+
23+
let cpu_info =
24+
std::process::Command::new("lscpu").output().unwrap();
25+
eprintln!("lscpu: {}", String::from_utf8(cpu_info.stdout).unwrap());
26+
1927
let flags = {
2028
let mut flags = extra_c_flags();
2129
flags.push("-march=armv8.5-a+memtag");
@@ -30,4 +38,6 @@ fn run_test(variant: &str) {
3038
.args(&flags)
3139
.run();
3240
run("test");
41+
42+
panic!("[DEBUG] fail intentionally");
3343
}

0 commit comments

Comments
 (0)