Skip to content

[thumbv6m-none-eabi] LLVM ERROR: unsupported relocation on symbol #38406

Closed
@japaric

Description

@japaric

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.

cc @alexcrichton @thejpster

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions