From 6005700c53708545467bbe12d30399b1e10655d6 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Mon, 8 Feb 2021 14:08:17 +0100 Subject: [PATCH] libsemanage: fix build by disabling clobbered warning This turns the GCC clobbered error into a warning which should fix: ``` emanage_store.c: In function 'semanage_exec_prog': semanage_store.c:1278:6: error: variable 'i' might be clobbered by 'longjmp' or 'vfork' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wclobbered-Werror=clobbered8;;] 1278 | int i; | ^ cc1: all warnings being treated as errors ``` --- pkgs/os-specific/linux/libsemanage/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/os-specific/linux/libsemanage/default.nix b/pkgs/os-specific/linux/libsemanage/default.nix index d7255ac4587b..11a6f2755d4c 100644 --- a/pkgs/os-specific/linux/libsemanage/default.nix +++ b/pkgs/os-specific/linux/libsemanage/default.nix @@ -30,6 +30,16 @@ stdenv.mkDerivation rec { "DEFAULT_SEMANAGE_CONF_LOCATION=$(out)/etc/selinux/semanage.conf" ]; + # The following turns the 'clobbered' error into a warning + # which should fix the following error: + # + # semanage_store.c: In function 'semanage_exec_prog': + # semanage_store.c:1278:6: error: variable 'i' might be clobbered by 'longjmp' or 'vfork' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wclobbered-Werror=clobbered8;;] + # 1278 | int i; + # | ^ + # cc1: all warnings being treated as errors + NIX_CFLAGS_COMPILE = [ "-Wno-error=clobbered" ]; + installTargets = [ "install" ] ++ optionals enablePython [ "install-pywrap" ]; meta = removeAttrs libsepol.meta ["outputsToInstall"] // {