]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
distro/pkg/*: build with jemalloc
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 7 Oct 2022 12:17:57 +0000 (14:17 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 30 Nov 2022 16:39:05 +0000 (17:39 +0100)
distro/pkg/arch/PKGBUILD
distro/pkg/deb/control
distro/pkg/deb/rules
distro/pkg/nix/default.nix
distro/pkg/rpm/knot-resolver.spec

index 967ad7ca9af0f771e1f0fab58027460addfa8e41..7eea556e558b3eed3b680ccb19810e3e69c2ce90 100644 (file)
@@ -20,6 +20,7 @@ depends=(
     'systemd'
     'libcap-ng'
     'libnghttp2'
+    'jemalloc'
 )
 makedepends=(
     'cmocka'
@@ -47,6 +48,7 @@ build() {
         -D systemd_files=enabled \
         -D client=enabled \
         -D install_kresd_conf=enabled \
+        -D malloc=jemalloc \
         -D unit_tests=enabled
     ninja -C build
 }
index fdf213cc521360752c122625dbb221143c0437c6..1f9964d23d389251fdd04322aa29bbfc173cc89f 100644 (file)
@@ -16,6 +16,7 @@ Build-Depends:
  libsystemd-dev (>= 227) [linux-any],
  libcap-ng-dev,
  libuv1-dev,
+ libjemalloc-dev,
  luajit,
  pkg-config,
  meson (>= 0.49),
index 3445b8ce53606d96ee0936ff202ba4c0318bd73d..c577476096ff3cef7971bddcdbe8746374359471 100755 (executable)
@@ -32,6 +32,7 @@ override_dh_auto_build:
                -Droot_hints=/usr/share/dns/root.hints \
                -Dinstall_kresd_conf=enabled \
                -Dunit_tests=enabled \
+               -Dmalloc=jemalloc \
                -Dc_args="$${CFLAGS}" \
                -Dc_link_args="$${LDFLAGS}"
        ninja -v -C build_deb
index af42fa80e4d603da9094a52d293ec81b46aafc5a..16c66d0546397b11536d5f9d3ddce2a589ae1842 100644 (file)
@@ -3,7 +3,7 @@
 , runCommand, pkg-config, meson, ninja, makeWrapper
 # build+runtime deps.
 , knot-dns, luajitPackages, libuv, gnutls, lmdb
-, systemd, libcap_ng, dns-root-data, nghttp2 # optionals, in principle
+, jemalloc, systemd, libcap_ng, dns-root-data, nghttp2 # optionals, in principle
 # test-only deps.
 , cmocka, which, cacert
 , extraFeatures ? false /* catch-all if defaults aren't enough */
@@ -56,7 +56,7 @@ unwrapped = stdenv.mkDerivation rec {
   # http://knot-resolver.readthedocs.io/en/latest/build.html#requirements
   buildInputs = [ knot-dns lua.lua libuv gnutls lmdb ]
     ++ optionals stdenv.isLinux [ systemd libcap_ng ]
-    ++ [ nghttp2 ]
+    ++ [ jemalloc nghttp2 ]
     ## optional dependencies; TODO: dnstap
     ;
 
@@ -64,6 +64,7 @@ unwrapped = stdenv.mkDerivation rec {
     "-Dkeyfile_default=${dns-root-data}/root.ds"
     "-Droot_hints=${dns-root-data}/root.hints"
     "-Dinstall_kresd_conf=disabled" # not really useful; examples are inside share/doc/
+    "-Dmalloc=jemalloc"
     "--default-library=static" # not used by anyone
   ]
   ++ optional doInstallCheck "-Dunit_tests=enabled"
index 1c6b9e838ab796df56adef1b1fa1703933033f3b..0a7e2838f62ad613ca0f2e313b3620d30e0faf78 100644 (file)
@@ -48,6 +48,7 @@ BuildRequires:  pkgconfig(libsystemd)
 BuildRequires:  pkgconfig(libcap-ng)
 BuildRequires:  pkgconfig(libuv)
 BuildRequires:  pkgconfig(luajit) >= 2.0
+BuildRequires:  jemalloc-devel
 
 Requires:       systemd
 Requires(post): systemd
@@ -182,6 +183,7 @@ CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" meson build_rpm \
     -Dkeyfile_default="%{_sharedstatedir}/knot-resolver/root.keys" \
     -Dinstall_root_keys=enabled \
     -Dinstall_kresd_conf=enabled \
+    -Dmalloc=jemalloc \
     --buildtype=plain \
     --prefix="%{_prefix}" \
     --sbindir="%{_sbindir}" \