From 8f82d69669538b587b541cd0114f0f298d5c7309 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 20 Nov 2023 17:47:55 +0100 Subject: [PATCH] libcap: Fix static build setting LIBCSTATIC=yes Fixes the build of pkgsStatic.libcap, as it was trying to link to the dinamic libc. From libcap-2.69/progs/Makefile: ... ifeq ($(LIBCSTATIC),yes) LDFLAGS = --static DEPS = ../libcap/libcap.a else # For this build variant override the LDFLAGS to link statically from # libraries within the build tree. If you never want this, use make # DYNAMIC=yes . Note, we can't reliably link statically against glibc # becasuse of https://sourceware.org/bugzilla/show_bug.cgi?id=12491 . LDFLAGS = -Wl,-Bstatic LDFLAGS_SUFFIX = -Wl,-Bdynamic DEPS = ../libcap/libcap.a endif ... --- pkgs/os-specific/linux/libcap/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index 9b23625102ae..3fb3003d77aa 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { "BUILD_CC=$(CC_FOR_BUILD)" "CC:=$(CC)" "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ] ++ lib.optional isStatic "SHARED=no"; + ] ++ lib.optionals isStatic [ "SHARED=no" "LIBCSTATIC=yes" ]; postPatch = '' patchShebangs ./progs/mkcapshdoc.sh