Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Nov 2018 23:10:48 +0000
From:      Alexander Richardson <arichardson@freebsd.org>
To:        bdrewery@freebsd.org
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r339636 - in head: . share/mk
Message-ID:  <CA%2BZ_v8rcRXR86xnQs32Vgm5q%2B8DcjJJNHJRZOOuHUQrWSB19zQ@mail.gmail.com>
In-Reply-To: <9612d267-91dc-b1ee-7530-284376f08f08@FreeBSD.org>
References:  <201810230631.w9N6VPR4008554@repo.freebsd.org> <9612d267-91dc-b1ee-7530-284376f08f08@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 5 Nov 2018 at 23:00, Bryan Drewery <bdrewery@freebsd.org> wrote:
>
> On 10/22/2018 11:31 PM, Alex Richardson wrote:
> > Author: arichardson
> > Date: Tue Oct 23 06:31:25 2018
> > New Revision: 339636
> > URL: https://svnweb.freebsd.org/changeset/base/339636
> >
> > Log:
> >   Only compute the X_COMPILER_*/X_LINKER_* variables when needed
> >
> >   When building CheriBSD we have to set XLD/XCC/XCFLAGS on the command line.
> >   This triggers the $XCC != $CC case in bsd.compiler.mk (and the same for LD
> >   in bsd.linker.mk) which causes it to call ${XCC} --version and
> >   ${XLD} --version (plus various awk+sed+echo calls) in every subdirectory.
> >   For incremental builds and stages that only walk the source tree this is
> >   often the majority of the time spent in that directory.
> >
> ...
>
> >   By only computing the value of the X_COMPILER_*/X_LINKER_* variables if
> >   _WANT_TOOLCHAIN_CROSS_VARS is set we can reduce the number of cc/ld calls
> >   to once per build stage instead of once per recursive make.
>
> This sounds wrong. bsd.compiler.mk *already* handles that kind of thing
> by exporting its computations. Adding a second hack for a similar
> problem isn't the right solution.
>

I added debug .info statements for every time bsd.compiler.mk was
running cc --version and it was always running it for $XCC during make
buildworld.
As far as I can tell this happens because $CC and $XCC no longer match.
I believe the problem is that the toplevel makefile runs the cross
stages with CC="${XCC} ${XCFLAGS}" so if you have XCFLAGS set in your
environment $CC will never be equal to $XCC.
This also means there is not cached variable for $XCC since it was
computed for "${XCC} ${XCFLAGS}" rather than $XCC .

This patch massively reduced the incremental build time for CheriBSD
but if you can suggest I better fix that would be great.

Alex



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BZ_v8rcRXR86xnQs32Vgm5q%2B8DcjJJNHJRZOOuHUQrWSB19zQ>