-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
make zig cc
use clang-compatible -target and -mcpu parameters
#7360
Comments
zig cc
doesn't understand target triples including unknown
zig cc
doesn't understand target triples including unknown
for vendor
I've hit this very same problem today and indeed having to patch the triple every time is annoying.
|
zig cc
doesn't understand target triples including unknown
for vendor
Currently the Of course it does have the downside noted by this issue, and when using It's annoying but I think the best solution to the problem is to parse the triple according to LLVM rules, only in zig cc (as @LemonBoy notes in the 3rd option), which involves a more onerous process than simply omitting the vendor, because the CPU model names and CPU features have different syntax (underscore instead of dash, for instance, but also the sets of features are not the same, and some are renamed). I also haven't marked this as accepted, because, maybe it's better to not be clang-compatible in this one way? |
zig cc
use clang-compatible -target and -mcpu parameters
Maybe if there was some standard way to convert between LLVM and Zig triples (and |
Duplicate of #4911 |
If you run clang with
--target=arm64-unknown-linux-gnu
it will understand it to mean the same asarm64-linux-gnu
, but withzig cc
it returnsUnknownOperatingSystem
. I wanted to usezig cc
in a Rust build script, and this is an issue as Rust only uses 4-part target triples - and so<arch>-unknown-<sys>-<abi>
is by far the most common format for targets. While I can work around this in my particular case, I wouldn't expect it to be particularly difficult to implement in Zig and it would makezig cc
compatible with clang in more contexts.The text was updated successfully, but these errors were encountered: