Page MenuHomeFreeBSD

Pass bsd.compiler.mk execution findings to sub-makes.
ClosedPublic

Authored by bdrewery on Oct 15 2015, 6:15 AM.
Tags
None
Referenced Files
F93713739: D3898.id9550.diff
Wed, Sep 11, 9:32 PM
Unknown Object (File)
Thu, Aug 29, 5:09 PM
Unknown Object (File)
Wed, Aug 21, 4:38 PM
Unknown Object (File)
Aug 6 2024, 1:19 AM
Unknown Object (File)
Jul 10 2024, 4:48 AM
Unknown Object (File)
Jun 17 2024, 7:10 AM
Unknown Object (File)
Jun 12 2024, 11:17 PM
Unknown Object (File)
May 8 2024, 1:37 AM
Subscribers

Details

Summary

This is intended to prevent the same != execution in a sub-make for an
already-known value. Similar efforts have gone into ports over the
years.

With 'make -n -n buildworld' you can see a 'cc --version' ran for just
about every Makefile even though CC is unchanged.

For ports at least we just .export the value (using .MAKEFLAGS due to
needing to support fmake). We can't just .export here though since
CC might change in the sub-make, such as if we called it with
${LIB32WMAKE} from Makefile.inc1. So I've cached the value based
on what CC was, along with MACHINE since it seems relevant. The value
is picked up in the child only if these values match.

This uses .export-env so the value can be unset after, otherwise
.export binds to the real var post-exporting.

Test Plan

Not much yet. Universe would be needed and more feedback/testing from
others I think.

Diff Detail

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

Event Timeline

bdrewery retitled this revision from to Pass bsd.compiler.mk execution findings to sub-makes..
bdrewery updated this object.
bdrewery edited the test plan for this revision. (Show Details)
bdrewery added reviewers: imp, bapt.
bdrewery added subscribers: emaste, brooks, ngie.

PATH also needs to be handled as it may pick up a different 'cc'.

brooks edited edge metadata.

Looks good to me. I believe this will work with our build system hack for CHERI where we use a special clang to compile a subset of programs and most libraries (via a lib32-like hack).

This revision is now accepted and ready to land.Oct 15 2015, 9:44 PM

Be sure to test out running a build from 10.2-RELEASE (clang 3.4.1) to 11-CURRENT (clang 3.7.0). Also, checking gcc from ports might be a good idea.

Something is off here as I see a lot of --version calls still in buildworld. It seems Makefile.inc1 needs to include bsd.compiler.mk to help this optimization. Of course in a way that works with all of the different compiler switching in Makefile.inc1.

This revision was automatically updated to reflect the committed changes.