Page MenuHomeFreeBSD

src.sys.obj.mk export OBJTOP
Needs ReviewPublic

Authored by sjg on Thu, Jan 22, 1:03 AM.
Tags
None
Referenced Files
F142743029: D54819.id170223.diff
Thu, Jan 22, 11:58 PM
F142724567: D54819.diff
Thu, Jan 22, 5:33 PM
F142706898: D54819.id.diff
Thu, Jan 22, 12:29 PM
F142703621: D54819.diff
Thu, Jan 22, 11:15 AM
F142703049: D54819.id.diff
Thu, Jan 22, 11:03 AM
F142701175: D54819.id170222.diff
Thu, Jan 22, 10:21 AM
F142699929: D54819.diff
Thu, Jan 22, 9:55 AM
F142699797: D54819.id170223.diff
Thu, Jan 22, 9:52 AM

Details

Reviewers
emaste
imp
jrtc27
Summary

It is necessary to export OBJTOP when it is being used
by MAKEOBJDIR, otherwise we get invalid expansions which
lead to attempts to use directories like /bin /etc /lib as .OBJDIR

Since OBJTOP may have variables like ${MACHINE} we need to export
it in such a manner that these will be correctly evaluated, so
like MAKEOBJDIR double the $'s and use .export-env OBJTOP before
evaluating it for use.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70050
Build 66933: arc lint + arc unit

Event Timeline

sjg requested review of this revision.Thu, Jan 22, 1:03 AM

Remove all but the last := for OBJTOP

Do we need to worry about $s in OBJROOT?

share/mk/src.sys.obj.mk
95

Is there a risk this will propagate to sub makes where one of the other branches should be taken?

Do we need to worry about $s in OBJROOT?

To the extent I grok the intent of this arrangement, I don't think so. When they are going to add $${MACHINE} etc to OBJTOP they use ${OBJROOT:H} to remove $${TARGET} etc from exported OBJROOT.

share/mk/src.sys.obj.mk
95

That will certainly happen - can't work otherwise, but whether that is a "risk" I don't know.

FWIW my normal builds set *all* this stuff in env before running make, and have never seen a problem, but I only use buildworld and only to check I didn't break it.

I could only reproduce these issues by running make with none of this stuff in env to begin with.