bind: enable building against jemalloc library
authorPhilip Prindeville <[email protected]>
Sun, 25 May 2025 19:04:08 +0000 (13:04 -0600)
committerPhilip Prindeville <[email protected]>
Thu, 12 Jun 2025 03:13:39 +0000 (21:13 -0600)
This provides better instrumentation for finding where memory is
being used, and/or leaked.

Signed-off-by: Philip Prindeville <[email protected]>
net/bind/Config.in
net/bind/Makefile

index f1b83c746536ec523544350654928a9b457f66ad..f36d0a3e35d0dd51ae7b3f78f430bfa3ab885dbd 100644 (file)
@@ -42,3 +42,13 @@ config BIND_ENABLE_GSSAPI
                Disable it by default as krb5-libs is rather large.
 
 endif
+
+config BIND_JEMALLOC
+       bool
+       default n
+       prompt "Include jemalloc for heap debugging in bind-server"
+       help
+               BIND 9 allows linking against jemalloc which can provide
+               more detailed memory usage information to assist in
+               diagnosing heap utilization issues.
+
index 71dafc2a24ea24cf4ab0513f652af008b5fbae4b..f1c56fcd570222b5f06d0b459f8e044f9f012bda 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
 PKG_VERSION:=9.20.9
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 USERID:=bind=57:bind=57
 
 PKG_MAINTAINER:=Noah Meyerhans <[email protected]>
@@ -34,10 +34,14 @@ PKG_BUILD_PARALLEL:=1
 PKG_CONFIG_DEPENDS := \
        CONFIG_BIND_LIBJSON \
        CONFIG_BIND_LIBXML2 \
+       CONFIG_BIND_JEMALLOC \
        CONFIG_BIND_ENABLE_DOH \
        CONFIG_BIND_ENABLE_GSSAPI
 
-PKG_BUILD_DEPENDS += BIND_LIBXML2:libxml2 BIND_LIBJSON:libjson-c
+PKG_BUILD_DEPENDS += \
+       BIND_LIBXML2:libxml2 \
+       BIND_LIBJSON:libjson-c \
+       BIND_JEMALLOC:libjemalloc
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -66,7 +70,8 @@ define Package/bind-libs
        +BIND_ENABLE_GSSAPI:krb5-libs \
        +BIND_ENABLE_GSSAPI:libcomerr \
        +BIND_LIBXML2:libxml2 \
-       +BIND_LIBJSON:libjson-c
+       +BIND_LIBJSON:libjson-c \
+       +BIND_JEMALLOC:libjemalloc
   TITLE:=bind shared libraries
   URL:=https://www.isc.org/software/bind
 endef
@@ -170,6 +175,14 @@ else
                --with-libxml2=no
 endif
 
+ifdef CONFIG_BIND_JEMALLOC
+       CONFIGURE_ARGS += \
+               --with-jemalloc=yes
+else
+       CONFIGURE_ARGS += \
+               --without-jemalloc
+endif
+
 ifdef CONFIG_BIND_ENABLE_DOH
        CONFIGURE_ARGS += \
                --enable-doh