[BusyBox] Compilation Speed

busybox at rich-paul.net busybox at rich-paul.net
Thu Jul 28 22:45:57 MDT 2005


OK, that one baked my noodle for a while ... the excess 'no-arg' calls
are happening due to the 'EXPORT_ALL_VARIABLES'.  The values of
late-binding variables are expanded, so they can be added to the
environment.

This patch:
Index: Rules.mak
===================================================================
--- Rules.mak   (revision 10955)
+++ Rules.mak   (working copy)
@@ -140,6 +140,7 @@
                -malign-functions=0 -malign-jumps=0 -malign-loops=0)
 endif
 OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer
+check_gcc=$(if $1,$(error too late for check_gcc))
 
 #
 #--------------------------------------------------------

does two things:
	avoids the fork/exec when the environment is exported
	prevents accidental usage of check_gcc after it changes.

I was just undefining check_gcc, but if somebody IS using it elsewhere,
it's just too cruel to hose them without warning.  Maybe using
$(warning) would be better.  Dunno.

BTW, does busybox try to be non-gnu-make friendly?

On Thu, Jul 28, 2005 at 11:18:51PM -0400, Mike Frysinger wrote:
> On Thursday 28 July 2005 03:39 pm, Rob Landley wrote:
> > On Thursday 28 July 2005 12:48, busybox at rich-paul.net wrote:
> > > I've noticed that when I compile busybox on my laptop, it compiles more
> > > slowly than one would expect, and although it's a (more-or-less)
> > > multiprocessor system and I use -j5, make never seems to run more than
> > > one job at a time.
> > >
> > > I believe I have found the culprit:  each time a file is compiled, gcc
> > > runs about 5 times.  This is because the $(check_gcc) macros and the
> > > TARGET_ARCH macros are late binding.
> > >
> > > The attached patch cuts the compilation time by 66%, from 1.5 minutes to
> > > 30 seconds.  Your mileage may very.  These statements have not been
> > > evaluated by the FDA.
> >
> > Applied.
> 
> ive done some more tweaks such that now the $(CC) is only executed once for 
> most people and four times for i386 (since i386 has some extra calls) ...
> 
> however, i had to introduce this check to check_gcc:
> if [ "$(1)" != "" ]
> because for some reason or another, check_gcc was being called by something 
> without any arguments ... can anyone else verify /  figure this out ?
> 
> the way i tested this stuff is to modify check_gcc to read:
> check_gcc=$(shell \
>     echo "$(1)" >> $(HOME)/check ; \
>     ...
> then i do `rm -f ~/check` followed by `make clean -s` ... reviewing the output 
> of ~/check would show a lot of empty lines :(  doing `make -s` would show a 
> lot more empty lines which meant gcc was executed a ton of times 
> needlessly ...
> -mike
> _______________________________________________
> busybox mailing list
> busybox at mail.busybox.net
> http://busybox.net/mailman/listinfo/busybox

-- 
Never let 'em tell you the drug war is a total failure.  It's preventing sick
people from getting enough pain medication, isn't it?

http://radical-centrist.blogspot.com


More information about the busybox mailing list