From fd766d8ff8534c35a6849d5ff7939ddcb7871c07 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 15 Sep 2023 19:05:55 +0200 Subject: [PATCH] Don't build nanos6 with debug symbols by default --- bsc/nanos6/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bsc/nanos6/default.nix b/bsc/nanos6/default.nix index de0d8e4..4c21d80 100644 --- a/bsc/nanos6/default.nix +++ b/bsc/nanos6/default.nix @@ -11,6 +11,7 @@ , papi , boost , ovni +, enableDebug ? false , enableJemalloc ? true , jemalloc ? null , cachelineBytes ? 64 @@ -75,12 +76,17 @@ in (optional enableJemalloc "--with-jemalloc=${jemalloc}") ++ (optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG"); + postConfigure = lib.optionalString (!enableDebug) '' + # Disable debug + sed -i 's/\([a-zA-Z0-9_]*nanos6_debug[a-zA-Z0-9_]*\)\s*[+]\?=.*/\1 =/g' Makefile.am + ''; + # The "bindnow" flags are incompatible with ifunc resolution mechanism. We # disable all by default, which includes bindnow. hardeningDisable = [ "all" ]; - # Keep debug symbols in the verbose variant of the library - dontStrip = true; + # Keep debug symbols in the debug variant of the library + dontStrip = enableDebug; buildInputs = [ autoconf