We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56e35a5 commit 0f72faaCopy full SHA for 0f72faa
compiler/rustc_codegen_ssa/src/back/metadata.rs
@@ -209,7 +209,15 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
209
"powerpc64" => (Architecture::PowerPc64, None),
210
"riscv32" => (Architecture::Riscv32, None),
211
"riscv64" => (Architecture::Riscv64, None),
212
- "sparc" => (Architecture::Sparc32Plus, None),
+ "sparc" => {
213
+ if sess.target.options.cpu == "v9" {
214
+ // Target uses V8+, aka EM_SPARC32PLUS, aka 64-bit V9 but in 32-bit mode
215
+ (Architecture::Sparc32Plus, None)
216
+ } else {
217
+ // Target uses V7 or V8, aka EM_SPARC
218
+ (Architecture::Sparc, None)
219
+ }
220
221
"sparc64" => (Architecture::Sparc64, None),
222
"avr" => (Architecture::Avr, None),
223
"msp430" => (Architecture::Msp430, None),
0 commit comments