This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: (Side topic EDoc++ binary embedding)


> Sorry to nitpick, but there is nothing Mozilla-specific in
> dehydra/treehydra. There are users outside of Mozilla.

Sorry, i didn't realise this.

> However, I do think it's awesome to be able to store plugin results in
> the resulting binary to do LTO-style analyses. How well is that working
> for you?

It makes life a WHOLE lot easier.

For example, say a project compiles a lot of object files into a few
libraries:
libstuff1.a contains: O01.o O02.o O03.o O04.o ...
libstuff2.so contains: O11.o O12.o O13.o O14.o ...
then main.o is linked with libstuff1.a and libstuff2.so into main.exe

The result of the way the linking works is that the main.exe contains
all the embedded data from the objects that were used from libstuff1
O01.o ..., and main.o

My application then uses ldd to find any shared libs: libstuff2.so and
adds the data from those too.

So regardless of how complex the build/link procedure is to generate an
application binary: main.exe. To look at the embedded data for that
main.exe is simply a matter of:

edoc main.exe --format simple

It saves having to manage extra files in the build system. The other
option i have is to define --edoc-dir=/home/me/blah. Where /home/me/blah
is some absolute directory outside the build. The data is then placed in
separate files for each object file in that directory for everything
that is built. Again this results in usage similar to:

edoc /home/me/blah/ --format simple

I am currently not using the modified GCC to do the LOT-like analysis. I
have brought that out into a separate post compilation tool as it was
just easier to code that way.

To be honest the idea of embedding the data into the binary came from
someone else on this list.

Brendon.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]