Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from glibc's libcrypt to libxcrypt #181764

Merged
merged 117 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
ff30c89
glibc: make crypt support optional
mweinelt Jul 16, 2022
7c29dcb
libxcrypt: use tarball src, prune dependencies
mweinelt Jul 17, 2022
a369108
perl: allow building without libcrypt
mweinelt Jul 20, 2022
e36bd3c
libxcrypt: build using perl without libcrypt support
mweinelt Jul 20, 2022
3624ac2
perl: fix build with libxcrypt
fpletz Sep 26, 2022
0097f57
gcc11: fix build with libxcrypt
fpletz Sep 24, 2022
495e650
llvmPackages_11.compiler-rt: fix build with libxcrypt
fpletz Sep 27, 2022
194d852
cpython: fix build with libxcrypt
fpletz Sep 24, 2022
872c524
cyrus_sasl: fix build with libxcrypt
fpletz Sep 24, 2022
44a73d0
libxslt: fix build with libxcrypt
fpletz Sep 24, 2022
2c2fde9
apparmor: fix build with libxcrypt
fpletz Sep 24, 2022
5df544a
pam: enable libxcrypt by default
fpletz Sep 24, 2022
7442422
shadow: fix build with libxcrypt
fpletz Sep 24, 2022
f6011b2
systemd: fix build with libxcrypt
fpletz Sep 24, 2022
f9090d5
libxcrypt: fix build with musl
fpletz Sep 26, 2022
32e7482
nixos/tests/shadow: new hashes support with libxcrypt
fpletz Sep 26, 2022
e8748e2
accountsservice: fix build with libxcrypt
fpletz Sep 27, 2022
dd331ad
openldap: fix build with libxcrypt
fpletz Sep 27, 2022
ae4e703
tdb: fix build with libxcrypt
fpletz Sep 27, 2022
77a7b43
aprutil: fix build with libxcrypt
fpletz Sep 27, 2022
3028bec
apacheHttpd: fix build with libxcrypt
fpletz Sep 27, 2022
cc9be15
alpine: fix build with libxcrypt
fpletz Sep 27, 2022
5b572c5
talloc: fix build with libxcrypt
fpletz Sep 27, 2022
52f2785
vsftpd: fix build with libxcrypt
fpletz Sep 27, 2022
c1da199
opensmtpd: fix build with libxcrypt
fpletz Sep 27, 2022
057ae3d
llvmPackage_14.compiler-rt: fix build with libxcrypt
fpletz Sep 27, 2022
be9bc07
screen: fix build with libxcrypt
mweinelt Sep 27, 2022
43327d2
pppd: fix build with libxcrypt
mweinelt Sep 27, 2022
728c97f
pppd: inherit nixos test into passthru.tests
mweinelt Sep 27, 2022
fd94457
open-vm-tools: fix build with libxcrypt
mweinelt Sep 27, 2022
d438cee
conserver: fix build with libxcrypt
fpletz Sep 29, 2022
71dad51
dante: fix build with libxcrypt
fpletz Sep 29, 2022
c82e7ee
hiawatha: fix build with libxcrypt
fpletz Sep 29, 2022
5c34a53
ircdHybrid: fix build with libxcrypt
fpletz Sep 29, 2022
ce67773
libcli: fix build with libxcrypt
fpletz Sep 29, 2022
f51c3fd
ldapvi: fix build with libxcrypt
mweinelt Sep 29, 2022
d017316
atheme: fix build with libxcrypt
mweinelt Sep 29, 2022
dbf9333
xorg.xdm: fix build with libxcrypt
mweinelt Sep 29, 2022
0465c23
wmic-bin: fix build with libxcrypt
mweinelt Sep 29, 2022
555d39b
libreswan: fix build with libxcrypt
mweinelt Sep 29, 2022
167544c
tengine: fix build with libxcrypt
mweinelt Sep 29, 2022
3575e57
libguestfs: fix build with libxcrypt
fpletz Sep 29, 2022
ec31b96
leafnode: fix build with libxcrypt
fpletz Sep 29, 2022
84eda8b
lsh: fix build with libxcrypt
fpletz Sep 29, 2022
31e5ad8
pgpool: fix build with libxcrypt
fpletz Sep 29, 2022
47945f2
groonga: fix build with libxcrypt
fpletz Sep 29, 2022
da15c9c
mailutils: fix build with libxcrypt
fpletz Sep 29, 2022
2a7df1a
popa3d: fix build with libxcrypt
fpletz Sep 29, 2022
870b0eb
tcsh: fix build with libxcrypt
mweinelt Sep 29, 2022
c7b0317
swiProlog: fix build with libxcrypt
mweinelt Sep 29, 2022
7f0e9f0
sumo: fix build with libxcrypt
mweinelt Sep 29, 2022
eb2ed86
toybox: fix build with libxcrypt
mweinelt Sep 29, 2022
aac6de8
gcc10: fix build with libxcrypt
mweinelt Sep 29, 2022
21c552e
gcc12: fix build with libxcrypt
mweinelt Sep 29, 2022
126319f
xrootd: fix build with libxcrypt
fpletz Sep 29, 2022
897f5b2
pounce: fix build with libxcrypt
fpletz Sep 29, 2022
2939285
uwsgi: fix build with libxcrypt
fpletz Sep 29, 2022
a1c07a6
super: fix build with libxcrypt
fpletz Sep 29, 2022
e1f8bfb
policycoreutils: fix build with libxcrypt
fpletz Sep 29, 2022
77c50b0
pies: fix build with libxcrypt
fpletz Sep 29, 2022
eee1cec
partimage: fix build with libxcrypt
fpletz Sep 29, 2022
55a5763
otpw: fix build with libxcrypt
fpletz Sep 29, 2022
f9df47f
zeroc-ice: fix build with libxcrypt
fpletz Sep 30, 2022
2b899ee
luaPackages.luaposix: fix build with libxcrypt
fpletz Sep 30, 2022
fe91064
monit: fix build with libxcrypt
fpletz Sep 30, 2022
e963dde
libfilezilla: fix build with libxcrypt
fpletz Sep 30, 2022
2e7e473
libsigrokdecode: fix build with libxcrypt
fpletz Sep 30, 2022
67408de
hylafaxplus: fix build with libxcrypt
fpletz Sep 30, 2022
f0f14f1
dropbear: fix build with libxcrypt
fpletz Sep 30, 2022
64e160c
kodi: fix build with libxcrypt
fpletz Sep 30, 2022
24bc454
pure-ftpd: fix build with libxcrypt
fpletz Sep 30, 2022
31f1f36
cernlib: fix build with libxcrypt
fpletz Sep 30, 2022
e33af60
bozohttpd: fix build with libxcrypt
fpletz Sep 30, 2022
519b8c8
sawfish: fix build with libxcrypt
fpletz Sep 30, 2022
845ae8e
qnial: fix build with libxcrypt
fpletz Sep 30, 2022
09597d4
unicon-lang: fix build with libxcrypt
fpletz Sep 30, 2022
15f6c0a
gvm-libs: fix build with libxcrypt
fpletz Sep 30, 2022
8dde32e
snis: fix build with libxcrypt
fpletz Sep 30, 2022
125ec34
slock: fix build with libxcrypt
fpletz Sep 30, 2022
fd1bcb1
dico: fix build with libxcrypt
fpletz Sep 30, 2022
ccba311
dcap: fix build with libxcrypt
fpletz Sep 30, 2022
57f4391
haproxy: fix build with libxcrypt
fpletz Sep 30, 2022
cfc636c
srelay: fix build with libxcrypt
fpletz Sep 30, 2022
58bbfeb
nntp-proxy: fix build with libxcrypt
fpletz Sep 30, 2022
7b33ea4
shellhub-agent: fix build with libxcrypt
fpletz Sep 30, 2022
9fb94a8
pam_mysql: fix build with libxcrypt
fpletz Sep 30, 2022
94e54c6
pam_pgsql: fix build with libxcrypt
fpletz Sep 30, 2022
3edcff9
sysvinit: fix build with libxcrypt
fpletz Sep 30, 2022
fc4f68d
mokutil: fix build with libxcrypt
fpletz Sep 30, 2022
c755643
epic5: fix build with libxcrypt
fpletz Sep 30, 2022
bcdde95
kermit: fix build with libxcrypt
fpletz Sep 30, 2022
6264d94
root5: fix build with libxcrypt
fpletz Sep 30, 2022
2c10e08
root: fix build with libxcrypt
fpletz Sep 30, 2022
9430efb
pleroma: fix build with libxcrypt
fpletz Sep 30, 2022
3d6b548
sogo: fix build with libxcrypt
fpletz Sep 30, 2022
fb591b9
cde: fix build with libxcrypt
fpletz Sep 30, 2022
993839a
bftpd: fix build with libxcrypt
fpletz Sep 30, 2022
f64f770
llvmPackages_13.compiler-rt: fix build with libxcrypt
mweinelt Oct 1, 2022
efd944c
llvmPackages_12.compiler-rt: fix build with libxcrypt
mweinelt Oct 1, 2022
716a315
llvmPackages_10.compiler-rt: fix build with libxcrypt
mweinelt Oct 1, 2022
842a2c2
llvmPackages_rocm.llvm: fix build with libxcrypt
mweinelt Oct 1, 2022
284396c
haskellPackages.crypt-sha512: fix build with libxcrypt
mweinelt Oct 2, 2022
7670059
freeswitch: fix build with libxcrypt
mweinelt Oct 3, 2022
6f1812a
haskellPackages.Unixutils: fix build with libxcrypt
mweinelt Oct 3, 2022
3f4de6d
thttpd: fix build with libxcrypt
mweinelt Oct 3, 2022
2d19e7c
haskellPackages.nano-cryptr: fix build with libxcrypt
mweinelt Oct 3, 2022
9001f0d
haskellPackages.xmonad-utils: fix build with libxcrypt
mweinelt Oct 3, 2022
e02766b
ocserv: fix build with libxcrypt
mweinelt Oct 3, 2022
2b83e04
ladybird: fix build with libxcrypt
mweinelt Oct 3, 2022
0f7ef68
cdesktopenv: fix build with libxcrypt
mweinelt Oct 3, 2022
01f94c2
wiringpi: fix build with libxcrypt
mweinelt Oct 3, 2022
3cedef1
swift: fix build with libxcrypt
mweinelt Oct 3, 2022
73ffee8
util-linux: pass libxcrypt, so sulogin gets built
mweinelt Oct 4, 2022
1b8d6d3
python3Packages.twisted: Disable failing crypt test
mweinelt Oct 6, 2022
322b510
python3Packages.pillow{,-simd}: fix build with libxcrypt
mweinelt Oct 7, 2022
338d0cc
libxcrypt: Fix static build by using perl from buildPackages
mweinelt Oct 8, 2022
195aa58
boost: fix build with enablePython by passing libxcrypt
mweinelt Oct 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/modules/config/users-groups.nix
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ in {
value = "[a-zA-Z0-9/+.-]+";
options = "${id}(=${value})?(,${id}=${value})*";
scheme = "${id}(${sep}${options})?";
content = "${base64}${sep}${base64}";
content = "${base64}${sep}${base64}(${sep}${base64})?";
mcf = "^${sep}${scheme}${sep}${content}$";
in
if (allowsLogin user.hashedPassword
Expand Down
30 changes: 30 additions & 0 deletions nixos/tests/shadow.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ let
password2 = "helloworld";
password3 = "bazqux";
password4 = "asdf123";
hashed_bcrypt = "$2b$05$8xIEflrk2RxQtcVXbGIxs.Vl0x7dF1/JSv3cyX6JJt0npzkTCWvxK"; # fnord
hashed_yeshash = "$y$j9T$d8Z4EAf8P1SvM/aDFbxMS0$VnTXMp/Hnc7QdCBEaLTq5ZFOAFo2/PM0/xEAFuOE88."; # fnord
in import ./make-test-python.nix ({ pkgs, ... }: {
name = "shadow";
meta = with pkgs.lib.maintainers; { maintainers = [ nequissimus ]; };
Expand All @@ -27,6 +29,16 @@ in import ./make-test-python.nix ({ pkgs, ... }: {
password = password4;
shell = pkgs.bash;
};
users.berta = {
isNormalUser = true;
hashedPassword = hashed_bcrypt;
shell = pkgs.bash;
};
users.yesim = {
isNormalUser = true;
hashedPassword = hashed_yeshash;
shell = pkgs.bash;
};
};
};

Expand Down Expand Up @@ -115,5 +127,23 @@ in import ./make-test-python.nix ({ pkgs, ... }: {
shadow.wait_until_succeeds("pgrep login")
shadow.send_chars("${password2}\n")
shadow.wait_until_tty_matches("5", "login:")

with subtest("check alternate password hashes"):
shadow.send_key("alt-f6")
shadow.wait_until_succeeds("[ $(fgconsole) = 6 ]")
for u in ["berta", "yesim"]:
shadow.wait_for_unit("[email protected]")
shadow.wait_until_succeeds("pgrep -f 'agetty.*tty6'")
shadow.wait_until_tty_matches("6", "login: ")
shadow.send_chars(f"{u}\n")
shadow.wait_until_tty_matches("6", f"login: {u}")
shadow.wait_until_succeeds("pgrep login")
shadow.sleep(2)
shadow.send_chars("fnord\n")
shadow.send_chars(f"whoami > /tmp/{u}\n")
shadow.wait_for_file(f"/tmp/{u}")
print(shadow.succeed(f"cat /tmp/{u}"))
assert u in shadow.succeed(f"cat /tmp/{u}")
shadow.send_chars("logout\n")
'';
})
2 changes: 2 additions & 0 deletions pkgs/applications/networking/browsers/ladybird/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, ninja
, unzip
, wrapQtAppsHook
, libxcrypt
, qtbase
, qttools
, nixosTests
Expand Down Expand Up @@ -37,6 +38,7 @@ in gcc11Stdenv.mkDerivation {
];

buildInputs = [
libxcrypt
qtbase
];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/irc/epic5/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, openssl, ncurses, libiconv, tcl, coreutils, fetchpatch }:
{ lib, stdenv, fetchurl, openssl, ncurses, libiconv, tcl, coreutils, fetchpatch, libxcrypt }:

stdenv.mkDerivation rec {
pname = "epic5";
Expand All @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
};

# Darwin needs libiconv, tcl; while Linux build don't
buildInputs = [ openssl ncurses ]
buildInputs = [ openssl ncurses libxcrypt ]
++ lib.optionals stdenv.isDarwin [ libiconv tcl ];

patches = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/mailreaders/alpine/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{lib, stdenv, fetchurl, ncurses, tcl, openssl, pam, libkrb5
, openldap
, openldap, libxcrypt
}:

stdenv.mkDerivation rec {
Expand All @@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
};

buildInputs = [
ncurses tcl openssl pam libkrb5 openldap
ncurses tcl openssl pam libkrb5 openldap libxcrypt
];

hardeningDisable = [ "format" ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/nntp-proxy/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, libconfig, pkg-config, libevent, openssl }:
{ lib, stdenv, fetchFromGitHub, libconfig, pkg-config, libevent, openssl, libxcrypt }:

stdenv.mkDerivation {
pname = "nntp-proxy";
Expand All @@ -12,7 +12,7 @@ stdenv.mkDerivation {
};

nativeBuildInputs = [ pkg-config ];
buildInputs = [ libconfig libevent openssl ];
buildInputs = [ libconfig libevent openssl libxcrypt ];

installFlags = [ "INSTALL_DIR=$(out)/bin/" ];

Expand Down
2 changes: 2 additions & 0 deletions pkgs/applications/networking/shellhub-agent/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, gitUpdater
, makeWrapper
, openssh
, libxcrypt
}:

buildGoModule rec {
Expand Down Expand Up @@ -31,6 +32,7 @@ buildGoModule rec {
};

nativeBuildInputs = [ makeWrapper ];
buildInputs = [ libxcrypt ];

postInstall = ''
wrapProgram $out/bin/agent --prefix PATH : ${lib.makeBinPath [ openssh ]}
Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/science/misc/root/5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
, libGL
, zlib
, libxml2
, libxcrypt
, lz4
, xz
, gsl_1
Expand All @@ -33,7 +34,7 @@ stdenv.mkDerivation rec {
};

nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ pcre python2 zlib libxml2 lz4 xz gsl_1 xxHash ]
buildInputs = [ pcre python2 zlib libxml2 lz4 xz gsl_1 xxHash libxcrypt ]
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ]
;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/applications/science/misc/root/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
, libXext
, libGLU
, libGL
, libxcrypt
, libxml2
, llvm_9
, lz4
Expand Down Expand Up @@ -72,6 +73,7 @@ stdenv.mkDerivation rec {
zlib
zstd
lapack
libxcrypt
libxml2
_llvm_9
lz4
Expand Down
5 changes: 3 additions & 2 deletions pkgs/applications/science/networking/sumo/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, bzip2, cmake, eigen, fetchFromGitHub, ffmpeg, fox_1_6, gdal,
git, gl2ps, gpp , gtest, jdk, libGL, libGLU, libX11, libjpeg,
libpng, libtiff, openscenegraph , proj, python3, python37Packages,
stdenv, swig, xercesc, xorg, zlib }:
libpng, libtiff, libxcrypt, openscenegraph , proj, python3,
python37Packages, stdenv, swig, xercesc, xorg, zlib }:

