-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
EDIT: Given that the cargo commit hashes are the same in nightly-2021-10-28
and nightly-2021-10-27
, it might be rustc itself which is broken, somehow between hashes e269e6bf47f40c9046cd44ab787881d700099252
and 4e0d3973fafdfb1c51011bc74e44257b5e3863f1
e.g. in this set of commits.
EDIT 2: Might be coming from this commit: rust-lang/rust@cc4345a
EDIT 3: -Zbuild-std
is broken only with build-std-features = ["panic_immediate_abort"]
. If I comment out that line in .cargo/config.toml
, the linkage succeeds. Which increases the suspicion that the commit from EDIT 2 is the offending one, especially the changes to panicking.rs
.
Problem
Since nightly-2021-10-28
, -Zbuild-std
reports linkage errors where core::panicking::panic::*
cannot be found.
The latest nightly that works is nightly-2021-10-27
Steps
rustup install nightly
(orrustup install nightly-2021-10-28
)rustup default nightly
(orrustup default nightly-2021-10-28
)- Download and unpack the attached demo crate
cargo build --target x86_64-apple-darwin
(target does not matter; it is broken everywhere)- Expected result: successful linkage
- Observed result:
= note: Undefined symbols for architecture x86_64:
"core::panicking::panic::h019220a5efa21cf3", referenced from:
panic_unwind::real_imp::find_eh_action::h77f57cf800eb60b2 in libpanic_unwind-2e68708bd30aab08.rlib(panic_unwind-2e68708bd30aab08.panic_unwind.cae1f51d-cgu.0.rcgu.o)
panic_unwind::dwarf::eh::find_eh_action::h5331216282f6ca73 in libpanic_unwind-2e68708bd30aab08.rlib(panic_unwind-2e68708bd30aab08.panic_unwind.cae1f51d-cgu.7.rcgu.o)
panic_unwind::dwarf::eh::round_up::h50516c03cc2ea37e in libpanic_unwind-2e68708bd30aab08.rlib(panic_unwind-2e68708bd30aab08.panic_unwind.cae1f51d-cgu.7.rcgu.o)
panic_unwind::dwarf::eh::read_encoded_pointer::ha8d12fdd91646c7b in libpanic_unwind-2e68708bd30aab08.rlib(panic_unwind-2e68708bd30aab08.panic_unwind.cae1f51d-cgu.7.rcgu.o)
panic_unwind::dwarf::DwarfReader::read_uleb128::hf52d44d8f44bcf32 in libpanic_unwind-2e68708bd30aab08.rlib(panic_unwind-2e68708bd30aab08.panic_unwind.cae1f51d-cgu.5.rcgu.o)
panic_unwind::dwarf::DwarfReader::read_sleb128::he29ae0fcb92e7992 in libpanic_unwind-2e68708bd30aab08.rlib(panic_unwind-2e68708bd30aab08.panic_unwind.cae1f51d-cgu.5.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Possible Solution(s)
No solution, just some initial research, as per the EDIT notes above:
- Given that the cargo commit hashes are the same in
nightly-2021-10-28
andnightly-2021-10-27
, it might be rustc itself which is broken, somehow between hashese269e6bf47f40c9046cd44ab787881d700099252
and4e0d3973fafdfb1c51011bc74e44257b5e3863f1
e.g. in this set of commits. - Might be coming from this commit: rust-lang/rust@cc4345a
Notes
No response
Version
cargo 1.58.0-nightly (6c1bc24b8 2021-10-24)
release: 1.58.0
commit-hash: 6c1bc24b8b49d4bc965f67d7037906dc199c72b7
commit-date: 2021-10-24
host: x86_64-apple-darwin
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.64.1 (sys:0.4.49+curl-7.79.1 system ssl:(SecureTransport) LibreSSL/2.8.3)
os: Mac OS 11.5.2 [64-bit]