about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/libcap
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodrigo.arias@bsc.es>2023-11-20 17:47:55 +0100
committerRodrigo Arias Mallo <rodrigo.arias@bsc.es>2023-11-20 19:22:11 +0100
commit8f82d69669538b587b541cd0114f0f298d5c7309 (patch)
treeb62c57bfa51feac26b5bca403aae06fc13bf32a4 /pkgs/os-specific/linux/libcap
parent5d08323dda0c24cd49594d3ff8bac9810c3620be (diff)
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
  ...
Diffstat (limited to 'pkgs/os-specific/linux/libcap')
-rw-r--r--pkgs/os-specific/linux/libcap/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix
index 9b23625102ae3..3fb3003d77aac 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