From ca89e801ead2158f991e530031755a2a69372eec Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Wed, 14 Oct 2020 19:03:51 -0700 Subject: [PATCH] boost: fix segfaults on ppc64 Fixes https://github.com/NixOS/nix/issues/2517 See also: https://github.com/boostorg/context/issues/72 https://github.com/boostorg/fiber/issues/193 These issues have been resolved by: https://github.com/boostorg/context/pull/106 https://github.com/boostorg/context/commit/d4608a4e8ba2e8a0bdd45613243e6c53a23d23dc which is merged into boost as of v1.71.0. This feature was introduced (with the bug) in boost v1.61 and was fixed in v1.71. So we apply the patch to all versions in that range. --- pkgs/development/libraries/boost/generic.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index a195a2c7bb9..b3950cb0d30 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -1,4 +1,5 @@ { stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv +, fetchpatch , which , buildPackages , toolset ? /**/ if stdenv.cc.isClang then "clang" @@ -113,6 +114,14 @@ stdenv.mkDerivation { if version == "1.55.0" then ./darwin-1.55-no-system-python.patch else ./darwin-no-system-python.patch) + # Fix boost-context segmentation faults on ppc64 due to ABI violation + ++ optional (versionAtLeast version "1.61" && + versionOlder version "1.71") (fetchpatch { + url = "https://github.com/boostorg/context/commit/2354eca9b776a6739112833f64754108cc0d1dc5.patch"; + sha256 = "067m4bjpmcanqvg28djax9a10avmdwhlpfx6gn73kbqqq70dnz29"; + stripLen = 1; + extraPrefix = "libs/context/"; + }) ++ optional (and (versionAtLeast version "1.70") (!versionAtLeast version "1.73")) ./cmake-paths.patch ++ optional (versionAtLeast version "1.73") ./cmake-paths-173.patch;