From 22965d84d5e57307d4f6f02d32b50adac2cbb6bb Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 24 Nov 2020 09:48:34 -0500 Subject: sssd: fix build on glibc-2.32 For https://hydra.nixos.org/build/128488320 which errored with: src/responder/nss/nss_cmd.c:733:16: error: 'nss_setnetgrent' redeclared as different kind of symbol 733 | static errno_t nss_setnetgrent(struct cli_ctx *cli_ctx, | ^~~~~~~~~~~~~~~ In file included from ./src/sss_client/sss_cli.h:28, from ./src/db/sysdb.h:27, from src/responder/nss/nss_cmd.c:26: /nix/store/a2n8nrsf215x01a7fv8l94crdjwf69pa-glibc-2.32-dev/include/nss.h:184:25: note: previous declaration of 'nss_setnetgrent' was here 184 | typedef enum nss_status nss_setnetgrent (const char *, struct __netgrent *); | ^~~~~~~~~~~~~~~ make[2]: *** [Makefile:17818: src/responder/nss/nss_cmd.o] Error 1 make[2]: Leaving directory '/build/sssd-1.16.4' make[1]: *** [Makefile:33824: all-recursive] Error 1 make[1]: Leaving directory '/build/sssd-1.16.4' make: *** [Makefile:10123: all] Error 2 --- pkgs/os-specific/linux/sssd/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/os-specific/linux/sssd/default.nix b/pkgs/os-specific/linux/sssd/default.nix index 22e2da79c8c..537764e0c73 100644 --- a/pkgs/os-specific/linux/sssd/default.nix +++ b/pkgs/os-specific/linux/sssd/default.nix @@ -54,6 +54,16 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--with-sudo") ''; + preBuild = '' + # glibc-2.32 includes a full set of NSS stub module declarations + # that conflict with the ones in sssd source. Define _NSS_H to + # prevent them from breaking the compilation, but just for this + # one file. + cat >> Makefile <