Skip to content

Commit a529ba8

Browse files
committed
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.
1 parent c361616 commit a529ba8

File tree

4 files changed

+63
-25
lines changed

4 files changed

+63
-25
lines changed

Cargo.lock

+50-21
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ dependencies = [
3535
"version_check",
3636
]
3737

38+
[[package]]
39+
name = "ahash"
40+
version = "0.8.2"
41+
source = "registry+https://github.com/rust-lang/crates.io-index"
42+
checksum = "bf6ccdb167abbf410dcb915cabd428929d7f6a04980b54a11f26a39f1c7f7107"
43+
dependencies = [
44+
"cfg-if",
45+
"once_cell",
46+
"version_check",
47+
]
48+
3849
[[package]]
3950
name = "aho-corasick"
4051
version = "0.7.18"
@@ -107,7 +118,7 @@ version = "0.1.1"
107118
source = "registry+https://github.com/rust-lang/crates.io-index"
108119
checksum = "276881980556fdadeb88aa1ffc667e4d2e8fe72531dfabcb7a82bb3c9ea9ba31"
109120
dependencies = [
110-
"object",
121+
"object 0.29.0",
111122
]
112123

113124
[[package]]
@@ -193,7 +204,7 @@ dependencies = [
193204
"cfg-if",
194205
"libc",
195206
"miniz_oxide",
196-
"object",
207+
"object 0.29.0",
197208
"rustc-demangle",
198209
]
199210

@@ -1650,9 +1661,9 @@ dependencies = [
16501661

16511662
[[package]]
16521663
name = "gimli"
1653-
version = "0.26.1"
1664+
version = "0.26.2"
16541665
source = "registry+https://github.com/rust-lang/crates.io-index"
1655-
checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
1666+
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
16561667
dependencies = [
16571668
"compiler_builtins",
16581669
"fallible-iterator",
@@ -1752,12 +1763,21 @@ version = "0.12.3"
17521763
source = "registry+https://github.com/rust-lang/crates.io-index"
17531764
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
17541765
dependencies = [
1755-
"ahash",
1766+
"ahash 0.7.4",
17561767
"compiler_builtins",
17571768
"rustc-std-workspace-alloc",
17581769
"rustc-std-workspace-core",
17591770
]
17601771

1772+
[[package]]
1773+
name = "hashbrown"
1774+
version = "0.13.1"
1775+
source = "registry+https://github.com/rust-lang/crates.io-index"
1776+
checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038"
1777+
dependencies = [
1778+
"ahash 0.8.2",
1779+
]
1780+
17611781
[[package]]
17621782
name = "heck"
17631783
version = "0.4.0"
@@ -1976,12 +1996,12 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
19761996

19771997
[[package]]
19781998
name = "indexmap"
1979-
version = "1.9.1"
1999+
version = "1.9.2"
19802000
source = "registry+https://github.com/rust-lang/crates.io-index"
1981-
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
2001+
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
19822002
dependencies = [
19832003
"autocfg",
1984-
"hashbrown",
2004+
"hashbrown 0.12.3",
19852005
"rustc-rayon",
19862006
"serde",
19872007
]
@@ -2578,13 +2598,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
25782598
checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
25792599
dependencies = [
25802600
"compiler_builtins",
2601+
"memchr",
2602+
"rustc-std-workspace-alloc",
2603+
"rustc-std-workspace-core",
2604+
]
2605+
2606+
[[package]]
2607+
name = "object"
2608+
version = "0.30.1"
2609+
source = "registry+https://github.com/rust-lang/crates.io-index"
2610+
checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a"
2611+
dependencies = [
25812612
"crc32fast",
25822613
"flate2",
2583-
"hashbrown",
2614+
"hashbrown 0.13.1",
25842615
"indexmap",
25852616
"memchr",
2586-
"rustc-std-workspace-alloc",
2587-
"rustc-std-workspace-core",
25882617
]
25892618

25902619
[[package]]
@@ -3596,7 +3625,7 @@ dependencies = [
35963625
"cstr",
35973626
"libc",
35983627
"measureme",
3599-
"object",
3628+
"object 0.30.1",
36003629
"rustc-demangle",
36013630
"rustc_ast",
36023631
"rustc_attr",
@@ -3631,7 +3660,7 @@ dependencies = [
36313660
"itertools",
36323661
"jobserver",
36333662
"libc",
3634-
"object",
3663+
"object 0.30.1",
36353664
"pathdiff",
36363665
"regex",
36373666
"rustc_arena",
@@ -5062,11 +5091,11 @@ dependencies = [
50625091
"core",
50635092
"dlmalloc",
50645093
"fortanix-sgx-abi",
5065-
"hashbrown",
5094+
"hashbrown 0.12.3",
50665095
"hermit-abi 0.2.6",
50675096
"libc",
50685097
"miniz_oxide",
5069-
"object",
5098+
"object 0.29.0",
50705099
"panic_abort",
50715100
"panic_unwind",
50725101
"profiler_builtins",
@@ -5298,13 +5327,13 @@ dependencies = [
52985327

52995328
[[package]]
53005329
name = "thorin-dwp"
5301-
version = "0.3.0"
5330+
version = "0.4.0"
53025331
source = "registry+https://github.com/rust-lang/crates.io-index"
5303-
checksum = "e6cb0c7868d7f90407531108ab03263d9452a8811b7cdd87675343a40d4aa254"
5332+
checksum = "da8fbf660a019b6bf11ea95762041464aa9099cc293b6a66d77cea5107619671"
53045333
dependencies = [
53055334
"gimli",
5306-
"hashbrown",
5307-
"object",
5335+
"hashbrown 0.12.3",
5336+
"object 0.30.1",
53085337
"tracing",
53095338
]
53105339

@@ -5813,9 +5842,9 @@ checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
58135842

58145843
[[package]]
58155844
name = "version_check"
5816-
version = "0.9.3"
5845+
version = "0.9.4"
58175846
source = "registry+https://github.com/rust-lang/crates.io-index"
5818-
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
5847+
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
58195848

58205849
[[package]]
58215850
name = "vte"

compiler/rustc_codegen_llvm/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ bitflags = "1.0"
1111
cstr = "0.2"
1212
libc = "0.2"
1313
measureme = "10.0.0"
14-
object = { version = "0.29.0", default-features = false, features = ["std", "read"] }
14+
object = { version = "0.30.1", default-features = false, features = [
15+
"std",
16+
"read",
17+
] }
1518
tracing = "0.1"
1619
rustc_middle = { path = "../rustc_middle" }
1720
rustc-demangle = "0.1.21"

compiler/rustc_codegen_ssa/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tracing = "0.1"
1515
libc = "0.2.50"
1616
jobserver = "0.1.22"
1717
tempfile = "3.2"
18-
thorin-dwp = "0.3"
18+
thorin-dwp = "0.4"
1919
pathdiff = "0.2.0"
2020
serde_json = "1.0.59"
2121
snap = "1"
@@ -43,6 +43,6 @@ rustc_session = { path = "../rustc_session" }
4343
rustc_const_eval = { path = "../rustc_const_eval" }
4444

4545
[dependencies.object]
46-
version = "0.29.0"
46+
version = "0.30.1"
4747
default-features = false
4848
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]

compiler/rustc_codegen_ssa/src/back/metadata.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
100100
};
101101
let architecture = match &sess.target.arch[..] {
102102
"arm" => Architecture::Arm,
103-
"aarch64" => Architecture::Aarch64,
103+
"aarch64" => {
104+
if sess.target.pointer_width == 32 {
105+
Architecture::Aarch64_Ilp32
106+
} else {
107+
Architecture::Aarch64
108+
}
109+
}
104110
"x86" => Architecture::I386,
105111
"s390x" => Architecture::S390x,
106112
"mips" => Architecture::Mips,

0 commit comments

Comments
 (0)