Multiple compilers in JSON compilation database #3886
-
Hi, I've run into a problem using the compile_commands.json file generated by Meson. As far as I can tell, codechecker seems to expect a database to exclusively for one target, or at least not have different compilers in the file. Currently, my meson system builds unit tests for the host machine, for the target, and the "whole software" itself, so all of it gets put in the same compile_commands.json file. When disabling the target unit test builds, and the software build, codechecker works. Could there by any other way of solving this other than me writing a script to separate the generated json file into several ones correlating only to one binary? I think that using several compilers shouldn't(?) cause a problem during analyis, only for Cross Translation Unit analysis. Any thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, Cross Translation Unit analysis works in a way that if the analysis goes through a function call, then the body of that function is loaded on-the-fly. If the function is compiled to multiple targets by several build actions then CodeChecker can't decide which version to import, because linker information is not available. We haven't focused on gathering linking information so far, but we assume as a precondition that every function is compiled to exactly one platform (the diversity of compilers in itself shouldn't be a problem). |
Beta Was this translation helpful? Give feedback.
Hi,
I created a PR which fixes this issue: #3914.