Merge pull request #309884 from rrbutani/fix/libxcrypt-lld-17

libxcrypt: fix linking with `lld` 17+

authored by Atemu and committed by GitHub d257cf5e f86af01d

+12 -2
+12 -2
pkgs/development/libraries/libxcrypt/default.nix
··· 28 28 "--disable-werror" 29 29 ]; 30 30 31 - # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified 32 - makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined"] ; 31 + makeFlags = let 32 + lld17Plus = stdenv.cc.bintools.isLLVM 33 + && lib.versionAtLeast stdenv.cc.bintools.version "17"; 34 + in [] 35 + # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified 36 + ++ lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS+=-no-undefined" ] 37 + 38 + # lld 17 sets `--no-undefined-version` by default and `libxcrypt`'s 39 + # version script unconditionally lists legacy compatibility symbols, even 40 + # when not exported: https://github.com/besser82/libxcrypt/issues/181 41 + ++ lib.optionals lld17Plus [ "LDFLAGS+=-Wl,--undefined-version" ] 42 + ; 33 43 34 44 nativeBuildInputs = [ 35 45 perl