-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
llvm: use proper syntax for --config option #61778
llvm: use proper syntax for --config option #61778
Conversation
Use proper --config= syntax instead of --config as the latter can cause issues in some situations. Signed-off-by: Benjamin Cabé <[email protected]>
For some unknown reason this just broke the SOF fuzzer build:
Any idea?
|
Same failure reproduced with more recent clang 15.0.7 @kartben which clang version did you test this with and how? Also, what specific problem(s) did this commit help with?
|
clang 16.0.0.0
When using the newly introduced CodeChecker stuff with CodeChecker uses the compile_commands.json file generated by CMake (I think?), which contains entries such as:
and for some reason it gets the --config argument wrong? Just adding double quotes around Also, for what it's worth:
|
Thanks, that helps.
I found a clang 16.0.6 version somewhere and I tested it and for me it works BOTH with and without the equal sign
I tried to reproduce your issue but I could not. I don't understand why clang 16.0.0.0 seems to drop the config file argument in your case. This feels like a bug in the parser change that they just made, can you try to upgrade your clang? |
Some clang gitarcheology...
I didn't find any obvious bug fix after that. On the other hand, I found some significant changes after 16.0.0, for instance: So I think it's definitely worth trying something newer than 16.0.0.0 |
Also, can you try to re-run your clang command directly on the command line? The easiest to find the real, full command is to temporarily insert garbage in one C file; then CMake prints it and you can copy/paste it and run it directly. This is how I performed all my testing of clang 15 and clang 16. |
This reverts commit 577d47f. The --config= syntax with the equal sign does not work with clang 15 which is less than one year old (https://releases.llvm.org/). It does not work with clang 14 either. ``` clang --verbose clang version 15.0.7 clang --help | grep config -cl-std=<value> OpenCL language standard to compile for. --config <value> Specifies configuration file --cuda-feature=<value> Manually specify the CUDA feature to use clang: error: unsupported option '--config=/home/runner/work/... ``` The reverted commit mentioned "issues in some situations" without providing any example or other information. This revert fixes the SOF fuzzer build, see more details in #61778. Signed-off-by: Marc Herbert <[email protected]>
So the command as found in the compile_commands.json file definitely works, with both syntaxes, and I can make it fail by pointing to a config file that doesn't exist. I am calling for a bug in CodeChecker as it seems to actually be dropping the config file altogether when calling clang-tidy The following from the compile_commands:
becomes:
|
This reverts commit 577d47f. The --config= syntax with the equal sign does not work with clang 15 which is less than one year old (https://releases.llvm.org/). It does not work with clang 14 either. ``` clang --verbose clang version 15.0.7 clang --help | grep config -cl-std=<value> OpenCL language standard to compile for. --config <value> Specifies configuration file --cuda-feature=<value> Manually specify the CUDA feature to use clang: error: unsupported option '--config=/home/runner/work/... ``` The reverted commit mentioned "issues in some situations" without providing any example or other information. This revert fixes the SOF fuzzer build, see more details in zephyrproject-rtos#61778. Signed-off-by: Marc Herbert <[email protected]>
Use proper
--config=
syntax instead of--config
as the latter can cause issues in some situations.