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)
Wed, Dec 18, 5:08 AM
Unknown Object (File)
Mon, Dec 2, 4:07 AM
Unknown Object (File)
Fri, Nov 29, 12:08 PM
Unknown Object (File)
Fri, Nov 29, 10:01 AM
Unknown Object (File)
Nov 25 2024, 9:49 PM
Unknown Object (File)
Nov 25 2024, 2:33 PM
Unknown Object (File)
Nov 24 2024, 11:35 PM
Unknown Object (File)
Nov 22 2024, 8:18 PM
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 770
Build 770: 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.