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()
This commit is contained in:
Reno Dakota
2024-12-20 01:09:59 +00:00
parent 2312c397a8
commit 5cabb9a955
+9
View File
@@ -2,6 +2,7 @@
stdenv,
lib,
fetchurl,
autoreconfHook,
openssl,
perl,
pps-tools,
@@ -17,6 +18,12 @@ stdenv.mkDerivation rec {
hash = "sha256-z4TF8/saKVKElCYk2CP/+mNBROCWz8T5lprJjvX0aOU=";
};
# fix for gcc-14 compile failure
postPatch = ''
substituteInPlace sntp/m4/openldap-thread-check.m4 \
--replace-fail "pthread_detach(NULL)" "pthread_detach(pthread_self())"
'';
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
@@ -26,6 +33,8 @@ stdenv.mkDerivation rec {
"--with-yielding-select=yes"
] ++ lib.optional stdenv.hostPlatform.isLinux "--enable-linuxcaps";
nativeBuildInputs = [ autoreconfHook ];
buildInputs =
[
openssl