<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:10pt;font-family:Courier New">
<p>Seems like the memory-hog status is related to debug info, e.g. to -g. Because I later compiled the same program with RELEASE</p>
<p>settings, e.g.</p>
<p></p>
<p>$ /usr/src/llvm/dist/bin/g++ -c -pipe --emit-llvm \</p>
<p>    -fvisibility=hidden -fvisibility-inlines-hidden \</p>
<p>    -Wall -Wextra -Wno-sign-compare -Os \</p>
<p>    ... lots of -Dxxxx ... \</p>
<p>    -I/usr/share/qt3/mkspecs/default -I. -I.. \</p>
<p>    -I../../../include/qt3 -I.obj/ \</p>
<p>    -o .obj/FILENAME.o .obj/FILENAME.cpp</p>
<p></p>
<p>and linked the result like this:</p>
<p></p>
<p>$ /usr/src/llvm/dist/bin/llvm-ld \</p>
<p>    -v -stats -native -verify-each -strip-all \</p>
<p>    -o main \</p>
<p>    ... lots of *.o files ... \</p>
<p>    -L/usr/share/qt3/lib -L/usr/X11R6/lib \</p>
<p>    -lcrypto -lusb -lutil -lqt-mt -lXext -lX11 -lm -lpthread</p>
<p></p>
<p>This time LLVM did not eat too much memory. I got a nice</p>
<p>executable.</p>
<p></p>
<p></p>
<p>$ size main</p>
<p>   text    data     bss     dec     hex filename</p>
<p>1170074   74586    8456 1253116  131efc main</p>
<p></p>
<p>The same compiled with "g++ (GCC) 4.1.2 20061115 (prerelease)</p>
<p>(Debian 4.1.1-21)" and "GNU ld version 2.17 Debian GNU/Linux"</p>
<p>gave me:</p>
<p></p>
<p>$ size main</p>
<p> 952074    8572    4528  965174   eba36 main</p>
<p></p>
<p>In the gcc case, I link with "g++", with link options "-Wl,--gc-sections -Wl,-O2 -Wl,--as-needed</p>
<p>-Wl,--enable-new-dtags -Wl,-s"</p>
<p></p>
</body></html>