From 33472c371d89c707bcb9754cd1dceb971b0f4084 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 12 Sep 2021 08:38:45 +0100 Subject: [PATCH] libsepol: pull upstream fix for -fno-common compiler Fixes build failure against upstream gcc (defaults -fno-common) --- pkgs/os-specific/linux/libsepol/default.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/libsepol/default.nix b/pkgs/os-specific/linux/libsepol/default.nix index 732ad88c70db..e90c08942096 100644 --- a/pkgs/os-specific/linux/libsepol/default.nix +++ b/pkgs/os-specific/linux/libsepol/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, flex }: +{ lib, stdenv, fetchurl, fetchpatch, flex }: stdenv.mkDerivation rec { pname = "libsepol"; @@ -13,6 +13,20 @@ stdenv.mkDerivation rec { sha256 = "0ygb6dh5lng91xs6xiqf5v0nxa68qmjc787p0s5h9w89364f2yjv"; }; + patches = [ + # upstream build fix against -fno-common compilers like >=gcc-10 + (fetchpatch { + url = "https://github.com/SELinuxProject/selinux/commit/a96e8c59ecac84096d870b42701a504791a8cc8c.patch"; + sha256 = "0aybv4kzbhx8xq6s82dsh4ib76k59qzh2bgxmk44iq5cjnqn5rd6"; + stripLen = 1; + }) + (fetchpatch { + url = "https://github.com/SELinuxProject/selinux/commit/3d32fc24d6aff360a538c63dad08ca5c957551b0.patch"; + sha256 = "1mphwdlj4d6mwmsp5xkpf6ci4rxhgbi3fm79d08h4jbzxaf4wny4"; + stripLen = 1; + }) + ]; + postPatch = lib.optionalString stdenv.hostPlatform.isStatic '' substituteInPlace src/Makefile --replace 'all: $(LIBA) $(LIBSO)' 'all: $(LIBA)' sed -i $'/^\t.*LIBSO/d' src/Makefile