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
Unknown Object (File)
Sat, Nov 9, 5:57 AM
Unknown Object (File)
Tue, Nov 5, 1:10 PM
Unknown Object (File)
Mon, Oct 28, 9:37 PM
Unknown Object (File)
Fri, Oct 18, 7:22 PM
Unknown Object (File)
Fri, Oct 18, 11:12 AM
Unknown Object (File)
Wed, Oct 16, 12:20 PM
Unknown Object (File)
Tue, Oct 15, 8:37 AM
Unknown Object (File)
Oct 14 2024, 5:46 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 Passed
Unit
No Test Coverage
Build Status
Buildable 775
Build 775: arc lint + arc unit

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.