Currently, rustc accepts only a subset of target tuples. While some of this is related to support, there are some targets that are semantically equivalent, but only one of them is accepted. For example, rustc accepts
x86_64-unknown-linux-gnu, but does not accept
x86_64-pc-linux-gnu (despite the latter being the canonicallization of a typical distro host tuple,
x86_64-linux-gnu and, in particular, the output of config.guess on my system). One issue this presents is it makes using rustc in an autotools project (either indirectly, by invoking cargo, or directly when cargo may be unavailable) difficult (and, in particular, requires using
host_alias when set, rather than the canonical value of
My proposal is thus:
- rustc should accept for all
x86_64targets, the vendor pc and the vendor unknown interchangebly, and possibly also accept an omitted vendor (such as in
- rustc should also likewise accept
i?86for targets where previously only one is accepted (linux targets only accepts
i686-unknown-linux-gnu, windows is
i586). This is slightly less annoying, but typically I use
i386when targeting 32-bit x86.
One possibly, this could be supported via the target-tuples crate, written by myself (shameless plug), which can parse and provide a correct semantic representation of a subset of targets accepted by config.sub (and, in particular, it accepts a superset of canonical (output by config.sub) targets which llvm itself accepts).