-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to find symbols in linked external libraries on Linux #132023
Comments
Until 1.82, rustc passed the linker flag The actual reason you have a linker error is probably a link order issue. The GNU linker which I think every distro ships by default is really stupid and processes the contents of libraries only in the order they are passed. If a later library depends on an earlier one in the argument list, you either need to change the order of your flags, pass a I suspect the issue with your link is that the other brotli libraries depend on libbrotlicommon. I spot-checked the regressions in crater that looked like this, and they all linked fine with LLD. |
Huh, I've stumped on the Changing the order does fix the problem. Also, does it only affect tests? Since I haven't recieved any report downstream, I assume all the symbols are present in the |
Yeah, only tests. Your spelunking on the history of this is as good as mine, I just know a little bit of linker arcana but none of the relevant rustc history. You could start from #128400. |
Code
Not sure if it's Rustc's problem or cargo's problem, but 1.82.0 failed to find symbols in external libraries when linking. This only happens on Linux, macOS works fine on the CI, and Windows works fine by testing locally.
inflation/jpegxl-rs#104
I expected to see this happen: links fine in testing
Instead, this happened: 1.82.0 failed to find symbols in
libbrotlicommon.a
Linker commands related to external libraries:
Version it worked on
It most recently worked on: 1.81.0
Version with regression
rustc --version --verbose
:@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged
The text was updated successfully, but these errors were encountered: