jemalloc: fix darwin build

This commit is contained in:
Dmitry Kalinkin 2021-12-13 07:27:59 -05:00
parent f10e8df3b9
commit 6bda212f69
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333
2 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,6 @@
{ version, sha256 }:
{ lib, stdenv, fetchurl
, fetchpatch
# By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
# then stops downstream builds (mariadb in particular) from detecting it. This
# option should remove the prefix and give us a working jemalloc.
@ -20,6 +21,14 @@ stdenv.mkDerivation rec {
inherit sha256;
};
patches = [
# workaround https://github.com/jemalloc/jemalloc/issues/2091
(fetchpatch {
url = "https://github.com/jemalloc/jemalloc/commit/3b4a03b92b2e415415a08f0150fdb9eeb659cd52.diff";
sha256 = "sha256-6AYtADREhfj93ZLk9xnXtjc6vHDU0EKLLOvLd6YdJeI=";
})
];
# see the comment on stripPrefix
configureFlags = []
++ optional stripPrefix "--with-jemalloc-prefix="

View File

@ -17193,7 +17193,11 @@ with pkgs;
jbigkit = callPackage ../development/libraries/jbigkit { };
jemalloc = callPackage ../development/libraries/jemalloc { };
jemalloc = callPackage ../development/libraries/jemalloc {
# tests fail with LLVM 11+
# https://github.com/jemalloc/jemalloc/issues/2091
stdenv = if stdenv.cc.isClang then llvmPackages_10.stdenv else stdenv;
};
jemalloc450 = callPackage ../development/libraries/jemalloc/jemalloc450.nix { };