Skip to content

Provide a way to specify configuration for host compilation #5754

Open
@luser

Description

@luser

cargo currently supports specifying configuration per-target. Unfortunately, for non-cross-compiles this can lead to undesirable behavior. For example, we build Firefox in many variant configurations, several of which involve passing compiler and linker options that are useful for target binaries but cause problems when used for building things like build scripts. The simplest example here is address sanitizer--we want to compile and link with -fsanitize=address, but linking build scripts with that means they're now running with asan and that's not something we want to do. We have the same problem with our code coverage builds, which compile and link with --coverage.

It would be better if we had a way to explicitly configure host compilation. The simplest proposal I can think of would be to support [host.$triple] keys in config files and use those for host compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsS-triageStatus: 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