From 3a5162b25598c41edd8f8fb5d70c67796590cc92 Mon Sep 17 00:00:00 2001 From: Ovidiu Sabou Date: Tue, 9 Feb 2021 23:09:10 +0200 Subject: [PATCH] Fix rust-lld: error: undefined symbol: __syscall Encountered while building an example from stm32-rs/stm32f3xx-hal --- cortex-m-semihosting/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cortex-m-semihosting/src/lib.rs b/cortex-m-semihosting/src/lib.rs index 05455cea..a67b84d8 100644 --- a/cortex-m-semihosting/src/lib.rs +++ b/cortex-m-semihosting/src/lib.rs @@ -194,7 +194,7 @@ pub mod nr; #[cfg(all(thumb, not(feature = "inline-asm")))] extern "C" { - fn __syscall(nr: usize, arg: usize) -> usize; + fn __sh_syscall(nr: usize, arg: usize) -> usize; } /// Performs a semihosting operation, takes a pointer to an argument block @@ -208,7 +208,7 @@ pub unsafe fn syscall(nr: usize, arg: &T) -> usize { pub unsafe fn syscall1(_nr: usize, _arg: usize) -> usize { match () { #[cfg(all(thumb, not(feature = "inline-asm"), not(feature = "no-semihosting")))] - () => __syscall(_nr, _arg), + () => __sh_syscall(_nr, _arg), #[cfg(all(thumb, feature = "inline-asm", not(feature = "no-semihosting")))] () => {