about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-25 14:46:55 +0000
committerbors <bors@rust-lang.org>2024-09-25 14:46:55 +0000
commitb7fe0b42669d058d6e7a68dcfe521d0c118f432e (patch)
tree44279f0d4152309746c5f4e35d7216a0c8f206e2
parent4ef8f6011be0586a1452be503865aabc0f4d73b3 (diff)
parent897e94179763e5ec4cde76154abdf2a9392bef65 (diff)
downloadrust-b7fe0b42669d058d6e7a68dcfe521d0c118f432e.tar.gz
rust-b7fe0b42669d058d6e7a68dcfe521d0c118f432e.zip
Auto merge of #3915 - RalfJung:target-json-test, r=RalfJung
switch custom target JSON test to a less exotic target

We used to test an AVR target here, but while it is nice to test a 16bit target, it is also currently the case that rustc CI does not even check that libcore builds on a 16bit target -- and we don't want Miri to be in the game of maintaining that support. (See https://github.com/rust-lang/rust/issues/130818.)

So let's use a tier 2 target as the basis for testing a custom JSON target.

(FWIW, we also test wasm32-wasip2 which is tier 3, but I expect it will become tier 2 Soon-ish.)
-rwxr-xr-xsrc/tools/miri/ci/ci.sh3
-rw-r--r--src/tools/miri/tests/avr.json25
-rw-r--r--src/tools/miri/tests/x86_64-unknown-kernel.json24
3 files changed, 25 insertions, 27 deletions
diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh
index 1cbb78d8254..97f06dd9330 100755
--- a/src/tools/miri/ci/ci.sh
+++ b/src/tools/miri/ci/ci.sh
@@ -159,8 +159,7 @@ case $HOST_TARGET in
     TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
     TEST_TARGET=thumbv7em-none-eabihf  run_tests_minimal no_std
     # Custom target JSON file
-    # FIXME: disabled due to <https://github.com/rust-lang/rust/issues/130818>.
-    #TEST_TARGET=tests/avr.json MIRI_NO_STD=1 run_tests_minimal no_std
+    TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
     ;;
   i686-pc-windows-msvc)
     # Host
diff --git a/src/tools/miri/tests/avr.json b/src/tools/miri/tests/avr.json
deleted file mode 100644
index 1e00b0f57ef..00000000000
--- a/src/tools/miri/tests/avr.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
-  "arch": "avr",
-  "cpu": "atmega328p",
-  "data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
-  "env": "",
-  "executables": true,
-  "linker": "avr-gcc",
-  "linker-flavor": "gcc",
-  "linker-is-gnu": true,
-  "llvm-target": "avr-unknown-unknown",
-  "os": "unknown",
-  "position-independent-executables": false,
-  "exe-suffix": ".elf",
-  "eh-frame-header": false,
-  "pre-link-args": {
-    "gcc": ["-mmcu=atmega328p"]
-  },
-  "late-link-args": {
-    "gcc": ["-lgcc"]
-  },
-  "target-c-int-width": "16",
-  "target-endian": "little",
-  "target-pointer-width": "16",
-  "vendor": "unknown"
-}
diff --git a/src/tools/miri/tests/x86_64-unknown-kernel.json b/src/tools/miri/tests/x86_64-unknown-kernel.json
new file mode 100644
index 00000000000..8135b618d0d
--- /dev/null
+++ b/src/tools/miri/tests/x86_64-unknown-kernel.json
@@ -0,0 +1,24 @@
+{
+  "llvm-target": "x86_64-unknown-none",
+  "target-endian": "little",
+  "target-pointer-width": "64",
+  "target-c-int-width": "32",
+  "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
+  "arch": "x86_64",
+  "os": "none",
+  "env": "",
+  "vendor": "unknown",
+  "linker": "rust-lld",
+  "linker-flavor": "gnu-lld",
+  "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
+  "dynamic-linking": false,
+  "executables": true,
+  "relocation-model": "static",
+  "code-model": "kernel",
+  "disable-redzone": true,
+  "frame-pointer": "always",
+  "exe-suffix": "",
+  "has-rpath": false,
+  "no-default-libraries": true,
+  "position-independent-executables": false
+}