make buildkernel figure out compiler type..

John-Mark Gurney jmg at funkthat.com
Tue Jan 28 01:14:41 UTC 2014


Brooks Davis wrote this message on Mon, Jan 27, 2014 at 11:28 -0600:
> On Fri, Jan 24, 2014 at 12:01:42PM -0800, John-Mark Gurney wrote:
> > When I was building armeb, I would often specify the correct compiler
> > on buildtools/kernel-tools, but then when I went to buildkernel, I
> > would forget...  So, I figured out if we just drop COMPILER_TYPE from
> > KMAKEENV, the right magic will be executed to figure out which of
> > clang/gcc should be used...
> > 
> > $ svn diff Makefile.inc1 
> > Index: Makefile.inc1
> > ===================================================================
> > --- Makefile.inc1       (revision 260499)
> > +++ Makefile.inc1       (working copy)
> > @@ -451,7 +451,7 @@ IMAKE_MTREE=        MTREE_CMD="nmtree ${MTREEFLAGS}"
> >  .endif
> >  
> >  # kernel stage
> > -KMAKEENV=      ${WMAKEENV}
> > +KMAKEENV=      ${WMAKEENV:NCOMPILER_TYPE=*}
> >  KMAKE=         ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
> >  
> >  #
> > 
> > Comments?
> 
> If COMPILER_TYPE isn't set then every submake will need to figure out
> which compiler is in use.  That's not too expensive for a build without
> modules, but is potentially quite expensive with, hence the passing of
> COMPILER_TYPE.  I'm not convinced the tradeoff is worth it for a little
> edge-case user convenience.

Interestingly, I decided to try to test this out, and I couldn't measure
a performance difference between the two..  This was using a "make
buildkernel -j 8" on amd64 which builds all the modules and I couldn't
measure a performance difference between the two...

After seeing an output of make -dA, I doubt executing a couple more
commands will really make that much of a measurable difference...  Also,
won't it be set once at the top?  If not, why don't we export
COMPILER_TYPE when we set it, then that'd solve your issue? right?

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-hackers mailing list