cdylib fails to link with incremental compilation after panic -> no panic transition #67118
Labels
A-incr-comp
Area: Incremental compilation
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
P-high
High priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
File a1.rs:
Compile with:
rustc a1.rs --crate-type cdylib -C opt-level=2 -C incremental=$PWD/inc
Change
None
toSome(1)
, then recompile with the same command.Fails with:
My guess is that when it compiles the first version, which should always panic, some symbols aren't needed and get optimised away or somehow altered. Then when the code is changed to not panic, those symbols remain absent (or in an unusable state) and it fails to link.
The following things make this behaviour go away:
#[no_mangle]
Tested with:
on a Debian-based Linux distribution.
The text was updated successfully, but these errors were encountered: