From: Vladimír Čunát Date: Fri, 7 Oct 2022 12:17:57 +0000 (+0200) Subject: distro/pkg/*: build with jemalloc X-Git-Tag: v5.6.0~11^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d409727ea503d1a5744c01700fdb4d92748ab846;p=thirdparty%2Fknot-resolver.git distro/pkg/*: build with jemalloc --- diff --git a/distro/pkg/arch/PKGBUILD b/distro/pkg/arch/PKGBUILD index 967ad7ca9..7eea556e5 100644 --- a/distro/pkg/arch/PKGBUILD +++ b/distro/pkg/arch/PKGBUILD @@ -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 } diff --git a/distro/pkg/deb/control b/distro/pkg/deb/control index fdf213cc5..1f9964d23 100644 --- a/distro/pkg/deb/control +++ b/distro/pkg/deb/control @@ -16,6 +16,7 @@ Build-Depends: libsystemd-dev (>= 227) [linux-any], libcap-ng-dev, libuv1-dev, + libjemalloc-dev, luajit, pkg-config, meson (>= 0.49), diff --git a/distro/pkg/deb/rules b/distro/pkg/deb/rules index 3445b8ce5..c57747609 100755 --- a/distro/pkg/deb/rules +++ b/distro/pkg/deb/rules @@ -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 diff --git a/distro/pkg/nix/default.nix b/distro/pkg/nix/default.nix index af42fa80e..16c66d054 100644 --- a/distro/pkg/nix/default.nix +++ b/distro/pkg/nix/default.nix @@ -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" diff --git a/distro/pkg/rpm/knot-resolver.spec b/distro/pkg/rpm/knot-resolver.spec index 1c6b9e838..0a7e2838f 100644 --- a/distro/pkg/rpm/knot-resolver.spec +++ b/distro/pkg/rpm/knot-resolver.spec @@ -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}" \