summary refs log tree commit diff
path: root/pkgs/development/libraries/boost
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-08-27 12:13:21 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2022-02-27 10:25:35 +0100
commitf363b7c5dfc50b3b3051c333678d22fd318fa89d (patch)
tree6c0a6ffc5df687579b6602bbe6a251d33dd6287e /pkgs/development/libraries/boost
parent9fe34ccfbe8e80f6c0c5b2df3625e0e44d2ed070 (diff)
downloadnixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.tar
nixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.tar.gz
nixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.tar.bz2
nixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.tar.lz
nixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.tar.xz
nixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.tar.zst
nixpkgs-f363b7c5dfc50b3b3051c333678d22fd318fa89d.zip
boost1{69,70,72}: fix build w/glibc-2.34
To quote the release-notes[1]:

> When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined,
> PTHREAD_STACK_MIN is no longer constant and is redefined to
> sysconf(_SC_THREAD_STACK_MIN).  This supports dynamic sized register
> sets for modern architectural features like Arm SVE.

This basically means that if the above applies, `#if PTHREAD_STACK_MIN > 0`
won't compile anymore because `PTHREAD_STACK_MIN` isn't a hard-coded
number, but `__sysconf (__SC_THREAD_STACK_MIN_VALUE)`[2].

The issue (for 1.69, 1.70, 1.72 - the other versions seem OK) was
reported upstream, but only for Solaris[3], however the corresponding
patches[4] seem to work as well for us.

Failing Hydra build: https://hydra.nixos.org/build/150926294

[1] https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html
[2] See `${pkgs.glibc.dev}/include/bits/pthread_stack_min-dynamic.h`
[3] https://github.com/boostorg/thread/issues/283
[4] https://github.com/conan-io/conan-center-index/pull/361
Diffstat (limited to 'pkgs/development/libraries/boost')
-rw-r--r--pkgs/development/libraries/boost/1.69.nix2
-rw-r--r--pkgs/development/libraries/boost/1.70.nix2
-rw-r--r--pkgs/development/libraries/boost/1.72.nix2
-rw-r--r--pkgs/development/libraries/boost/pthread-stack-min-fix.patch15
4 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/development/libraries/boost/1.69.nix b/pkgs/development/libraries/boost/1.69.nix
index d934e3267fc..c8846daa64f 100644
--- a/pkgs/development/libraries/boost/1.69.nix
+++ b/pkgs/development/libraries/boost/1.69.nix
@@ -8,4 +8,6 @@ callPackage ./generic.nix (args // rec {
     # SHA256 from http://www.boost.org/users/history/version_1_69_0.html
     sha256 = "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406";
   };
+
+  patches = [ ./pthread-stack-min-fix.patch ];
 })
diff --git a/pkgs/development/libraries/boost/1.70.nix b/pkgs/development/libraries/boost/1.70.nix
index bc70797acda..4d50f41e49c 100644
--- a/pkgs/development/libraries/boost/1.70.nix
+++ b/pkgs/development/libraries/boost/1.70.nix
@@ -8,4 +8,6 @@ callPackage ./generic.nix (args // rec {
     # SHA256 from http://www.boost.org/users/history/version_1_70_0.html
     sha256 = "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778";
   };
+
+  patches = [ ./pthread-stack-min-fix.patch ];
 })
diff --git a/pkgs/development/libraries/boost/1.72.nix b/pkgs/development/libraries/boost/1.72.nix
index bb2fccdfaf7..666a3cacb65 100644
--- a/pkgs/development/libraries/boost/1.72.nix
+++ b/pkgs/development/libraries/boost/1.72.nix
@@ -11,5 +11,7 @@ callPackage ./generic.nix (args // rec {
     # SHA256 from http://www.boost.org/users/history/version_1_72_0.html
     sha256 = "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722";
   };
+
+  patches = [ ./pthread-stack-min-fix.patch ];
 })
 
diff --git a/pkgs/development/libraries/boost/pthread-stack-min-fix.patch b/pkgs/development/libraries/boost/pthread-stack-min-fix.patch
new file mode 100644
index 00000000000..b6c85f84052
--- /dev/null
+++ b/pkgs/development/libraries/boost/pthread-stack-min-fix.patch
@@ -0,0 +1,15 @@
+Taken from https://github.com/conan-io/conan-center-index/pull/361/files
+
+diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp
+index aefbeb4..bc9b136 100644
+--- a/boost/thread/pthread/thread_data.hpp
++++ b/boost/thread/pthread/thread_data.hpp
+@@ -57,7 +57,7 @@ namespace boost
+ #else
+           std::size_t page_size = ::sysconf( _SC_PAGESIZE);
+ #endif
+-#if PTHREAD_STACK_MIN > 0
++#ifdef PTHREAD_STACK_MIN
+           if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
+ #endif
+           size = ((size+page_size-1)/page_size)*page_size;