On Mon, Feb 16, 2009 at 11:32 PM, Walter Bright <newshou...@digitalmars.com> wrote: > Jarrett Billingsley wrote: >> >> http://d.puremagic.com/issues/show_bug.cgi?id=424 > > > I just added this to the bug report: > > ====================== > The compiler already has a switch to generate multiple obj files from one > source file: -multiobj. I use it for debugging. But it would be a royal pain > to use if there's a lot.
Why isn't it documented? And you're damn right it would be a pain. Especially when I'm compiling three external libraries and a large library of my own. > A better way is to compile to a library with the -lib switch. That splits > the module into a zillion obj files, and stuffs them all into the library. > Then, link with the library (the main() program will still have to be > separate). > ======================= > > Can you give it a try? Not easily. Under my normal compilation scheme I'm not building a library and I have no idea how well bud/rebuild will cope with a zillion object files. In any case the -lib switch is just sidestepping the problems with the linker and object format by pushing some of the linker's responsibilities into the compiler. DMD (and the D language itself, if you want to count the 16MB limit on static data, which has no place in a portable language specification!) already makes far too many concessions to deal with the ridiculous constraints of the linker. Please, stop designing around the problem and fix it.