Skip to content

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

Open
taiki-e wants to merge 1 commit intorust-lang:mainfrom
taiki-e:ef-sparc-32plus
Open

rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu#153537
taiki-e wants to merge 1 commit intorust-lang:mainfrom
taiki-e:ef-sparc-32plus

Conversation

@taiki-e
Copy link
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
Collaborator

rustbot commented Mar 7, 2026

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

@glaubitz
Copy link
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
Member Author

taiki-e commented Mar 7, 2026

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

@glaubitz
Copy link
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.

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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants