Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get my very large program to link?

Our next product has grown too large to link on a machine running 32-bit Windows. The sum total of all the lib files exceeds 2Gb and can only be linked on a 64-bit Windows machine. Eventually we will exceed that boundary, since our software tends to grow rather than contract and we are using a 32-bit linker (MS Visual Studio 2005): we expect to hit trouble when our lib size total exceeds 3Gb.

How can I reduce the size of the .lib files, or the .obj files without trimming code? For example, we use a lot of templates: is there any way of reducing their footprint? Is there any way of finding out what's causing the bloat from examining the .lib/.obj files? Can this be automated rather than inspected by eye? 2.5Gb is a lot of text to peer through and compare.

External constraints prevent us from shipping as anything other than a single .exe, so a DLL solution is not available.

like image 445
hatcat Avatar asked Jul 22 '10 10:07

hatcat


1 Answers

I had once been working on a project with several MLoC. While ours would still link on a 32bit machine, link times where abysmal and became a major problem, because developers were reduced to only get a dozen edit-compile-test cycles done per workday. (Compile times were handled pretty well by doing distributed compilation.)

We switched to dynamic linking. That increased startup time, but this could be managed by delay-loading of DLLs.

like image 172
sbi Avatar answered Oct 17 '22 10:10

sbi