mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.65k stars 1.64k forks source link

[Feature] GNU AS support for asm #13707

Open ethindp opened 2 months ago

ethindp commented 2 months ago

Currently it looks like the only supported assembly language targets are masm and nasm. However, the (official) one is Gnu As on Linux, so that should probably be supported. If Gas is already supported, I can't seem to find any mention of it anywhere.

eli-schwartz commented 2 months ago

It's handled automatically if your compiler is the GNU compiler -- we simply accept .s / .S as valid extension suffixes for those languages. The masm/nasm handling is for when it's provided as a distinct language with its own dedicated compiler.

I agree that's not fully straightforward to understand... At least it could be better documented.

ethindp commented 2 months ago

Yeah... I'm a bit confused.

So do I understand this right?

I want to write a meson.build for the BLAKE3 C implementation. This comprises both .asm and .S files. If I just add those to the project depending on target/compiler, it'll just work? (I will need to identify MSVC/MinGW though...)

eli-schwartz commented 2 months ago

It should work, yes.

If/when using .asm files, you'll need to ensure that "nasm" is added as a project language. This is unnecessary for the _unix.S or (I believe) _windows_gnu.S files.