-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move -mcpu to be part of the target triple #4584
Comments
EDIT: Resolved, I misread the proposed structure... several times over... |
As far as I can see, |
Argument for status quo:
I cannot really read that compared to a |
Does the current behavior prevent I came to this issue from #4875 and I'm seeing the same behavior as reported there: |
This is a follow-up issue from #4550.
std.zig.CrossTarget
has the ability to represent CPU features, as well asstd.Target
.Curently, "parsing" a target triple also wants to know the CPU model name and feature set at the same time, in order to produce a target. So this is a proposal to merge the concepts together. It mainly involves the CLI.
The proposal is to change this (example):
to this:
The main idea here is that
-mcpu
is deleted as a command line parameter, and-target
gains even more expressiveness.This works by replacing
-
with~
, because-
is a field separator in the-target
command line parameter. This would not affect the #3089 CLI which would have-mcpu
to match C compilers. Note that~
means "binary not" in many contexts, which would be a reasonable mnemonic to remember the syntax by.The main area where this would be helpful would be the Zig build system, because
standardTargetOptions
would only need to be concerned with-Dtarget
rather than-Dtarget
and-Dmcpu
. The fact that CPU features are part of bothstd.Target
andstd.zig.CrossTarget
is a strong hint that this data belongs together.As another example,
std.zig.CrossTarget.parse
wants to know the-mcpu
parameter in order to produce a result:zig/lib/std/zig/cross_target.zig
Lines 168 to 219 in 7e6b68a
The text was updated successfully, but these errors were encountered: