Creation of the NO_SSP build knob

Ruslan Ermilov ru at FreeBSD.org
Fri Sep 5 14:32:24 UTC 2008


On Fri, Sep 05, 2008 at 09:00:28AM +0200, Jeremie Le Hen wrote:
> Dag-Erling,
> 
> On Thu, Sep 04, 2008 at 09:26:28PM +0200, Dag-Erling Sm?rgrav wrote:
> > Jeremie Le Hen <jeremie at le-hen.org> writes:
> > > If SSP belongs to this list, then NO_SSP is an alias for WITHOUT_SSP.
> > > But it will still not be possible to use WITH_SSP in src.conf or
> > > command-line.
> > > [...]
> > > Shouldn't we have a knob that overrides whatever the user says, only for
> > > internal use in the source tree?  That was my original intent when
> > > asking if I could add NO_SSP.
> > 
> > That's *exactly* what NO_* does.  Just add SSP to that list and replace
> > WITHOUT_SSP with NO_SSP wherever it occurs in Makefiles in the tree.
> 
> I've just tested it with NO_SSP and I can confirm it doesn't work
> despite the explicit comment above stating otherwise.  By the way, the
> code is nearly identical between the supported options and the compat
> ones, I don't see how it could override the user settings:
> 
This is not the way the things were designed to work.

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

WITH_*/WITHOUT_* are for users, and MK_* are for makefiles.

NO_*'s are mainly for backwards compatibility and (to the lesser
extent) to support some of the makefile buzzwords like NO_MAN.

There's no possibility to easily make what you want, i.e., disable
SSP for some parts of the tree.  Doing it for particular makefiles
OTOH should be pretty easy, by starting a makefile with the
following two lines:

.include <bsd.own.mk>
MK_SSP=no

bsd.own.mk will set MK_SSP as per default ("yes"), then possibly
reset it to "no" if a user set WITHOUT_SSP (either on a command
line, in /etc/make.conf, or in environment), and then the second
line will unconditionally reset it to "no".

This will work in the SSP case, but may not work in general
because some options have dependencies.  Fortunately, cases like
this are rare.  (There are several makefiles in the tree that
already do this; "grep ^MK_" to see them.)


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer


More information about the freebsd-hackers mailing list