[Toybox] The horrible make.sh.

Rob Landley rob at landley.net
Tue Aug 20 03:29:23 PDT 2013


On IRC, noticed this from before the last suspend:
> <dalias> landley, has toybox always used this horrible make.sh? :(
> <dalias> horrible in the sense of: it can't build in parallel,
> doesn't save .o files, ....

Not connected to the net at the moment and it's really a toybox topic,  
so replying to the list and cc'ing you: Yes, it's got a horrible  
make.sh. And it's had it since 2007. And yes, I've pondered redoing it,  
but not gotten around to it.

The original reason for this was to support --build-at-once mode, which  
(at the time) provided better optimization. Unfortunately:

1) The gcc developers aren't capable of making gcc take advantage of  
SMP internally. They've decided that instead of making it threaded,  
they preferred to rewrite it in C++ instead. That adds the extra  
complexity without providing any discernable benefits.

2) Gnu make is so horrible that there's no way to get most builds to  
feed all the files to gcc at once anyway, so they instead did a quick  
parsing pass over the source code to turn it into something more  
proprietary and less comprehensible, stuck that in a special debug  
section of each .o file, and then had the linker do the actual  
compiling, optimization, and code generation.

The thing is, the linker provides the exact same single-processor  
bottleneck that doing gcc *.c does. It just means you don't ahve to  
rewrite your makefiles to call the compiler in a different way to get  
whole tree optimizations.

The reason I haven't yet bothered to rewrite it to try to take  
advantage of parallelism is:

1) make allnoconfig, make menuconfig, switch on the one command you're  
testing, make.

2) If it takes that long to compile, the code's too big.

3) Parallelizing the compile without parallelizing the header search  
and population of generated/*.h doesn't buy you much.

4) Rewriting the darn python help.h generator and making it handle  
subfeatures and merge usage: lines is higher priority.

But yeah, this is a todo item.

Rob
 1376994563.0


More information about the Toybox mailing list