Skip to content
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

zig cc does not accept -mtune=generic #12767

Closed
orent opened this issue Sep 7, 2022 · 5 comments
Closed

zig cc does not accept -mtune=generic #12767

orent opened this issue Sep 7, 2022 · 5 comments
Labels
bug Observed behavior contradicts documented or intended behavior zig cc Zig as a drop-in C compiler feature

Comments

@orent
Copy link

orent commented Sep 7, 2022

Zig Version

0.9.1

Steps to Reproduce

Compile c code with -mtune=generic

This option is frequently passed by some makefiles and build scripts and is frequently the only thing preventing zig cc from being an otherwise drop-in replacement. It should be safe to just ignore it.

Expected Behavior

Accept this gcc-ism

Actual Behavior

error: unknown target CPU 'generic'

@orent orent added the bug Observed behavior contradicts documented or intended behavior label Sep 7, 2022
@Vexu Vexu added the zig cc Zig as a drop-in C compiler feature label Sep 7, 2022
@Vexu Vexu added this to the 0.11.0 milestone Sep 7, 2022
@kassane
Copy link
Contributor

kassane commented Sep 7, 2022

This was already proposed in #4911

@Vexu Vexu closed this as completed Sep 7, 2022
@Vexu Vexu removed this from the 0.11.0 milestone Sep 7, 2022
@orent
Copy link
Author

orent commented Sep 7, 2022

This is not the same as #4911 which makes no mention of 'generic'

This proposal is specifically about value 'generic' which exists in gcc but not in llvm. It means a "a fairly old but not really ancient CPU target we will update from time".

Please reopen

@Vexu
Copy link
Member

Vexu commented Sep 8, 2022

Clang does accept -mtune=generic, are you saying that it handles it differently?

@orent
Copy link
Author

orent commented Sep 8, 2022

Oh, you're right.
"zig cc" does not accept it, but "zig clang" does

Targets accepted by zig clang but not zig cc are:
generic
goldmont-plus
core-avx-i
core-avx2
skylake-avx512
icelake-client
icelake-server
athlon-fx
x86-64

Neither accepts x86-64-v2, x86-64-v3, x86-64-v4

So is this included in #4911, after all?

@Vexu
Copy link
Member

Vexu commented Sep 8, 2022

Sounds like it but feel free to mention it there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior zig cc Zig as a drop-in C compiler feature
Projects
None yet
Development

No branches or pull requests

3 participants