Closed
Description
STR
$ cargo new --bin app && cd $_
$ edit src/main.rs && cat $_
#![feature(asm)]
#![feature(lang_items)]
#![no_main]
#![no_std]
#[no_mangle]
pub fn _start() -> ! {
unsafe {
asm!("b foo");
}
loop {}
}
#[no_mangle]
pub fn foo() {}
#[lang = "panic_fmt"]
fn panic_fmt() {}
#[no_mangle]
pub fn __aeabi_unwind_cpp_pr0() {}
# Instead of Xargo, you could explicitly depend on (rust-src's) core and just use Cargo
$ xargo rustc --target thumbv6m-none-eabi --verbose -- -C link-arg=-nostartfiles
Compiling app v0.1.0 (file:///home/japaric/tmp/app)
LLVM ERROR: unsupported relocation on symbol
error: Could not compile `app`.
To learn more, run the command again with --verbose.
Works fine with thumbv7m-none-eabi
:
$ xargo rustc --target thumbv7m-none-eabi --verbose -- -C link-arg=-nostartfiles && echo OK
OK
This is a bug in LLVM (30279) that has already been fixed in r280651. We only have to backport the fix.