rustc 1.18 regression: order of linker arguments changed #42606
Labels
A-linkage
Area: linking into static, shared libraries and binaries
P-high
High priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
After updating from rust stable 1.17 to 1.18 my crate couldn't compile because of the following error:
In rust 1.17 cargo runs the following command which looks more of less the same as in rust 1.18:
And when I run this command with
-Z print-link-args
I get the following linker invokation:If I'm not mistaken, the key difference between the two linker commands is that
"-l" "stdc++"
appears after"-l" "qt_core_c"
with rustc 1.17 and the opposite way in rustc 1.18, so the linker refuses to add symbols fromlibstdc++
with rustc 1.18. But linkers are complicated so I'm not sure. MacOS and Windows builds continue to work, so it seems to be a Linux-specific issue. I fixed it on my end by replacing#[link]
attribute withcargo:rustc-link-lib
output, but I don't understand why it helped.The text was updated successfully, but these errors were encountered: