Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum

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:
bors 2023-01-14 08:33:09 +00:00
commit 44a500c8c1
4 changed files with 64 additions and 26 deletions

View File

@ -35,6 +35,17 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "ahash"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf6ccdb167abbf410dcb915cabd428929d7f6a04980b54a11f26a39f1c7f7107"
dependencies = [
"cfg-if",
"once_cell",
"version_check",
]
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.18" version = "0.7.18"
@ -107,7 +118,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "276881980556fdadeb88aa1ffc667e4d2e8fe72531dfabcb7a82bb3c9ea9ba31" checksum = "276881980556fdadeb88aa1ffc667e4d2e8fe72531dfabcb7a82bb3c9ea9ba31"
dependencies = [ dependencies = [
"object", "object 0.29.0",
] ]
[[package]] [[package]]
@ -193,7 +204,7 @@ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"miniz_oxide", "miniz_oxide",
"object", "object 0.29.0",
"rustc-demangle", "rustc-demangle",
] ]
@ -1774,9 +1785,9 @@ dependencies = [
[[package]] [[package]]
name = "gimli" name = "gimli"
version = "0.26.1" version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
dependencies = [ dependencies = [
"compiler_builtins", "compiler_builtins",
"fallible-iterator", "fallible-iterator",
@ -1887,12 +1898,21 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [ dependencies = [
"ahash", "ahash 0.7.4",
"compiler_builtins", "compiler_builtins",
"rustc-std-workspace-alloc", "rustc-std-workspace-alloc",
"rustc-std-workspace-core", "rustc-std-workspace-core",
] ]
[[package]]
name = "hashbrown"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038"
dependencies = [
"ahash 0.8.2",
]
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.4.0" version = "0.4.0"
@ -2129,12 +2149,12 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "1.9.1" version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown", "hashbrown 0.12.3",
"rustc-rayon", "rustc-rayon",
"serde", "serde",
] ]
@ -2740,15 +2760,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53"
dependencies = [ dependencies = [
"compiler_builtins", "compiler_builtins",
"crc32fast",
"flate2",
"hashbrown",
"indexmap",
"memchr", "memchr",
"rustc-std-workspace-alloc", "rustc-std-workspace-alloc",
"rustc-std-workspace-core", "rustc-std-workspace-core",
] ]
[[package]]
name = "object"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a"
dependencies = [
"crc32fast",
"flate2",
"hashbrown 0.13.1",
"indexmap",
"memchr",
]
[[package]] [[package]]
name = "odht" name = "odht"
version = "0.3.1" version = "0.3.1"
@ -3791,7 +3820,7 @@ dependencies = [
"cstr", "cstr",
"libc", "libc",
"measureme", "measureme",
"object", "object 0.30.1",
"rustc-demangle", "rustc-demangle",
"rustc_ast", "rustc_ast",
"rustc_attr", "rustc_attr",
@ -3826,7 +3855,7 @@ dependencies = [
"itertools", "itertools",
"jobserver", "jobserver",
"libc", "libc",
"object", "object 0.30.1",
"pathdiff", "pathdiff",
"regex", "regex",
"rustc_arena", "rustc_arena",
@ -5296,11 +5325,11 @@ dependencies = [
"core", "core",
"dlmalloc", "dlmalloc",
"fortanix-sgx-abi", "fortanix-sgx-abi",
"hashbrown", "hashbrown 0.12.3",
"hermit-abi 0.2.6", "hermit-abi 0.2.6",
"libc", "libc",
"miniz_oxide", "miniz_oxide",
"object", "object 0.29.0",
"panic_abort", "panic_abort",
"panic_unwind", "panic_unwind",
"profiler_builtins", "profiler_builtins",
@ -5549,13 +5578,13 @@ dependencies = [
[[package]] [[package]]
name = "thorin-dwp" name = "thorin-dwp"
version = "0.3.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6cb0c7868d7f90407531108ab03263d9452a8811b7cdd87675343a40d4aa254" checksum = "da8fbf660a019b6bf11ea95762041464aa9099cc293b6a66d77cea5107619671"
dependencies = [ dependencies = [
"gimli", "gimli",
"hashbrown", "hashbrown 0.12.3",
"object", "object 0.30.1",
"tracing", "tracing",
] ]
@ -6090,9 +6119,9 @@ checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.3" version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]] [[package]]
name = "vte" name = "vte"

View File

@ -11,7 +11,10 @@ bitflags = "1.0"
cstr = "0.2" cstr = "0.2"
libc = "0.2" libc = "0.2"
measureme = "10.0.0" measureme = "10.0.0"
object = { version = "0.29.0", default-features = false, features = ["std", "read"] } object = { version = "0.30.1", default-features = false, features = [
"std",
"read",
] }
tracing = "0.1" tracing = "0.1"
rustc_middle = { path = "../rustc_middle" } rustc_middle = { path = "../rustc_middle" }
rustc-demangle = "0.1.21" rustc-demangle = "0.1.21"

View File

@ -15,7 +15,7 @@ tracing = "0.1"
libc = "0.2.50" libc = "0.2.50"
jobserver = "0.1.22" jobserver = "0.1.22"
tempfile = "3.2" tempfile = "3.2"
thorin-dwp = "0.3" thorin-dwp = "0.4"
pathdiff = "0.2.0" pathdiff = "0.2.0"
serde_json = "1.0.59" serde_json = "1.0.59"
snap = "1" snap = "1"
@ -44,6 +44,6 @@ rustc_session = { path = "../rustc_session" }
rustc_const_eval = { path = "../rustc_const_eval" } rustc_const_eval = { path = "../rustc_const_eval" }
[dependencies.object] [dependencies.object]
version = "0.29.0" version = "0.30.1"
default-features = false default-features = false
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"] features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]

View File

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