Skip to content

Commit

Permalink
depends: add pthread-stack-min-fix.patch for boost
Browse files Browse the repository at this point in the history
This is essentially a backport but since I can't directly cherry-pick the commit from nixpkgs I've copied the patch and amended the pertinent sections in depends/packages/boost.mk.

Ma27/nixpkgs@666a863
  • Loading branch information
xanimo committed Sep 22, 2022
1 parent a8313b8 commit 2cad4c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion depends/packages/boost.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(package)_version=1_70_0
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/
$(package)_file_name=boost_$($(package)_version).tar.bz2
$(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
$(package)_patches=unused_var_in_process.patch
$(package)_patches=unused_var_in_process.patch pthread-stack-min-fix.patch

define $(package)_set_vars
$(package)_config_opts_release=variant=release
Expand Down Expand Up @@ -34,6 +34,7 @@ endef

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \
patch -p1 < $($(package)_patch_dir)/pthread-stack-min-fix.patch && \
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
endef

Expand Down
15 changes: 15 additions & 0 deletions depends/patches/boost/pthread-stack-min-fix.patch
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 2cad4c7

Please sign in to comment.