-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
I’m working on a fairly peculiar system at the moment where the default linker (cc
) is not able of linking properly, and thus I set the following environment variables
export RUSTFLAGS="-Clinker=clang -Clink-arg=--target=$HOST_TARGET"
export RUSTDOCFLAGS="-Clinker=clang -Clink-arg=--target=$HOST_TARGET"
export CC="clang"
export CFLAGS="--target=$HOST_TARGET"
which made cargo build
pass. However cargo test
still fails because doctests are still being compiled with the default linker. Running cargo test --verbose
reveals that the flags are being passed through to rustdoc
:
rustdoc ... -Clinker=clang -Clink-arg=--target=$HOST_TARGET
However, rustdoc
still uses a default linker:
error: linking with `cc` failed: exit code: 1
|
= note: "cc" ...
(Tested with rustdoc 1.38.0 (625451e37 2019-09-23)
)
Metadata
Metadata
Assignees
Labels
A-doctestsArea: Documentation tests, run by rustdocArea: Documentation tests, run by rustdocA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.