Specific code layout can cause link failure with lto=true #62479
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This is the same code layout as #59137, with slightly more of my actual code - turns out that's not the only issue preventing me from using LTO.
I have a three-crate workspace; only two of these crates are relevant for this issue (if the code ran, the third would be relevant).
parent
, a binary, depending onshared
andlibloading
, using the latter to loadchild
shared
, a library, withcrate-type = ["dylib"]
child
, a library, also withcrate-type = ["dylib"]
. This crate can be deleted without changing the compile behaviour; it is only relevant at runtime.https://github.com/GinjaNinja32/rust-issues/tree/62479
I expected to see this happen: Successful compile, i.e.
Instead, this happened: Linking failed:
Meta
rustc --version --verbose
:(as used above)
also occurs on:
The text was updated successfully, but these errors were encountered: