-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File format not recognized when linking rmeta file for sparc-linux-unknown-gnu #126859
Comments
OK, this seems to be related about 32-bit SPARC missing an entry in But I have no clue where to find the source for the object crate. @nikic Any suggestion? |
@glaubitz The source for the object crate is at https://github.com/gimli-rs/object. |
Thanks, I just found that as well ;-). Guess we need to add support for Sparc there to fix this bug. |
OK, I just did a quick and dirty hack to verify my theory: diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs
index 264a98844ad..8bbde747725 100644
--- a/compiler/rustc_codegen_ssa/src/back/metadata.rs
+++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs
@@ -209,6 +209,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
"powerpc64" => (Architecture::PowerPc64, None),
"riscv32" => (Architecture::Riscv32, None),
"riscv64" => (Architecture::Riscv64, None),
+ "sparc" => (Architecture::Sparc64, None),
"sparc64" => (Architecture::Sparc64, None),
"avr" => (Architecture::Avr, None),
"msp430" => (Architecture::Msp430, None), and indeed the |
@nikic So, I tried editing the Can you tell me how I can edit the |
You should be able to use |
Thanks, that's very helpful! I didn't know about |
I am currently trying to build
rustc
for thesparc-linux-unknown-gnu
target which fails with the linker complaining about not recognizing the file format of thermeta
file on the command line:I have already tried tuning the compiler and linker options in
compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs
, but I am still getting the same error. Since I have no clue what thermeta
file is supposed to contain, I don't know what might be wrong and needs to be fixed.Thus, opening an issue in the hope that someone can explain what's in the
rmeta
file and what could be the reason for that file containing unexpected information, so I can come up with a possible fix.The text was updated successfully, but these errors were encountered: