Skip to content

Commit 08571af

Browse files
Rollup merge of rust-lang#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: rust-lang#131222 (comment) r? workingjubilee cc @glaubitz @rustbot label +O-SPARC
2 parents bbdfe21 + e0d9940 commit 08571af

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
396396
_ => EF_PPC64_ABI_UNKNOWN,
397397
}
398398
}
399+
Architecture::Sparc32Plus => elf::EF_SPARC_32PLUS,
399400
_ => 0,
400401
}
401402
}

0 commit comments

Comments
 (0)