diff --git a/crates/spirv-builder/src/lib.rs b/crates/spirv-builder/src/lib.rs index 8253884d0f..38f10cc62b 100644 --- a/crates/spirv-builder/src/lib.rs +++ b/crates/spirv-builder/src/lib.rs @@ -247,8 +247,8 @@ fn invoke_rustc(builder: &SpirvBuilder, multimodule: bool) -> Result) -> ! { #[cfg(all(not(test), target_arch = "spirv"))] #[lang = "eh_personality"] extern "C" fn rust_eh_personality() {} - -/// libcore requires a few external symbols to be defined: -/// -/// TODO: This is copied from `compiler_builtins/mem.rs`. Can we use that one instead? The note in the above link says -/// "[the symbols] can also be provided by the compiler-builtins crate". The memcpy in `compiler_builtins` is behind a -/// "mem" feature flag - can we enable that somehow? -/// -#[allow(clippy::missing_safety_doc)] -#[no_mangle] -pub unsafe extern "C" fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 { - let mut i = 0; - while i < n { - let a = *s1.add(i); - let b = *s2.add(i); - if a != b { - return a as i32 - b as i32; - } - i += 1; - } - 0 -} diff --git a/tests/src/main.rs b/tests/src/main.rs index 59f1d6c3f2..a412a79cd5 100644 --- a/tests/src/main.rs +++ b/tests/src/main.rs @@ -174,6 +174,7 @@ fn build_deps(deps_target_dir: &Path, codegen_backend_path: &Path, target: &str) "-p", "compiletests-deps-helper", "-Zbuild-std=core", + "-Zbuild-std-features=compiler-builtins-mem", &*format!("--target={}", target), ]) .arg("--target-dir")