On 26/03/2019 20:35, Ken Moffat via blfs-dev wrote:
> I originally posted most of this to lfs-dev, thinking that since
> meson was in LFS there must be something there which used it.  But
> AFAICS everything which uses meson is in BLFS, so moving this to
> here, with some updated details.
> 
> I was galancing at phoronix this afternoon (often taken over by the
> peanut gallery, or dubious measurements, but sometimes interesting).
> https://www.phoronix.com/scan.php?page=news_item&px=Fedora-Mesa-Meson-Debug-Build
> 
> AFAICS we do NOT specify buildtype on any meson packages, but on
> cmake we usually specify Release builds ?
> 
> It appears that fedora were specifying 'plain', and that left debug
> assertions in the build, which slowed down some things in games
> (e.g. loading levels).
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=109939#c16
> 
> From that, the default for *mesa* is 'debugoptimized' which seems to
> be what we are using.  I've now got verbose output for my test
> builds (ninja -v) and the default setup does not specify -DNDEBUG.
> 
> On the current machine's setup (not building mesademos for this, I
> think I'm enabling everything in mesa, including wayland backend):
> 
> Build by the book, with logs not in the measurement:
>       mesa-19.0.0 1.5 GB
>       DESTDIR 611 MB
> 
> Specifying -Dbuildtype=release:
>       mesa-19.0.0 374 MB
>       DESTDIR 91 MB
> 
> That uses -O3 (there are suggestions distros might not want to use
> that), and it passes -DNDEBUG.
> 
> On my real build at the weekend, the log was unclear about the
> commands actually used (hence my need for ninja -v), but it noticed
> my CFLAGS and CXXFLAGS (-O2 -march=native).
> 
> Doing another release build, but passing those (some parts are C,
> others are C++) the initial -O3 for the release is early in the
> arguments, my -O2 -march=native come much later so take effect.
> With that (although I probably only want to pass the march part if
> doing a release build on a fast machine) I get
>       mesa-19.0.0 345 MB
>       DESTDIR 75 MB.
> 
> Summary: for mesa, -Dbuildtype=release looks like the way to go.
> 
> The meson docs are at https://mesonbuild.com/Running-Meson.html and
> my reading of that page suggests that 'debugoptimized' is not always
> the default.
> 

Note that for mesa -Db_ndebug=true can be used to disable assertions (the
default is "if_release"). Then "-O2 -g" is still passed. You can also pass
-Db_nebug=false with -Dbuildtype=release, of course...

BTW, using gdb with "-O2 -g" does not work well for me (I'm not a great user
of gdb, so I might miss some option there): stepping gets confused if some
part of the code gets optimized out, or reordered for optimization.

Note that you may have access to all the options to a specific package by
first running "meson setup" in a "build" directory (note the source), then
"meson configure".

Pierre
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to