Skip to content

Upgrade the crosstool for the loongarch64-unknown-linux-gnu target #1538

Closed
@heiher

Description

@heiher

Checklist

Describe your issue

In this example, the LoongArch compiler generates an R_LARCH_64_PCREL relocation for 1b - .. Unfortunately, older binutils linker does not support R_LARCH_64_PCREL and merely issue a warning instead of failing, leading to incorrect values in the linked executable.

fn main() {
    unsafe {
        core::arch::asm!(
            r#"
            1:
            nop
            .pushsection jump_table,  "awR"
            .balign 8
            .quad 1b - .
            .popsection
            "#
        );
    }
}

What target(s) are you cross-compiling for?

loongarch64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5 (7b79041 2024-07-11)

Example

cross build --target=loongarch64-unknown-linux-gnu

Additional information / notes

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions