Description
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.