-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
clang reports that -mcpu= option is unsupported when used together with --version #64958
Comments
@llvm/issue-subscribers-clang-driver |
I agree that the current diagnostic is not great[1], but do you have a specific reason to use other options along with
[1]: Without an input file, clangDriver doesn't create jobs for actions. |
I hit it when using spec2k17, from what I can see in the compiler detection stage it is applying all the optimization flags and append at the end "-v" to detect compiler version. |
…ons when there is no compiler jobs The upstream commit: https://reviews.llvm.org/D151590 added a new flag to mark target specific compiler options. The side effect of it was that in cases when -### or -v is used without any input file, clang started emitting an error. It happened like that becasue there is no compilation actions created which could consume/verify these target specific options. This patch changes that error to a warning about unused option in situations when there is no actions and still generates error when there are actions. Fix for #64958 Differential Revision: https://reviews.llvm.org/D159361
Fixed by https://reviews.llvm.org/D159361 |
…ons when there is no compiler jobs The upstream commit: https://reviews.llvm.org/D151590 added a new flag to mark target specific compiler options. The side effect of it was that in cases when -### or -v is used without any input file, clang started emitting an error. It happened like that becasue there is no compilation actions created which could consume/verify these target specific options. This patch changes that error to a warning about unused option in situations when there is no actions and still generates error when there are actions. Fix for llvm#64958 Differential Revision: https://reviews.llvm.org/D159361
When running:
clang -mcpu=native -v
:on X86 we can see following error:
clang: error: unsupported option '-mcpu=' for target 'x86_64-unknown-linux-gnu'
or
clang: error: unsupported option '-mcpu=' for target 'aarch64-unknown-linux-gnu'
when executed on aarch64.
clang 16 was fine with it, the issue exists with clang 17 rc3 and on the main branch.
The text was updated successfully, but these errors were encountered: