trailofbits / multiplier

Code auditing productivity multiplier.
Apache License 2.0
431 stars 25 forks source link

Add a best-effort indexing mode #466

Open pgoodman opened 10 months ago

pgoodman commented 10 months ago

The idea here is that when indexing GCC builds, we should have a way to try to succeed even when we can't. For example, we should try to interpret the commands "as if" they were Clang commands.

This could take the form of passing in --resource_dir, etc. to the indexer. Or maybe in the form of applying QA overrides, the way clang does it with ApplyQAOverride in its driver. For example, the following QA override would "do the trick":

CCC_OVERRIDE_OPTIONS="s/-resource-dir/-isystem/ ^/usr/lib/llvm-15/lib/clang/15.0.7 ^-resource-dir"

But this environment variable doesn't affect PASTA.

pgoodman commented 10 months ago

I have a new hack that kind of works:

LIBRARY_PATH=<resource-dir>
CPATH="-resource-dir <resource-dir>:<include-dir1>:...:<include-dirN>"
CPPFLAGS="-nostdinc -nobuiltininc"