From 5cabb9a955261fd106112924a687ca4dec122db2 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Fri, 20 Dec 2024 01:09:59 +0000 Subject: [PATCH] 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() --- pkgs/by-name/nt/ntp/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/nt/ntp/package.nix b/pkgs/by-name/nt/ntp/package.nix index a7123dff7a11..2d97a87c33b7 100644 --- a/pkgs/by-name/nt/ntp/package.nix +++ b/pkgs/by-name/nt/ntp/package.nix @@ -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