about summary refs log tree commit diff
path: root/pkgs/development/libraries/libxcrypt/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/libxcrypt/default.nix')
-rw-r--r--pkgs/development/libraries/libxcrypt/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix
index 067141883977d..d71cb7027570a 100644
--- a/pkgs/development/libraries/libxcrypt/default.nix
+++ b/pkgs/development/libraries/libxcrypt/default.nix
@@ -28,8 +28,18 @@ stdenv.mkDerivation (finalAttrs: {
     "--disable-werror"
   ];
 
-  # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified
-  makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined"] ;
+  makeFlags = let
+    lld17Plus = stdenv.cc.bintools.isLLVM
+      && lib.versionAtLeast stdenv.cc.bintools.version "17";
+  in []
+    # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified
+    ++ lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS+=-no-undefined" ]
+
+    # lld 17 sets `--no-undefined-version` by default and `libxcrypt`'s
+    # version script unconditionally lists legacy compatibility symbols, even
+    # when not exported: https://github.com/besser82/libxcrypt/issues/181
+    ++ lib.optionals lld17Plus [ "LDFLAGS+=-Wl,--undefined-version" ]
+  ;
 
   nativeBuildInputs = [
     perl