From f8f44e161099a2a921fa643964992dc462729f47 Mon Sep 17 00:00:00 2001 From: Reno Dakota <170618376+paparodeo@users.noreply.github.com> Date: Thu, 4 Jul 2024 03:35:35 +0000 Subject: [PATCH 1/2] Revert "db4: fix configure with llvm" the configure program fails to compile due to using exit without a function prototype. the fix should be to patch the configure script. This reverts commit 227afde6d8eeb9c08b4f9bb3c42521925e2977a5. --- pkgs/development/libraries/db/db-4.8.nix | 6 ++---- pkgs/development/libraries/db/generic.nix | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/db/db-4.8.nix b/pkgs/development/libraries/db/db-4.8.nix index 4d6029d6d821..81705374381e 100644 --- a/pkgs/development/libraries/db/db-4.8.nix +++ b/pkgs/development/libraries/db/db-4.8.nix @@ -1,6 +1,6 @@ -{ lib, stdenv, fetchurl, autoreconfHook, targetPlatform, ... } @ args: +{ lib, stdenv, fetchurl, autoreconfHook, ... } @ args: -import ./generic.nix (builtins.removeAttrs args ["targetPlatform"] // { +import ./generic.nix (args // { version = "4.8.30"; sha256 = "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"; extraPatches = [ @@ -9,8 +9,6 @@ import ./generic.nix (builtins.removeAttrs args ["targetPlatform"] // { ./darwin-mutexes-4.8.patch ]; - drvArgs.configureFlags = lib.optional (targetPlatform.useLLVM or false) "--with-mutex=POSIX/pthreads"; - drvArgs.hardeningDisable = [ "format" ]; drvArgs.doCheck = false; }) diff --git a/pkgs/development/libraries/db/generic.nix b/pkgs/development/libraries/db/generic.nix index ddb4139e116d..d715c1ffc8b1 100644 --- a/pkgs/development/libraries/db/generic.nix +++ b/pkgs/development/libraries/db/generic.nix @@ -67,8 +67,7 @@ stdenv.mkDerivation (rec { (if compat185 then "--enable-compat185" else "--disable-compat185") ] ++ lib.optional dbmSupport "--enable-dbm" - ++ lib.optional stdenv.isFreeBSD "--with-pic" - ++ (drvArgs.configureFlags or []); + ++ lib.optional stdenv.isFreeBSD "--with-pic"; preConfigure = '' cd build_unix @@ -93,4 +92,4 @@ stdenv.mkDerivation (rec { license = license; platforms = platforms.unix; }; -} // builtins.removeAttrs drvArgs [ "configureFlags" ]) +} // drvArgs) From 91069620eaaa0cc8386d4589b6a6b93a284bbfa3 Mon Sep 17 00:00:00 2001 From: Reno Dakota <170618376+paparodeo@users.noreply.github.com> Date: Thu, 4 Jul 2024 03:38:10 +0000 Subject: [PATCH 2/2] db4: fix pthread configure detection add header stdlib.h so pthread detection doesn't fail do to a missing function prototype for exit. ``` configure:21863: clang -o conftest -O3 -D_GNU_SOURCE -D_REENTRANT conftest.c >&5 conftest.c:52:2: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 52 | exit ( | ^ conftest.c:52:2: note: include the header or explicitly provide a declaration for 'exit' ``` --- pkgs/development/libraries/db/clang-4.8.patch | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/db/clang-4.8.patch b/pkgs/development/libraries/db/clang-4.8.patch index 0aff87682037..bf0de55fc1bf 100644 --- a/pkgs/development/libraries/db/clang-4.8.patch +++ b/pkgs/development/libraries/db/clang-4.8.patch @@ -153,22 +153,42 @@ diff -ur a/dist/aclocal/clock.m4 b/dist/aclocal/clock.m4 diff -ur a/dist/aclocal/mutex.m4 b/dist/aclocal/mutex.m4 --- a/dist/aclocal/mutex.m4 1969-12-31 19:00:01.000000000 -0500 +++ b/dist/aclocal/mutex.m4 2023-06-05 19:14:47.214158196 -0400 -@@ -4,6 +4,7 @@ +@@ -3,7 +3,9 @@ + # POSIX pthreads tests: inter-process safe and intra-process only. AC_DEFUN(AM_PTHREADS_SHARED, [ AC_TRY_RUN([ ++#include #include +int main() { pthread_cond_t cond; pthread_mutex_t mutex; -@@ -46,6 +47,7 @@ +@@ -24,6 +26,7 @@ main() { + pthread_mutexattr_destroy(&mutexattr)); + }], [db_cv_mutex="$1"],, + AC_TRY_LINK([ ++#include + #include ],[ + pthread_cond_t cond; + pthread_mutex_t mutex; +@@ -45,7 +48,9 @@ AC_TRY_LINK([ + ], [db_cv_mutex="$1"]))]) AC_DEFUN(AM_PTHREADS_PRIVATE, [ AC_TRY_RUN([ ++#include #include +int main() { pthread_cond_t cond; pthread_mutex_t mutex; +@@ -64,6 +69,7 @@ main() { + pthread_mutexattr_destroy(&mutexattr)); + }], [db_cv_mutex="$1"],, + AC_TRY_LINK([ ++#include + #include ],[ + pthread_cond_t cond; + pthread_mutex_t mutex; diff -ur a/dist/aclocal/sequence.m4 b/dist/aclocal/sequence.m4 --- a/dist/aclocal/sequence.m4 1969-12-31 19:00:01.000000000 -0500 +++ b/dist/aclocal/sequence.m4 2023-06-05 19:14:02.007869956 -0400 @@ -183,7 +203,7 @@ diff -ur a/dist/aclocal/sequence.m4 b/dist/aclocal/sequence.m4 $db_cv_seq_type l; unsigned $db_cv_seq_type u; @@ -59,7 +62,9 @@ - return (1); + return (1); return (0); }],, [db_cv_build_sequence="no"], - AC_TRY_LINK(,[