From b01f6c43aff4a675ab408fe3a7a2a84fc306e593 Mon Sep 17 00:00:00 2001 From: Alwin Berger Date: Tue, 23 Feb 2021 19:32:29 +0100 Subject: [PATCH] io: add static linking When executing the programm the libraries were relinking to libm.so and segfaulting Since the libs in question are all <1MB when staticly linked this seemed like an easy workaround To find future regression the interpreter will be called in installCheckPhase io: add install check --- pkgs/development/interpreters/io/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/interpreters/io/default.nix b/pkgs/development/interpreters/io/default.nix index 3b2cb9a57ac..d1f4ac02fc8 100644 --- a/pkgs/development/interpreters/io/default.nix +++ b/pkgs/development/interpreters/io/default.nix @@ -40,6 +40,17 @@ stdenv.mkDerivation { sed -ie \ "s/add_subdirectory(addons)/#add_subdirectory(addons)/g" \ CMakeLists.txt + # Bind Libs STATIC to avoid a segfault when relinking + sed -i 's/basekit SHARED/basekit STATIC/' libs/basekit/CMakeLists.txt + sed -i 's/garbagecollector SHARED/garbagecollector STATIC/' libs/garbagecollector/CMakeLists.txt + sed -i 's/coroutine SHARED/coroutine STATIC/' libs/coroutine/CMakeLists.txt + ''; + + doInstallCheck = true; + + installCheckPhase = '' + $out/bin/io + $out/bin/io_static ''; # for gcc5; c11 inline semantics breaks the build