[cfe-dev] [scan-build] [Patch] Compiler call interceptor for Linux

Aleksei Sidorin a.sidorin at samsung.com
Tue May 13 08:47:16 PDT 2014


Hello again,

I sent a message to cfe-commits mailing list, but nobody answered. This 
task is listed in open projects. Is anybody interested in this interceptor?

Link to review: http://reviews.llvm.org/D3608

29.04.2014 09:38, Aleksei Sidorin:
> Hello,
>
> This patch enables interception of compiler calls without replacement 
> of environment variables. It uses strace (v.4.8) to compute root 
> directory of processes (in case of chroot), working directory, process 
> name and its environment variables and tries to guess some header 
> directories. This approach works well with Android and some build 
> systems like OBS (local build with osc client) and GBS (checked on 
> Tizen). This behaviour can be enabled with --use-interceptor option. 
> If this option is not specified, old behaviour is used (this patch was 
> made to not break it).
>
> Interceptor uses process pool to analyze multiple files at a time. 
> Pool size can be specified with NUM_PROCESSES environment variable. 
> Default pool size is a number of processors.
>
> If we have a trace of build (that may be created with `strace -f -v -s 
> 1000000 -o $trace_file_name -e 
> trace=vfork,fork,clone,execve,chdir,chroot -e signal= $build_cmd`), it 
> can be passed via TRACE_FILE environment variable. This will not 
> launch parallel build (analysis only). If option is not specified, 
> temporary pipe is used, analyzer and compiler are executed in parallel.
>
> -additional-arg option was also added to pass additional parameters to 
> analyzer. Sometimes scan-build cannot determine all required 
> parameters if some custom toolchain is used.
>
> Interceptor was tested on Ubuntu 12.04 and 14.04 with strace 4.8. 
> Strace v.4.6 is known to have some issues with interception of gcc.
>


-- 
Best regards,
Aleksei Sidorin
Software Engineer,
IMSWL-IMCG, SRR, Samsung Electronics




More information about the cfe-dev mailing list