-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Set cc
for rustdoc
#7529
Comments
1.39 will now allow What is your use case for passing a custom linker? Doctests don't support cross-compiling without the unstable With |
Thanks for the feedback! Looking forward to 1.39.
I work on systems that unfortunately do not have a |
Also, sometimes linkers have bugs. For example binutils 2.30 (shipped with Ubuntu 18.04 LTS) mishandles some compressed debug info sections: https://sourceware.org/bugzilla/show_bug.cgi?id=23919. We work around this at Materialize by setting So even when you're not cross compiling, I think it's important that |
The system linker in the builder image doesn't handle compressed debug sections properly, and rustdoc ignores the standard Cargo linker environment variable, so tell rustdoc to use the correct linker via the RUSTDOCFLAGS environment variable. See: rust-lang/cargo#7529 (comment)
The upstream issue, rust-lang/cargo#7529, was fixed.
Describe the problem you are trying to solve
I can't find a way to set the
cc
forrustdoc
.CARGO_TARGET_XXX_LINKER
is not passed, and it appears thatrustdoc
reacts neither toCARGO_BUILD_RUSTFLAGS=-C linker=/path/to/cc
nor toCC=/path/to/cc
. One solution may be to setRUSTDOCFLAGS=-Z unstable-options --linker=/path/to/cc
but this is only enabled on nightly, which I don't have.Describe the solution you'd like
It would be great for cargo to forward
CARGO_TARGET_XX_LINKER
torustdoc
, whereXXX
is theCARGO_BUILD_TARGET
.The text was updated successfully, but these errors were encountered: