But how do you enable other extensions? There’s a cpu_features_add field but it seems to be some kind of bitfield and I can’t figure out what to do with it.
For example how would you set this -march ISA string?
Bonus question: how do you set the ABI to ilp32f or ilp32d? Or even lp64 - that seems to be missing from Abi, though it does exist in CallingConvention?
Ah I think I figured it out. The .abi values are copied from LLVM’s EnvironmentType (source), presumably with Target.Abi.none corresponding to UnknownEnvironment.
This comes from the 4th component of the extremely awful “target triple”, so I think actually Zig is just wrong in calling this .abi. It should be .environment.
Note that the “triple” actually has five components: <arch>-<vendor>-<os>-<environment>-<object format>, but -<environment> is optional, which is why you sometimes see e.g. sparc-unknown-none-elf - here the <environment> is omitted and elf is the format. What a shit show.
I haven’t confirmed this but I think the environment determines the default ABI (CallingConvention for Zig), so setting it to Target.Abi.none is fine.