Skip to content

Commit 5cabb9a

Browse files
committed
ntp: fix build with gcc-14
configure fails with: > conftest.c: In function 'main': conftest.c:162:16: error: passing argument 1 of 'pthread_detach' makes integer from pointer without a cast [-Wint-conversion] pthread_detach expects a pthread_t so provide it one with pthread_self()
1 parent 2312c39 commit 5cabb9a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkgs/by-name/nt/ntp/package.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
stdenv,
33
lib,
44
fetchurl,
5+
autoreconfHook,
56
openssl,
67
perl,
78
pps-tools,
@@ -17,6 +18,12 @@ stdenv.mkDerivation rec {
1718
hash = "sha256-z4TF8/saKVKElCYk2CP/+mNBROCWz8T5lprJjvX0aOU=";
1819
};
1920

21+
# fix for gcc-14 compile failure
22+
postPatch = ''
23+
substituteInPlace sntp/m4/openldap-thread-check.m4 \
24+
--replace-fail "pthread_detach(NULL)" "pthread_detach(pthread_self())"
25+
'';
26+
2027
configureFlags = [
2128
"--sysconfdir=/etc"
2229
"--localstatedir=/var"
@@ -26,6 +33,8 @@ stdenv.mkDerivation rec {
2633
"--with-yielding-select=yes"
2734
] ++ lib.optional stdenv.hostPlatform.isLinux "--enable-linuxcaps";
2835

36+
nativeBuildInputs = [ autoreconfHook ];
37+
2938
buildInputs =
3039
[
3140
openssl

0 commit comments

Comments
 (0)