From e41bca0066ddcda39b5a3eef17deae066cd113d9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 18 Sep 2014 17:00:44 +0200 Subject: [PATCH] support statically linked jemalloc. use that for release builds --- .../build_configurations/mysql_release.cmake | 2 +- cmake/jemalloc.cmake | 21 ++++++++++++++----- debian/dist/Debian/control | 4 ++-- debian/dist/Ubuntu/control | 4 ++-- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index e705fd6dfdb..543b66477bd 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -123,7 +123,7 @@ IF(UNIX) SET(WITH_EXTRA_CHARSETS all CACHE STRING "") IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") - SET(WITH_JEMALLOC "yes" CACHE STRING "") + SET(WITH_JEMALLOC "static" CACHE STRING "") IF(NOT IGNORE_AIO_CHECK) # Ensure aio is available on Linux (required by InnoDB) diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake index 3ad24f8f6cb..39a97334071 100644 --- a/cmake/jemalloc.cmake +++ b/cmake/jemalloc.cmake @@ -12,12 +12,23 @@ MACRO (CHECK_JEMALLOC) SET(WITH_JEMALLOC "yes") ENDIF() - IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto") - CHECK_LIBRARY_EXISTS(jemalloc malloc_stats_print "" HAVE_JEMALLOC) + IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto" OR + WITH_JEMALLOC STREQUAL "static") + + IF(WITH_JEMALLOC STREQUAL "static") + SET(libname jemalloc_pic) + SET(CMAKE_REQUIRED_LIBRARIES pthread dl m) + ELSE() + SET(libname jemalloc) + ENDIF() + + CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC) + SET(CMAKE_REQUIRED_LIBRARIES) + IF (HAVE_JEMALLOC) - SET(LIBJEMALLOC jemalloc) - ELSEIF (WITH_JEMALLOC STREQUAL "yes") - MESSAGE(FATAL_ERROR "jemalloc is not found") + SET(LIBJEMALLOC ${libname}) + ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto") + MESSAGE(FATAL_ERROR "${libname} is not found") ENDIF() ENDIF() ENDMACRO() diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index df6dfad4ceb..d9070e1aa9b 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -146,7 +146,7 @@ Description: MariaDB database client binaries Package: mariadb-server-core-5.5 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version}), libjemalloc1 (>= 3.0.0) +Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version}) Provides: mysql-server-core, mysql-server-core-5.1, mysql-server-core-5.5 Conflicts: mariadb-server-5.1 (<< 5.1.60), mariadb-server-5.2 (<< 5.2.10), @@ -191,7 +191,7 @@ Architecture: any Suggests: tinyca, mailx, mariadb-test Recommends: libhtml-template-perl Pre-Depends: mariadb-common, adduser (>= 3.40), debconf -Depends: mariadb-client-5.5 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-5.5 (>= ${binary:Version}), libjemalloc1 (>= 3.0.0) +Depends: mariadb-client-5.5 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-5.5 (>= ${binary:Version}) Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index ee40d35bb7c..3dd3294c531 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -146,7 +146,7 @@ Description: MariaDB database client binaries Package: mariadb-server-core-5.5 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version}), libjemalloc1 (>= 3.0.0) +Depends: ${shlibs:Depends}, ${misc:Depends}, libmariadbclient18 (>= ${binary:Version}) Provides: mysql-server-core, mysql-server-core-5.1, mysql-server-core-5.5 Conflicts: mysql-server-5.0, mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, @@ -185,7 +185,7 @@ Architecture: any Suggests: tinyca, mailx, mariadb-test Recommends: libhtml-template-perl Pre-Depends: mariadb-common, adduser (>= 3.40), debconf -Depends: mariadb-client-5.5 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-5.5 (>= ${binary:Version}), libjemalloc1 (>= 3.0.0) +Depends: mariadb-client-5.5 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-5.5 (>= ${binary:Version}) Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,