Skip to content

rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu#153537

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
taiki-e:ef-sparc-32plus
Apr 24, 2026
Merged

rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu#153537
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
taiki-e:ef-sparc-32plus

Conversation

@taiki-e
Copy link
Copy Markdown
Member

@taiki-e taiki-e commented Mar 7, 2026

Currently, attempting to build this target using Ubuntu/Debian's sparc64-multilib toolchain results in the following link error (full log):

  = note: /usr/lib/gcc-cross/sparc64-linux-gnu/13/../../../../sparc64-linux-gnu/bin/ld: unknown architecture of input file `/home/runner/work/atomic-maybe-uninit/atomic-maybe-uninit/target/sparc-unknown-linux-gnu/debug/deps/rustcYzaDYW/symbols.o' is incompatible with sparc:v8plus output

This appears to be caused by the required e_flag being missing and can be fixed by setting EF_SPARC_32PLUS.

Tested using rustc with this patch applied and qemu-user (taiki-e/atomic-maybe-uninit@57d7e7f, log).

Related discussion: #131222 (comment)

r? workingjubilee
cc @glaubitz

@rustbot label +O-SPARC

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 7, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 7, 2026

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@glaubitz
Copy link
Copy Markdown
Contributor

glaubitz commented Mar 7, 2026

Looks good to me, but I would prefer a commit message that reflects the actual change, i.e.:

rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu

Thanks for fixing this!

@taiki-e taiki-e changed the title Fix link failure on sparc-unknown-linux-gnu rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu Mar 7, 2026
@taiki-e
Copy link
Copy Markdown
Member Author

taiki-e commented Mar 7, 2026

@glaubitz Thanks for the review. I updated commit message based on your suggestion.

@glaubitz
Copy link
Copy Markdown
Contributor

glaubitz commented Mar 7, 2026

Thanks a lot! I appreciate contributions to the SPARC backend very much!

There is real SPARC hardware available for testing in the GCC compile farm.

@wesleywiser
Copy link
Copy Markdown
Member

Thanks @taiki-e and also @glaubitz for reviewing the fix!

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

📌 Commit e0d9940 has been approved by wesleywiser

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149452 (Refactor out common code into a `IndexItem::new` constructor)
 - #155621 (Document #[diagnostic::on_move] in the unstable book.)
 - #155635 (delegation: rename `Self` generic param to `This` in recursive delegations)
 - #155730 (Some cleanups around per parent disambiguators)
 - #153537 (rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu)
 - #155219 (Do not suggest borrowing enclosing calls for nested where-clause obligations)
 - #155408 (rustdoc: Fix Managarm C Library name in cfg pretty printer)
 - #155571 (Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf)
 - #155713 (test: Add a regression test for Apple platforms aborting on `free`)
 - #155723 (Fix tier level for 5 thumb bare-metal ARM targets)
 - #155735 (Fix typo by removing extra 'to')
 - #155736 (Remove `AllVariants` workaround for rust-analyzer)
rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149452 (Refactor out common code into a `IndexItem::new` constructor)
 - #155621 (Document #[diagnostic::on_move] in the unstable book.)
 - #155635 (delegation: rename `Self` generic param to `This` in recursive delegations)
 - #155730 (Some cleanups around per parent disambiguators)
 - #153537 (rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu)
 - #155219 (Do not suggest borrowing enclosing calls for nested where-clause obligations)
 - #155408 (rustdoc: Fix Managarm C Library name in cfg pretty printer)
 - #155571 (Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf)
 - #155713 (test: Add a regression test for Apple platforms aborting on `free`)
 - #155723 (Fix tier level for 5 thumb bare-metal ARM targets)
 - #155735 (Fix typo by removing extra 'to')
 - #155736 (Remove `AllVariants` workaround for rust-analyzer)
@rust-bors rust-bors Bot merged commit 08571af into rust-lang:main Apr 24, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 24, 2026
rust-timer added a commit that referenced this pull request Apr 24, 2026
Rollup merge of #153537 - taiki-e:ef-sparc-32plus, r=wesleywiser

rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu

Currently, attempting to build this target using Ubuntu/Debian's sparc64-multilib toolchain results in the following link error ([full log](https://github.com/taiki-e/atomic-maybe-uninit/actions/runs/22798868888/job/66137493862#step:15:442)):

```
  = note: /usr/lib/gcc-cross/sparc64-linux-gnu/13/../../../../sparc64-linux-gnu/bin/ld: unknown architecture of input file `/home/runner/work/atomic-maybe-uninit/atomic-maybe-uninit/target/sparc-unknown-linux-gnu/debug/deps/rustcYzaDYW/symbols.o' is incompatible with sparc:v8plus output
```

This appears to be caused by the required e_flag being missing and can be fixed by setting `EF_SPARC_32PLUS`.

Tested using rustc with this patch applied and qemu-user (taiki-e/atomic-maybe-uninit@57d7e7f, [log](https://github.com/taiki-e/atomic-maybe-uninit/actions/runs/22798793270/job/66137298093)).

Related discussion: #131222 (comment)

r? workingjubilee
cc @glaubitz

@rustbot label +O-SPARC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-SPARC Target: SPARC processors S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants