Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jul 2020 14:40:23 +0100
From:      Edward Tomasz Napierala <trasz@freebsd.org>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r353283 - in head: lib lib/libstats share/man/man3 share/mk sys/amd64/conf sys/conf sys/kern sys/sys tools/build/options
Message-ID:  <20200723134023.GA2314@brick>
In-Reply-To: <CACNAnaEiBgaaS-5Gc=bhPQmLNfMrm7ruK5yDrv-hM=aOYfpw4g@mail.gmail.com>
References:  <201910071905.x97J56t0039812@repo.freebsd.org> <CACNAnaEiBgaaS-5Gc=bhPQmLNfMrm7ruK5yDrv-hM=aOYfpw4g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 0714T0838, Kyle Evans wrote:
> On Mon, Oct 7, 2019 at 2:05 PM Edward Tomasz Napierala
> <trasz@freebsd.org> wrote:

[..]

> > Added: head/lib/libstats/Makefile
> > ==============================================================================
> > --- /dev/null   00:00:00 1970   (empty, because file is newly added)
> > +++ head/lib/libstats/Makefile  Mon Oct  7 19:05:05 2019        (r353283)
> > @@ -0,0 +1,14 @@
> > +# $FreeBSD$
> > +
> > +LIB=           stats
> > +SHLIBDIR?=     /lib
> > +SHLIB_MAJOR=   0
> > +SRCS=          subr_stats.c
> > +
> > +# To debug, comment WITHOUT_ASSERT_DEBUG= and uncomment CFLAGS:=
> > +WITHOUT_ASSERT_DEBUG=
> > +#CFLAGS:=${CFLAGS:C/-O[0-9]/-O0 -g3/} -DDIAGNOSTIC
> > +
> 
> Hi,
> 
> What exactly is going on here? mjg pointed this out when we were
> looking at some runtime assertion related stuff. This looks like it's
> imposing an opinion of how it should be built and circumvent the
> normal way of doing things. Ideally, this would something more like
> with the following patch to just make sure that the CFLAGS
> manipulations properly happen when ASSERT_DEBUG is flipped on, and
> interested parties that don't want the assertions should turn
> ASSERT_DEBUG off. If there's a really really solid reason for libstats
> having its own knob, that should be considered as a formal knob rather
> than the ad-hockery that appears above. I'm not sure that the
> following patch is entirely correct, though; -DDIAGNOSTIC seems to be
> needed for assertions, but the -O$n replacement with -O0 -g3 looks
> like it should perhaps be split out to a different knob or..
> something.

The main chunk of stats(3) source is shared between libstats(3)
and the kernel.  Thus, DIAGNOSTICS means the same thing: it's not
the usual assertions, but an additional debugging mechanism that's
supposed to be off by default.  Except that we don't have a global
knob to turn "userland DIAGNOSTICS" on, so libstats(3) uses its own.

We probably shouldn't be overriding WITHOUT_ASSERT_DEBUG, though.

[..]




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200723134023.GA2314>