Need a method like cc.compiles for assembler
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
in [pixman](https://gitlab.freedesktop.org/pixman/pixman) we want to do some assembler tests, and the input is raw assembly with c pre-processor macros. This can be made to work by writing the test to a .S file and then passing it in, but cannot be made to work (currently) using a string passed to `compiler.compiles`.
One way to go about doing this would be to add a `assembly` flag to the compiler object, but I'm not sure if that's the right way to solve it, since that relies on specific behavior of GCC/Clang, and notably doesn't work with MSVC. A better way might be do do something similar for assemblers to what I'm doing in #5148, splitting the assembler into a separate representation and allowing the user to ask for the assembler like another compiler, doing something like:
```meson
as = meson.get_compiler('assembler')
works = as.compiles(
'''my . made:up
assembly . code
""")
```
related: #4366
Contributor guide
Research direction
Start by reading the existing compiler.compiles API and the related discussions in #5148 and #4366. Compare the proposed assembler representation and meson.get_compiler('assembler') behavior across GCC, Clang, and MSVC; done means assembler source strings can be tested while preserving supported toolchain behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100