-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Prefer bundled linker redux #18797
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
Prefer bundled linker redux #18797
Conversation
…llect2 cannot be found. The latter is the case for our bundles, because we don't include collect2. Unfortunately, ld does not understand this option and errors out. On the bright side, -fno-use-linker-plugin still works to suppress gcc's LTO, so we can drop -fno-lto.
Did you move the bundled libraries from under |
I'm also happy with this as long as @alexcrichton is satisfied he can get cargo linking correctly under this scheme. |
Not entirely sure how we'll manage it, but I'm sure I can think of something for Cargo! |
@alexcrichton, I am trying to keep this all sufficiently generic so that we don't need to add Windows-specific
cc @cmr |
Based on Windows bundle feedback we got to date, - We *do* want to prefer the bundled linker: The external one might be for the wrong architecture (e.g. 32 bit vs 64 bit). On the other hand, binutils don't add many new features these days, so using an older bundled linker is not likely to be a problem. - We *do* want to prefer bundled libraries: The external ones might not have the symbols we expect (e.g. what's needed for DWARF exceptions vs SjLj). Since `-L rustlib/<triple>/lib` appears first on the linker command line, it's a good place to keep our platform libs that we want to be found first. Closes #18325, closes #17726.
I made a comment in #17726 (which I know is closed) and that issue redirects people to this one. I find the error in that previous issue still happens as of right now with a complete up-to-date install of Rust via rustup. Specifically, I see the following error when trying to compile a basic Rust program on Windows:
And it's clear that the Rust toolchain is using an existing mingw32 setup, not it's bundled one. I'm using the following:
I did try adding the the following to the PATH:
I added that before the part of the PATH that had a link to the So is that the solution that was decided upon? |
Fix replace-if-let-with-match generates non-exhausive match
Based on Windows bundle feedback we got to date,
-L rustlib/<triple>/lib
appears first on the linker command line, it's a good place to keep our platform libs that we want to be found first.Closes #18325, closes #17726.