From 3e2ceab20157c37566df2f2ea35d4a6dac95732c Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Sun, 24 Nov 2024 00:40:56 +0100 Subject: [PATCH] boost: fix build for non x86_64 hostPlatforms --- pkgs/development/libraries/boost/generic.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index 94ee8c236423f..eca05e4fcf7a8 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -64,6 +64,16 @@ let "link=${link}" "-sEXPAT_INCLUDE=${expat.dev}/include" "-sEXPAT_LIBPATH=${expat.out}/lib" + ( + # The stacktrace from exception feature causes memory leaks when built + # with libc++. For all other standard library implementations, i.e. + # libstdc++, we must aknowledge this or stacktrace refuses to compile. + # Issue upstream: https://github.com/boostorg/stacktrace/issues/163 + if (stdenv.cc.libcxx != null) then + "boost.stacktrace.from_exception=off" + else + "define=BOOST_STACKTRACE_LIBCXX_RUNTIME_MAY_CAUSE_MEMORY_LEAK" + ) # TODO: make this unconditional ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform ||