Skip to content

Commit

Permalink
Merge #330
Browse files Browse the repository at this point in the history
330: Fix rust-lld: error: undefined symbol: __syscall r=jonas-schievink a=ovidiusabou

Encountered while building an example from stm32-rs/stm32f3xx-hal

Co-authored-by: Ovidiu Sabou <ovidiu@sabou.org>
  • Loading branch information
bors[bot] and ovidiusabou committed Feb 9, 2021
2 parents 2281fd6 + 3a5162b commit 7481f09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cortex-m-semihosting/src/lib.rs
Expand Up @@ -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
Expand All @@ -208,7 +208,7 @@ pub unsafe fn syscall<T>(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")))]
() => {
Expand Down

0 comments on commit 7481f09

Please sign in to comment.