Add a test ensuring all our targets set the features required by their ABI.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
With https://github.com/rust-lang/rust/pull/136147, we emit a warning (and hopefully eventually a hard error) when a target does not enable all the target features required by the declared ABI, or when it enables a target feature incompatible with the declared ABI. Ideally, we'd ensure that all built-in targets pass this test, but that is non-trivial: we need to actually generate an LLVM TargetMachine for the target and ask LLVM about the enabled target features and then check that against our ABI compatibility list. I'm not sure how to best write such a test.
It could be a ui test compiling an empty program, with a revision for each target, but that seems annoying... I'd prefer something that iterates over all targets automatically, rather than having to list all targets in some ui test.
Cc @workingjubilee @rust-lang/wg-llvm
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing rust-lang/rust#136147 and the target ABI compatibility checks it introduced. Find the existing compiler test entry point that can create an LLVM TargetMachine, then determine how to iterate over all built-in targets and compare their enabled features with the ABI compatibility list; done means every built-in target is checked automatically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100