Skip to content

Set cc for rustdoc #7529

@nmattia

Description

@nmattia

Describe the problem you are trying to solve

I can't find a way to set the cc for rustdoc.

CARGO_TARGET_XXX_LINKER is not passed, and it appears that rustdoc reacts neither to CARGO_BUILD_RUSTFLAGS=-C linker=/path/to/cc nor to CC=/path/to/cc. One solution may be to set RUSTDOCFLAGS=-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 to rustdoc, where XXX is the CARGO_BUILD_TARGET.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: rustdoc --testC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Z-doctest-xcompileNightly: doctest-xcompile

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions