zig cc: integration with -m flags #4912
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
zig cc
Zig as a drop-in C compiler feature
Milestone
Extracted from #4784.
As you can see there are quite a few
-m
flags that control CPU features:Currently the way these work is they will be forwarded to clang without zig being aware of them. The forwarding happens after zig specifies the CPU features flags, so I believe there is not currently a correctness problem here. However, zig does have CPU features awareness, and when these flags are specified, zig's idea of what CPU features are enabled can be incorrect (even though it ends up passing correct flags to clang). I can't think of this causing an actual problem, but it's an "invariant" that is violated, which could have unforeseen consequences in the future. For example, one thing is that these flags will cause false negatives in the cache (zig could have cached something but did not).
Hopefully there is someway to solve these in bulk; although if maintaining a manual mapping of these flags to CPU features is what is required, it would still be workable.
The text was updated successfully, but these errors were encountered: