Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/share/mk



Module Name:    src
Committed By:   riastradh
Date:           Wed Oct  7 00:59:11 UTC 2026

Modified Files:
        src/share/mk: bsd.own.mk

Log Message:
bsd.own.mk: Respect USE_FORT even if defined after bsd.own.mk.

Using (a chain of logic that boils down to)

.if ${USE_FORT:Uno} != "no"
CPPFLAGS+=      -D_FORTIFY_SOURCE=2
.endif

expands USE_FORT eagerly, so if USE_FORT was not already defined before
including <bsd.own.mk>, it's too late after.

Using (a chain of logic that boils down to)

CPPFLAGS+=      ${${USE_FORT:Uno} != "no":?-D_FORTIFY_SOURCE=2:}

expands USE_FORT lazily, so it's only when CPPFLAGS itself is expanded
-- usually in a recipe, after all variable assignments, prerequisite
lists, and .directives have been processed -- that USE_FORT is
expanded.

This way, all of the Makefiles that do

.include <bsd.own.mk>
USE_FORT?=      yes

will actually get fortify as intended!

PR lib/60858: fortuitous embarrassment: fortify is all kinds of busted


To generate a diff of this commit:
cvs rdiff -u -r1.1487 -r1.1488 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index