On Thu, Mar 28, 2019 at 11:46:06AM -0500, Bruce Dubbs via blfs-dev wrote:
> On 3/27/19 10:56 PM, Ken Moffat via blfs-dev wrote:
>
> [snip]
>
> > Compared to meson, a much greater use of -DNDEBUG. I have no idea
> > if CFLAGS, CXXFLAGS supplied in the environment override these
> > options.
> >
> > But I think we ought to have something in Notes on Building Software
> > about the cmake defaults, and I'm assuming that -DNDEBUG similarly
> > disables runtime assertions which can slow the programs or libraries
> > down if they ar present.
>
> Confirming.
>
> $ man assert
> ...
> If expression is false (i.e., compares equal to zero), assert() prints an
> error message to standard error and terminates the program by calling
> abort(3).
> ...
> If the macro NDEBUG is defined at the moment <assert.h> was last
> included, the macro assert() generates no code, and hence does nothing
> at all. It is not recommended to define NDEBUG if using assert() to detect
> error conditions since the software may behave non-deterministically.
> ========
> We probably do NOT want to disable asserts when running tests, so it gets
> complicated.
>
> -- Bruce
Thanks for looking it up. Now that I understand why meson was
reverted, I've installed the older version. And I do think we are
maybe too keen to apply non-security updates.
Four points so far:
1. The default buildtype is still release (although only shown when
you specify a buildtype), i.e. no change betwen 0.49.2 and
0.50.0.
2. With 0.49.2 the release build was marginally smaller.
3. Although docs say it uses -O3 and -DNDEBUG, I noticed that the
last target for Mesa used -O1 (although the initial target
certainly used -O3), and also that -DNDEBUG might only show if
a package has somehow enabled debug assertions. I did not log
this build, but builds on other packages showed a lack of
-DNDEBUG.
4. On the packages which had tests, no difference in the results.
But since none of those probably had debug assertions, that is
not a surprise.
I guess that -Dbuildtype=release might not always be appropriate,
so I'm not going to blindly recommend it. But for mesa it makes
a lot of sense.
Will look at some cmake packages later. I've now created #11872 for
this.
ĸen
--
It is said that there are two great unsolved problems in computer
science: naming, cache invalidation, and off-by-one errors.
-- Ben Bullock
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page