stdenv.mkDerivation rec {
pname = "sumo";
Expand Down Expand Up @@ -36,6 +36,7 @@ stdenv.mkDerivation rec {
libjpeg
libpng
libtiff
libxcrypt
openscenegraph
proj
python37Packages.setuptools
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/video/kodi/unwrapped.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, makeWrapper
, pkg-config, cmake, yasm, python3Packages
, libgcrypt, libgpg-error, libunistring
, libxcrypt, libgcrypt, libgpg-error, libunistring
, boost, avahi, lame
, gettext, pcre-cpp, yajl, fribidi, which
, openssl, gperf, tinyxml2, taglib, libssh, swig, jre_headless
Expand Down Expand Up @@ -131,7 +131,7 @@ in stdenv.mkDerivation {
sqlite libmysqlclient avahi lame
curl bzip2 zip unzip glxinfo
libcec libcec_platform dcadec libuuid
libgcrypt libgpg-error libunistring
libxcrypt libgcrypt libgpg-error libunistring
libcrossguid libplist
bluez giflib glib harfbuzz lcms2 libpthreadstubs
ffmpeg flatbuffers fstrcmp rapidjson
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/virtualization/open-vm-tools/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper, autoreconfHook
, bash, fuse3, libmspack, openssl, pam, xercesc, icu, libdnet, procps, libtirpc, rpcsvc-proto
, libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst
, libX11, libXext, libXinerama, libXi, libXrender, libXrandr, libXtst, libxcrypt
, pkg-config, glib, gdk-pixbuf-xlib, gtk3, gtkmm3, iproute2, dbus, systemd, which
, libdrm, udev, util-linux
, withX ? true
Expand All @@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];

nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ];
buildInputs = [ fuse3 glib icu libdnet libdrm libmspack libtirpc openssl pam procps rpcsvc-proto udev xercesc ]
buildInputs = [ fuse3 glib icu libdnet libdrm libmspack libtirpc libxcrypt openssl pam procps rpcsvc-proto udev xercesc ]
++ lib.optionals withX [ gdk-pixbuf-xlib gtk3 gtkmm3 libX11 libXext libXinerama libXi libXrender libXrandr libXtst ];

postPatch = ''
Expand Down
2 changes: 2 additions & 0 deletions pkgs/applications/window-managers/sawfish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, imlib
, libICE
, libSM
, libxcrypt
, libXinerama
, libXrandr
, libXtst
Expand Down Expand Up @@ -44,6 +45,7 @@ stdenv.mkDerivation rec {
imlib
libICE
libSM
libxcrypt
libXinerama
libXrandr
libXtst
Expand Down
4 changes: 2 additions & 2 deletions pkgs/desktops/cdesktopenv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, xorgproto, libX11, bison, ksh, perl, gnum4
, libXinerama, libXt, libXext, libtirpc, motif, libXft, xbitmaps
, libjpeg, libXmu, libXdmcp, libXScrnSaver, symlinkJoin, bdftopcf
, ncompress, mkfontdir, tcl, libXaw, gcc, glibcLocales
, ncompress, mkfontdir, tcl, libXaw, libxcrypt, gcc, glibcLocales
, autoPatchelfHook, libredirect, makeWrapper, xset, xrdb, fakeroot
, rpcsvc-proto }:

Expand Down Expand Up @@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {

buildInputs = [
libX11 libXinerama libXt libXext libtirpc motif libXft xbitmaps
libjpeg libXmu libXdmcp libXScrnSaver tcl libXaw ksh
libjpeg libXmu libXdmcp libXScrnSaver tcl libXaw ksh libxcrypt
];
nativeBuildInputs = [
bison ncompress autoPatchelfHook makeWrapper fakeroot
Expand Down
9 changes: 6 additions & 3 deletions pkgs/development/compilers/gcc/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
, libxcrypt
}:

# Make sure we get GNU sed.
Expand Down Expand Up @@ -172,7 +173,7 @@ stdenv.mkDerivation ({
++ optional targetPlatform.isLinux patchelf;

buildInputs = [
gmp mpfr libmpc
gmp mpfr libmpc libxcrypt
targetPackages.stdenv.cc.bintools # For linking code at run-time
] ++ (optional (isl != null) isl)
++ (optional (zlib != null) zlib)
Expand All @@ -182,10 +183,12 @@ stdenv.mkDerivation ({

NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";

preConfigure = import ../common/pre-configure.nix {
preConfigure = (import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
}) + ''
ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h
'';

dontDisableStatic = true;

Expand Down
9 changes: 6 additions & 3 deletions pkgs/development/compilers/gcc/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
, libxcrypt
}:

# Make sure we get GNU sed.
Expand Down Expand Up @@ -180,7 +181,7 @@ stdenv.mkDerivation ({
++ optional targetPlatform.isLinux patchelf;

buildInputs = [
gmp mpfr libmpc
gmp mpfr libmpc libxcrypt
targetPackages.stdenv.cc.bintools # For linking code at run-time
] ++ (optional (isl != null) isl)
++ (optional (zlib != null) zlib)
Expand All @@ -190,10 +191,12 @@ stdenv.mkDerivation ({

NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";

preConfigure = import ../common/pre-configure.nix {
preConfigure = (import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
}) + ''
ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h
'';

dontDisableStatic = true;

Expand Down
10 changes: 7 additions & 3 deletions pkgs/development/compilers/gcc/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
, gnused ? null
, cloog # unused; just for compat with gcc4, as we override the parameter on some places
, buildPackages
, libxcrypt
}:

# Make sure we get GNU sed.
Expand Down Expand Up @@ -173,7 +174,7 @@ stdenv.mkDerivation ({
++ optional targetPlatform.isLinux patchelf;

buildInputs = [
gmp mpfr libmpc
gmp mpfr libmpc libxcrypt
targetPackages.stdenv.cc.bintools # For linking code at run-time
] ++ (optional (isl != null) isl)
++ (optional (zlib != null) zlib)
Expand All @@ -183,10 +184,13 @@ stdenv.mkDerivation ({

NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl";

preConfigure = import ../common/pre-configure.nix {

preConfigure = (import ../common/pre-configure.nix {
inherit lib;
inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
};
}) + ''
ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h
'';

dontDisableStatic = true;

Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/10/compiler-rt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, libllvm, libcxxabi }:
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, libllvm, libcxxabi, libxcrypt }:

let

Expand All @@ -25,6 +25,8 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is musl different from glibc here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/11/compiler-rt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, xcbuild, libllvm, libcxxabi }:
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt }:

let

Expand Down Expand Up @@ -26,6 +26,8 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl || isNewDarwinBootstrap) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/llvm/12/compiler-rt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, xcbuild, libllvm, libcxxabi }:
{ lib, stdenv, llvm_meta, version, fetch, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt }:

let

Expand Down Expand Up @@ -26,6 +26,8 @@ stdenv.mkDerivation {
"-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
"-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
"-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
] ++ lib.optionals (haveLibc && !isMusl) [
"-DSANITIZER_COMMON_CFLAGS=-I${libxcrypt}/include"
] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
Expand Down
Loading