Skip to content

Automatically detect the appropriate linker to use when cross-compiling #4133

Open

Description

In order to cross-compile the Debian cargo package I have to explicitly set RUSTFLAGS += -C linker=$(DEB_HOST_GNU_TYPE)-gcc, see here. I originally didn't think too much of this, however rustbuild does not require me to set this sort of thing when cross-compiling rustc, it automatically detects the appropriate linker to use. I wonder if it's possible to add similar detection logic to Cargo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-cross-compilingArea: using --target flag for other platformsArea: using --target flag for other platformsA-linkageArea: linker issues, dylib, cdylib, shared libraries, soArea: linker issues, dylib, cdylib, shared libraries, soC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-buildS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions