All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] wrap Buildroot compilation for static analysis
@ 2015-01-23  7:55 spam at douglasheld.net
  2015-01-23 11:56 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: spam at douglasheld.net @ 2015-01-23  7:55 UTC (permalink / raw)
  To: buildroot

Hi list,

I have some commercial software called Fortify SCA that wraps a compiler
command, to build an analysis model of the code.  I would like to analyze
OpenWRT and I see that it implements Buildroot.

For each time the build system invokes a command like 'gcc <compiler
args>', I would like to capture this information and run a command
'sourceanalyzer <sca args> gcc <compiler args>'.

With makefiles, this is a pretty well solved problem; I can invoke
sourceanalyzer <sca args> make <make args>
and that makes some wrapper scripts for gcc, g++ etc. that invoke
sourceanalyzer correctly. But I am finding the Buildroot build sequence a
little incomprehensible.

For example, a shortcut I tried is:

#i.e., build the toolchain and then the product
make
# find and remove selected object files
find ./package/libnl-tiny | egrep '\.o$|\.so$' | xargs rm
# try my wrapper on limited number of files
sourceanalyzer <sca args> make

But the final command doesn't detect the missing .o files and rebuild
them.  Instead it indicates a fatal error in libnl-tiny.so not existing as
expected.

Any indication where I should be looking? I didn't imagine the OpenWRT guys
would be able to answer questions about the underlying build system.

Thanks
Doug



-- 
spam at douglasheld.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150123/ae7602b8/attachment.html>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Buildroot] wrap Buildroot compilation for static analysis
  2015-01-23  7:55 [Buildroot] wrap Buildroot compilation for static analysis spam at douglasheld.net
@ 2015-01-23 11:56 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2015-01-23 11:56 UTC (permalink / raw)
  To: buildroot

Doug, All,

On 2015-01-23 07:55 +0000, spam at douglasheld.net spake thusly:
> I have some commercial software called Fortify SCA that wraps a compiler
> command, to build an analysis model of the code.  I would like to analyze
> OpenWRT and I see that it implements Buildroot.

Well, although it's true that OpenWRT is a fork of Buildroot, the fork
occured a looong time ago, and the two are now completely different.
OpenWRT is now its own build system in its own right, and is no longer
correlated to Buildroot.

I would suggest that you direct OpenWRT related questions to the OpenWRT
support channels.

> But I am finding the Buildroot build sequence a
> little incomprehensible.
> 
> For example, a shortcut I tried is:
> 
> #i.e., build the toolchain and then the product
> make
> # find and remove selected object files
> find ./package/libnl-tiny | egrep '\.o$|\.so$' | xargs rm
> # try my wrapper on limited number of files
> sourceanalyzer <sca args> make
> 
> But the final command doesn't detect the missing .o files and rebuild
> them.  Instead it indicates a fatal error in libnl-tiny.so not existing as
> expected.

I don't know how OpenWRT behaves in this respect, but Buildroot does not
detect such changes.

What happens is that, after each step: configure, build install...,
Buildroot will create a stamp file in the package build directory, like;
    build/PKG-NAME-VERSION/.stamp_downloaded
    build/PKG-NAME-VERSION/.stamp_extracted
    build/PKG-NAME-VERSION/.stamp_configured
    build/PKG-NAME-VERSION/.stamp_built
and so on...

Then, Buildroot uses those files to detect whether the package needs
configuring, building, etc... So, as long as those files are present,
Buildroot would believe it has nothing to do about that package.

What you want to do is use one of the re-do targets, like:
    make PKG-reconfigure
    make PKG-rebuild

But I don't know how that would translate for OpenWRT...

> Any indication where I should be looking? I didn't imagine the OpenWRT guys
> would be able to answer questions about the underlying build system.

I guess they would, since OpenWRT is no longer related to Buildroot
nowdays...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-23 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23  7:55 [Buildroot] wrap Buildroot compilation for static analysis spam at douglasheld.net
2015-01-23 11:56 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.