1
Fork 0

Fix aarch64-unknown-linux-gnu_ilp32 target

This was broken because the synthetic object files produced by rustc
were for 64-bit AArch64, which caused link failures when combined with
32-bit ILP32 object files.

This PR updates the object crate to 0.30.1 which adds support for
generating ILP32 AArch64 object files.
This commit is contained in:
Amanieu d'Antras 2023-01-09 17:49:24 +00:00
parent c361616c3c
commit a529ba8f67
4 changed files with 64 additions and 26 deletions

View file

@ -100,7 +100,13 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
};
let architecture = match &sess.target.arch[..] {
"arm" => Architecture::Arm,
"aarch64" => Architecture::Aarch64,
"aarch64" => {
if sess.target.pointer_width == 32 {
Architecture::Aarch64_Ilp32
} else {
Architecture::Aarch64
}
}
"x86" => Architecture::I386,
"s390x" => Architecture::S390x,
"mips" => Architecture::Mips,