-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Linker library order is important #11124
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
Comments
Another possible solution could be |
Did #12688 fix this? |
It did indeed, a test was checked in as well. |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jul 31, 2023
…ogiq Rewrite [`tuple_array_conversions`] Fixes rust-lang#11100 Fixes rust-lang#11144 Fixes rust-lang#11124 rust-lang#11082 still needs discussion and rust-lang#11085 likely can't be fixed. changelog: [`tuple_array_conversions`]: Move to `pedantic` changelog: [`tuple_array_conversions`]: Don't lint if mutability of references changes changelog: [`tuple_array_conversions`]: Don't lint if bindings don't come from the exact same pattern changelog: [`tuple_array_conversions`]: Don't lint if bindings are used for more than just the conversion
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's say I have 3 modules
main.rs
,a.rs
andb.rs
, and two external librarieslibfoo.a
andlibbar.a
, and thatlibbar
depends on symbols defined inlibfoo
.main.rs
a.rs
b.rs
Because rustc de-dupes the list of external libraries, it will pass to linker only
-lfoo -lbar
. However gnu linker does not look for unresolved symbols in libraries it had already processed, so it will fail to resolve libbar's references to libfoo. The correct command line would have been-lfoo -lbar -lfoo
.Rustc should not de-duplicate the list of libraries. Furthermore, I think it should guarantee that libs will appear in the same order on the linker command line as they did in the source file.
The text was updated successfully, but these errors were encountered: