[Ffmpeg-devel] build systems

Dave Dodge dododge
Wed Sep 21 02:06:09 CEST 2005


On Tue, Sep 20, 2005 at 11:48:22PM +0100, M?ns Rullg?rd wrote:
> Dave Dodge <dododge at dododge.net> writes:
> >   - Libtool bloat.  Example: a few years ago I compiled Mozilla.  At
> >     the time the final executable was around 16M in size.  The
> >     compilation however consumed 1.5 _gigabytes_ of disk space.  For a
> >     16M executable.  This is completely absurd, and I believe libtool
> >     or perhaps some specific way of using it is the cause.
> 
> That's not libtool's fault as such.  Mozilla just is an
> over-complicated heap of bloated C++ code.

Looking through my notes, I find that "k3d" had a similar problem.
The project is 1.8Mbytes of sourcecode.  It consumed 700M of disk
during the build.  I never even finished the install because it ran
out of disk on that machine.

I noticed for example the file "sdpgtkdata.cpp", that had literally 10
lines of code in it that did nothing but define three class methods
with "{ }" bodies.

  -rwxr-xr-x    1 dododge  dododge      1080 Oct  2 04:09 sdpgtkdata.cpp
  -rwxr-xr-x    1 dododge  dododge      1455 Oct  2 04:09 sdpgtkdata.h

After g++ and libtool were done with those 10 lines of code:

  -rw-r--r--    1 dododge  dododge    553104 Dec 12 16:45 sdpgtkdata.lo
  -rw-r--r--    1 dododge  dododge    548128 Dec 12 16:45 sdpgtkdata.o
                                      ^^^^^^

That's 1M of disk space from 10 lines of nothing.  Repeat for every
other .cpp file.  Then link them all together into massive .so and .a
files.  This directory needed 195M of disk space and only had 13K
lines of code in it.  Then repeat for all other subdirectories, etc.

C++ is definitely part of the problem; I've also seen template
explosions where a few lines of code ran gcc out of memory, but I
don't think that was the case here.  libtool also seems to be involved
whenever I notice this sort of incredible object size inflation.  I
think libtool sometimes also ends up with multiple copies of the giant
.lo/.la/whatever files in various places, all eating up space (I recall
the Mozilla build having many copies of the object code).

                                                  -Dave Dodge





More information about the ffmpeg-devel mailing list