c-b: Clean up the mem feature

`mem` only enables the unmangled names; the functions are always
available via mangled names, so this doesn't have any purpose in our
tests. Thus, remove it from `builtins-test`.

The remaining `feature = "mem"` configuration in tests is for the
`aeabi_mem*` files, which call the compiler-builtins functions via
extern definitions. Move these to builtins-test-intrinsics, which is the
home of other tests that require unmangled symbols. Unfortunately these
tests have apparently not worked for a long time; this situation is
unchanged.
This commit is contained in:
Trevor Gross
2026-03-31 19:35:06 -04:00
parent 9a7c3e1607
commit 22579364d8
10 changed files with 17 additions and 44 deletions
-27
View File
@@ -155,9 +155,6 @@ dependencies = [
"paste",
"rand_xoshiro",
"rustc_apfloat",
"test",
"utest-cortex-m-qemu",
"utest-macros",
]
[[package]]
@@ -1084,12 +1081,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "sc"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "010e18bd3bfd1d45a7e666b236c78720df0d9a7698ebaa9c1c559961eb60a38b"
[[package]]
name = "semver"
version = "1.0.27"
@@ -1206,11 +1197,6 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"
[[package]]
name = "test"
version = "0.1.0"
source = "git+https://github.com/japaric/utest#e32073e2b078e3bee46001c13ae4c1acf368d762"
[[package]]
name = "tinytemplate"
version = "1.2.1"
@@ -1251,19 +1237,6 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3"
[[package]]
name = "utest-cortex-m-qemu"
version = "0.1.0"
source = "git+https://github.com/japaric/utest#e32073e2b078e3bee46001c13ae4c1acf368d762"
dependencies = [
"sc",
]
[[package]]
name = "utest-macros"
version = "0.1.0"
source = "git+https://github.com/japaric/utest#e32073e2b078e3bee46001c13ae4c1acf368d762"
[[package]]
name = "utf8parse"
version = "0.2.2"
@@ -54,7 +54,8 @@ no-asm = []
# when using as `std`'s dependency.'
compiler-builtins = ["unmangled-names"]
# Generate memory-related intrinsics like memcpy
# Enable `no_mangle` symbols for memory-related intrinsics like memcpy. The
# mangled versions are always available.
mem = []
# Enable `no_mangle` symbols so this crate gets used as the runtime intrinsic
@@ -6,9 +6,15 @@ publish = false
license = "MIT OR Apache-2.0"
[dependencies]
# FIXME: `aeabi_mem*` tests will require the "mem" feature to be enabled here.
compiler_builtins = { path = "../builtins-shim", features = ["compiler-builtins", "unmangled-names"] }
panic-handler = { path = "../crates/panic-handler" }
[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]
test = { git = "https://github.com/japaric/utest" }
utest-cortex-m-qemu = { default-features = false, git = "https://github.com/japaric/utest" }
utest-macros = { git = "https://github.com/japaric/utest" }
[features]
c = ["compiler_builtins/c"]
@@ -1,7 +1,9 @@
// By compiling this file we check that all the intrinsics we care about continue to be provided by
// the `compiler_builtins` crate regardless of the changes we make to it. If we, by mistake, stop
// compiling a C implementation and forget to implement that intrinsic in Rust, this file will fail
// to link due to the missing intrinsic (symbol).
//! Tests that require unmangled symbols from `compiler-builtins`.
//!
//! By compiling this file we check that all the intrinsics we care about continue to be provided by
//! the `compiler_builtins` crate regardless of the changes we make to it. If we, by mistake, stop
//! compiling a C implementation and forget to implement that intrinsic in Rust, this file will fail
//! to link due to the missing intrinsic (symbol).
#![allow(internal_features, unused_features)]
#![deny(dead_code)]
@@ -2,7 +2,6 @@
target_arch = "arm",
not(any(target_env = "gnu", target_env = "musl")),
target_os = "linux",
feature = "mem"
))]
#![feature(compiler_builtins_lib)]
#![no_std]
@@ -2,7 +2,6 @@
target_arch = "arm",
not(any(target_env = "gnu", target_env = "musl")),
target_os = "linux",
feature = "mem"
))]
#![feature(compiler_builtins_lib)]
#![no_std]
@@ -2,7 +2,6 @@
target_arch = "arm",
not(any(target_env = "gnu", target_env = "musl")),
target_os = "linux",
feature = "mem"
))]
#![feature(compiler_builtins_lib)]
#![no_std]
@@ -23,16 +23,10 @@ gungraun = { workspace = true, optional = true }
[dev-dependencies]
paste.workspace = true
[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]
test = { git = "https://github.com/japaric/utest" }
utest-cortex-m-qemu = { default-features = false, git = "https://github.com/japaric/utest" }
utest-macros = { git = "https://github.com/japaric/utest" }
[features]
default = []
c = ["compiler_builtins/c"]
no-asm = ["compiler_builtins/no-asm"]
mem = ["compiler_builtins/mem"]
# Skip tests that rely on f128 symbols being available on the system
no-sys-f128 = ["no-sys-f128-int-convert", "no-sys-f16-f128-convert"]
# Some platforms have some f128 functions but everything except integer conversions
@@ -49,8 +49,8 @@ no-asm = []
# when using as `std`'s dependency.'
compiler-builtins = ["dep:core", "unmangled-names"]
# Generate memory-related intrinsics like memcpy
mem = []
# Enable `no_mangle` symbols for memory-related intrinsics like memcpy. The
# mangled versions are always available.
# Enable `no_mangle` symbols so this crate gets used as the runtime intrinsic
# implementation. Leave this disabled for testing to avoid conflicting with
@@ -392,7 +392,7 @@ extern "aapcs" fn $alias( $($argname: $ty),* ) $(-> $ret)? {
intrinsics!($($rest)*);
);
// C mem* functions are only generated when the "mem" feature is enabled.
// C mem* functions are only exposed via `no_mangle` when the "mem" feature is enabled.
(
#[mem_builtin]
$(#[$($attr:tt)*])*