Page MenuHomeFreeBSD

Only compute the X_COMPILER_*/X_LINKER_* variables when needed
ClosedPublic

Authored by arichardson on Sep 5 2018, 3:00 PM.
Tags
None
Referenced Files
F81649650: D17046.id49487.diff
Fri, Apr 19, 11:20 AM
Unknown Object (File)
Jan 24 2024, 4:59 PM
Unknown Object (File)
Jan 4 2024, 7:49 AM
Unknown Object (File)
Dec 4 2023, 3:50 AM
Unknown Object (File)
Nov 4 2023, 8:51 AM
Unknown Object (File)
Oct 13 2023, 4:54 PM
Unknown Object (File)
Sep 11 2023, 7:57 AM
Unknown Object (File)
Aug 6 2023, 7:55 PM
Subscribers
None

Details

Summary

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.

With this change (and no changes to the sources) the make includes stage
now takes 28 seconds at -j1 instead of 86 seconds.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable