From aa00bf10d986bf3a022c33be1cb79fdd4dadf438 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 24 Oct 2021 01:15:59 +0300 Subject: added ./configure --enable-debug and make sure that NDEBUG is defined properly * This simplifies writing CFLAGS="-g -O0" CXXFLAGS="-g -O0". * We build "release" binaries by default. NDEBUG will now be defined unless you specify --enable-debug. This enables some optimizations that have long been implemented but were never actually active: * SciTECO shuts down faster since it will not explicitly free memory. On the downside, this would complicate memory debugging with Valgrind/memcheck. * dlmalloc is built with -DINSECURE=1 which is supposedly a bit faster. Some compilers also complained about an unportable preprocessor usage which should now be gone. * All CI builds are now with --enable-debug. This will slow them down but ensure that more code is executed and thus tested. --- contrib/dlmalloc/Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/dlmalloc/Makefile.am b/contrib/dlmalloc/Makefile.am index f9e35dd..223ed13 100644 --- a/contrib/dlmalloc/Makefile.am +++ b/contrib/dlmalloc/Makefile.am @@ -8,8 +8,10 @@ # for increased portability. There is also AC_LIBOBJ, but it's usually for defining sources of # replacement libraries. -AM_CPPFLAGS = -DINSECURE='defined(NDEBUG)' -DNO_MALLINFO=1 -DNO_MALLOC_STATS=1 \ - -DUSE_LOCKS=1 -DUSE_DL_PREFIX +AM_CPPFLAGS = -DNO_MALLINFO=1 -DNO_MALLOC_STATS=1 -DUSE_LOCKS=1 -DUSE_DL_PREFIX +if !DEBUG +AM_CPPFLAGS += -DINSECURE=1 +endif # FIXME: This optimization is still broken as of GCC v9.3.0. # This is a known GCC bug, triggered by memset() in calloc(). -- cgit v1.2.3