Closed
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)
)