Closed tamird closed 3 years ago
Closing this as it applies to the old iteration of LLD-MachO which is not being developed. (The new one is named ld64.lld.darwinnew
, and will be receiving active feature development and bug fixes.)
This repro is much easier with a rust compiler that includes https://github.com/rust-lang/rust/pull/46255/commits/c30d8f2f1f2d904544af0b6eab89f0e3bb586c75.
With that compiler, given hello_world.rs:
fn main() {
println!("hello world!");
panic!("goodbye world!");
}
Using ld64:
$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-302.3.1
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 9.0.0, (clang-900.0.38) (static support for 21, runtime is 21)
TAPI support using: Apple TAPI version 900.0.14 (tapi-900.0.14)
$ ./build/x86_64-apple-darwin/stage1/bin/rustc hello_world.rs && ./hello_world
hello world!
thread 'main' panicked at 'goodbye world!', hello_world.rs:3:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Using LLD 6.0.0 (https://llvm.org/git/lld.git 70cb0908a7a1efc8b81f7a0848e36e2dfcf05d1e):
$ ./build/x86_64-apple-darwin/stage1/bin/rustc -Z linker-flavor=ld -C linker=$(brew --prefix llvm)/bin/ld64.lld hello_world.rs && ./hello_world
hello world!
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Abort trap: 6
Moving to more specific "MachO" LLD component (instead of generic "All Bugs").
Any news on this? I just tested with LLD HEAD and the problem appears to persist.
There are 5 rust libraries involved, and they range from 2.3M to 19M. The attachment limit is 1M, so I can't attach those.
I'll attach the resulting *.o files.
Hi Tamir,
How big are the rust libraries? Would it be possible for you to attach the raw *.o files and libraries you're linking?
Cheers, Lang.
assigned to @lhames
Extended Description
Full repro is here: https://github.com/tamird/rust_lld, but you'll need a working rust compiler and might need to massage build.sh for your system.
TL;DR unwinding fails with
fatal runtime error: Could not unwind stack, error = 5
.Here's the symbol table diff between what
ld
produces vslld
: https://gist.github.com/tamird/1af0c8d9a7132fd9915e