git » mariadb.git » commit 582ad83

Force preloading jemalloc from systemd service. This prevents every

author Christian Hesse
2019-01-16 13:49:47 UTC
committer Christian Hesse
2019-01-16 13:49:47 UTC
parent 56f10ebf774b833236ac101adbcadad974f950a7

Force preloading jemalloc from systemd service. This prevents every

single executable being linked against jemalloc.

PKGBUILD +3 -2

diff --git a/PKGBUILD b/PKGBUILD
index b18567f..a4dec06 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ pkgbase=mariadb
 pkgname=('mariadb-libs' 'mariadb-clients' 'mariadb' 'mytop')
 pkgdesc='Fast SQL database server, derived from MySQL'
 pkgver=10.3.12
-pkgrel=1
+pkgrel=2
 arch=('x86_64')
 license=('GPL')
 url='https://mariadb.org/'
@@ -22,8 +22,10 @@ prepare() {
   # Changes to the upstream unit files:
   #  * remove the alias from unit files, we install symlinks in package function
   #  * enable PrivateTmp for a little bit more security
+  #  * force preloading jemalloc for memory management
   sed -i -e '/^Alias/d' \
     -e '/^PrivateTmp/c PrivateTmp=true' \
+    -e '/# Environment="LD_/a Environment="LD_PRELOAD=/usr/lib/libjemalloc.so"' \
     support-files/mariadb{,@}.service.in
 
   # let's create the datadir from tmpfiles
@@ -40,7 +42,6 @@ build() {
   local _cmake_options=(
     # build options
     -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DCMAKE_EXE_LINKER_FLAGS='-ljemalloc'
     -Wno-dev
 
     # file paths