diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2023-01-09 17:49:24 +0000 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2023-01-09 17:49:24 +0000 |
| commit | a529ba8f67861c21a6f4d1c497aa1f602b335ecb (patch) | |
| tree | e4419679a2840bc850dad8df9cbf98a1461d81f3 /compiler/rustc_codegen_ssa/src | |
| parent | c361616c3ca3e3e3069dbdf90557181233387444 (diff) | |
| download | rust-a529ba8f67861c21a6f4d1c497aa1f602b335ecb.tar.gz rust-a529ba8f67861c21a6f4d1c497aa1f602b335ecb.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/metadata.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 51c5c375d51..237b8849a35 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -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, |
