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
Add musl's lib folder to library search path #2893
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon. Please see the contribution instructions for more information. |
I found this while working on #2088 as
because it was trying to link musl 1.1 from the rustc target instead of musl 1.2.3 which we were compiling. |
Prior to this change, `libc.a` was being found in rustc's self-contained musl target folder instead of the `libc.a` that we've built or downloaded. This doesn't seem to have caused any noticeable issues as the versions of musl we built/installed and the version shipped in rustc's target matched exactly. To resolve this, we pass the path to our version of musl's lib folder directly as a `RUSTFLAG` which causes it to be found first.
df3e59f
to
ea73035
Compare
You can use https://doc.rust-lang.org/rustc/codegen-options/index.html#link-self-contained |
I gave that a try but it results in linker errors trying to resolve
Which it's currently getting from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds sensible to me!
@bors r+ |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
Prior to this change,
libc.a
was being found in rustc's self-containedmusl target folder instead of the
libc.a
that we've built ordownloaded. This doesn't seem to have caused any noticeable issues as the
versions of musl we built/installed and the version shipped in rustc's
target matched exactly.
To resolve this, we pass the path to our version of musl's lib folder
directly as a
RUSTFLAG
which causes it to be found first.