rust-lang / rust-lang/rust

Aarch64 broken with gcc not supporting --fix-cortex-a53-843419 linker flag

Open
#161,486 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-prioritize needs-triage regression-untriaged
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

It seams that rustc since 1.98 has hard coded pre-link-args like this, that breaks building with ld.bfd of gcc 4.9.4

"pre-link-args": {
    "gcc": [
        "-Wl,--fix-cortex-a53-843419"
    ]
}

It is not possible to get rid of this error with -mno-fix-cortex-a53-843419.

This regression comes from #155453

Code

I tried this code:

<code>

I expected to see this happen: regular linking

Instead, this happened: aarch64-unknown-linux-gnueabi/bin/ld.bfd: unrecognized option '--fix-cortex-a53-843419'

Version it worked on

It most recently worked on: 1.97.1

Version with regression

rustc --version --verbose:

1.98
Backtrace
Backtrace

<backtrace>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the pre-link-args handling introduced by #155453 and reproduce the failure with the aarch64-unknown-linux-gnueabi target, ld.bfd, and GCC 4.9.4. The fix is done when Rust 1.98-era linking no longer passes the unsupported --fix-cortex-a53-843419 flag to that linker while supported AArch64 linking remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.