Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustc 1.18 regression: order of linker arguments changed #42606
Comments
This comment has been minimized.
This comment has been minimized.
|
Can we get a link to the crate that is failing? |
This comment has been minimized.
This comment has been minimized.
|
It was qt_core 0.2.1. It will probably build now because I've made the fix in |
alexcrichton
added
the
regression-from-stable-to-stable
label
Jun 12, 2017
brson
added
the
A-linkage
label
Jun 15, 2017
brson
assigned
alexcrichton
Jun 15, 2017
brson
added
the
P-high
label
Jun 15, 2017
This comment has been minimized.
This comment has been minimized.
|
I believe this was caused by #40805 along with the other regressions mentioned The bug here is indeed that in 1.17 you see In 1.17 and before rustc would automatically sort staticlibs before dylibs regardless of input order. This in turn had bugs for other applications and the change was to respect order regardless of library kind. We ended up closing a similar issue (#41416) so I'm going to close this as well as it looks like @Riateche the bug is fixed. Sorry for the trouble @Riateche! If you need any help with any other crates though please let us know! |
alexcrichton
closed this
Jun 19, 2017
This comment has been minimized.
This comment has been minimized.
|
cc @vadimcn |
Riateche commentedJun 12, 2017
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-argsI 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-liboutput, but I don't understand why it helped.