[cfe-dev] How does scan-build

Дилян Палаузов via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 18 04:14:37 PDT 2019


Hello Chirstian,

for the rationale to join several input files into one, and pass that one to the static analyzer, see the thread Subj:
“Many .c files as input to scan-build” Thread-Id: <e0b6149d092be2f191052aed11be0d2bf7b83d2a.camel at aegee.org> . The idea
is to get more useful results out of the static analyzer by providing it with more complete picture of everything: a
single source file containg all information.

As far as LTO is concerned, it is not ready for the prime time.  In order of ar, nm and ranlib to work with LTO, the
installation process of clang must install LLVMgold.so under ${libdir}/bfd-plugins otherwise the build system has to do
a lot of magic and most build systems don’t do that magic (part of the magic is to call on some systems gcc-ar-5 and on
others gcc-ar-5.0 or alike.  In fact cmake is the only build system to implement this magic completely, as of January
2019).  Build systems want to use just ar or nm.  I posted this to llvm-dev, 
http://lists.llvm.org/pipermail/llvm-dev/2018-March/122018.html and there is no interest to fix this.  Neither is there
interest on gcc’s side.

On Thu, 2019-07-18 at 22:54 +1200, Christian Gagneraud wrote:
> On Thu, 18 Jul 2019 at 22:48, Дилян Палаузов <dpa-llvm at aegee.org> wrote:
> > Hello Christian,
> > 
> > I use autoconf/automake.
> > 
> > In fact I want to see what will happen if I combine many source files into one and pass that file to the static
> > analyzer.  In this use case there is no build system involved.
> 
> I haven't use GNU autotools in ages. Yes in that case scan-build might
> be your only way to collect the compilation database.
> What i don't understand is "combine many source files into one", are
> you after LTO [1]?
> How does the static analiser fits into that?
> Can you provide details on what you're trying to achieve exactly?
> 
> [1] https://llvm.org/docs/LinkTimeOptimization.html




More information about the cfe-dev mailing list