Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mysql-extras:master commit in: /
Date: Tue, 11 Dec 2018 17:34:21
Message-Id: 1544549624.a033f9e0dc35edad0a3d5f02b1caa0855aefadaf.grknight@gentoo
1 commit: a033f9e0dc35edad0a3d5f02b1caa0855aefadaf
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 11 17:33:44 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 11 17:33:44 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/mysql-extras.git/commit/?id=a033f9e0
7
8 Restore jemalloc support on the server for 10.2 and 10.3 MariaDB
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 20037_all_mariadb-10.2-restore-jemalloc.patch | 155 ++++++++++++++++++++++++++
13 20037_all_mariadb-10.3-restore-jemalloc.patch | 130 +++++++++++++++++++++
14 2 files changed, 285 insertions(+)
15
16 diff --git a/20037_all_mariadb-10.2-restore-jemalloc.patch b/20037_all_mariadb-10.2-restore-jemalloc.patch
17 new file mode 100644
18 index 0000000..0cf1fbb
19 --- /dev/null
20 +++ b/20037_all_mariadb-10.2-restore-jemalloc.patch
21 @@ -0,0 +1,155 @@
22 +diff --git a/CMakeLists.txt b/CMakeLists.txt
23 +index be86adbf67b8..59dc149410f1 100644
24 +--- a/CMakeLists.txt
25 ++++ b/CMakeLists.txt
26 +@@ -154,6 +154,7 @@ INCLUDE(ssl)
27 + INCLUDE(readline)
28 + INCLUDE(libutils)
29 + INCLUDE(dtrace)
30 ++INCLUDE(jemalloc)
31 + INCLUDE(pcre)
32 + INCLUDE(ctest)
33 + INCLUDE(plugin)
34 +@@ -329,6 +328,7 @@ MYSQL_CHECK_SSL()
35 + MYSQL_CHECK_READLINE()
36 +
37 + SET(MALLOC_LIBRARY "system")
38 ++CHECK_JEMALLOC()
39 +
40 + CHECK_PCRE()
41 +
42 +diff --git a/include/my_global.h b/include/my_global.h
43 +index e4ca562772e0..30db38ce35b5 100644
44 +--- a/include/my_global.h
45 ++++ b/include/my_global.h
46 +@@ -1071,7 +1071,6 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
47 + #ifdef _WIN32
48 + #define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
49 + #define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
50 +-#define RTLD_DEFAULT GetModuleHandle(NULL)
51 + #define dlclose(lib) FreeLibrary((HMODULE)lib)
52 + static inline char *dlerror(void)
53 + {
54 +diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
55 +index 814993355b0f..243468e095a3 100644
56 +--- a/sql/CMakeLists.txt
57 ++++ b/sql/CMakeLists.txt
58 +@@ -170,7 +170,7 @@ ADD_DEPENDENCIES(sql GenServerSource)
59 + ADD_DEPENDENCIES(sql GenDigestServerSource)
60 + DTRACE_INSTRUMENT(sql)
61 + TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
62 +- mysys mysys_ssl dbug strings vio pcre
63 ++ mysys mysys_ssl dbug strings vio pcre ${LIBJEMALLOC}
64 + ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
65 + ${WSREP_LIB}
66 + ${SSL_LIBRARIES}
67 +diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
68 +index d6b1c76ea004..fd724bc7dd16 100644
69 +--- a/sql/sys_vars.cc
70 ++++ b/sql/sys_vars.cc
71 +@@ -3489,32 +3489,11 @@ static Sys_var_charptr Sys_version_compile_os(
72 + CMD_LINE_HELP_ONLY,
73 + IN_SYSTEM_CHARSET, DEFAULT(SYSTEM_TYPE));
74 +
75 +-static char *guess_malloc_library()
76 +-{
77 +- if (strcmp(MALLOC_LIBRARY, "system") == 0)
78 +- {
79 +-#ifdef HAVE_DLOPEN
80 +- typedef int (*mallctl_type)(const char*, void*, size_t*, void*, size_t);
81 +- mallctl_type mallctl_func;
82 +- mallctl_func= (mallctl_type)dlsym(RTLD_DEFAULT, "mallctl");
83 +- if (mallctl_func)
84 +- {
85 +- static char buf[128];
86 +- char *ver;
87 +- size_t len = sizeof(ver);
88 +- mallctl_func("version", &ver, &len, NULL, 0);
89 +- strxnmov(buf, sizeof(buf)-1, "jemalloc ", ver, NULL);
90 +- return buf;
91 +- }
92 +-#endif
93 +- }
94 +- return const_cast<char*>(MALLOC_LIBRARY);
95 +-}
96 + static char *malloc_library;
97 + static Sys_var_charptr Sys_malloc_library(
98 + "version_malloc_library", "Version of the used malloc library",
99 + READ_ONLY GLOBAL_VAR(malloc_library), CMD_LINE_HELP_ONLY,
100 +- IN_SYSTEM_CHARSET, DEFAULT(guess_malloc_library()));
101 ++ IN_SYSTEM_CHARSET, DEFAULT(MALLOC_LIBRARY));
102 +
103 + #ifdef HAVE_YASSL
104 + #include <openssl/ssl.h>
105 +diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
106 +index 4cfb177e495f..fd9a4790a7ea 100644
107 +--- a/storage/tokudb/CMakeLists.txt
108 ++++ b/storage/tokudb/CMakeLists.txt
109 +@@ -5,8 +5,6 @@
110 + RETURN()
111 + ELSEIF(CMAKE_VERSION VERSION_LESS "2.8.9")
112 + MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
113 +-ELSEIF(NOT HAVE_DLOPEN)
114 +- MESSAGE(STATUS "dlopen is required by TokuDB")
115 + ELSEIF(PLUGIN_PERFSCHEMA MATCHES "^NO$")
116 + MESSAGE(STATUS "Performance Schema is required by TokuDB")
117 + RETURN()
118 +@@ -37,8 +35,7 @@
119 + tokudb_sysvars.cc
120 + tokudb_thread.cc
121 + tokudb_dir_cmd.cc)
122 +-MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY
123 +- COMPONENT tokudb-engine CONFIG ${CMAKE_CURRENT_BINARY_DIR}/tokudb.cnf)
124 ++MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY COMPONENT Server)
125 +
126 + IF(NOT TARGET tokudb)
127 + RETURN()
128 +@@ -57,27 +54,6 @@
129 + GET_FILENAME_COMPONENT(LIBJEMALLOC_PATH ${LIBJEMALLOC_SO} REALPATH CACHE)
130 + ENDIF()
131 +
132 +-IF(LIBJEMALLOC_PATH AND (RPM OR DEB))
133 +- UNSET(LIBJEMALLOC)
134 +- GET_DIRECTORY_PROPERTY(V DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITION CPACK_RPM_tokudb-engine_PACKAGE_REQUIRES)
135 +- SET(CPACK_RPM_tokudb-engine_PACKAGE_REQUIRES "${V} jemalloc" PARENT_SCOPE)
136 +- SET(systemd_env "Environment=\"LD_PRELOAD=${LIBJEMALLOC_PATH}\"") #"
137 +- SET(cnf_malloc_lib "malloc-lib=${LIBJEMALLOC_PATH}")
138 +-ELSEIF(LIBJEMALLOC_PATH)
139 +- SET(systemd_env "#Environment=\"LD_PRELOAD=${LIBJEMALLOC_PATH}\"") #"
140 +- SET(cnf_malloc_lib "#malloc-lib=${LIBJEMALLOC_PATH}")
141 +-ELSE()
142 +- SET(systemd_env "#Environment=\"LD_PRELOAD=/path/to/libjemalloc.so\"") #"
143 +- SET(cnf_malloc_lib "#malloc-lib=/path/to/libjemalloc.so")
144 +-ENDIF()
145 +-CONFIGURE_FILE(tokudb.cnf.in tokudb.cnf @ONLY)
146 +-CONFIGURE_FILE(tokudb.conf.in tokudb.conf @ONLY)
147 +-IF(INSTALL_SYSCONFDIR)
148 +- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tokudb.conf
149 +- DESTINATION ${INSTALL_SYSCONFDIR}/systemd/system/mariadb.service.d/
150 +- COMPONENT tokudb-engine)
151 +-ENDIF()
152 +-
153 + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-shadow")
154 + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG)
155 + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
156 +@@ -154,7 +130,7 @@
157 + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/${TOKU_FT_DIR_NAME}/portability)
158 +
159 + TARGET_LINK_LIBRARIES(tokudb tokufractaltree_static tokuportability_static
160 +- ${ZLIB_LIBRARY} ${LIBJEMALLOC} stdc++)
161 ++ ${ZLIB_LIBRARY} stdc++)
162 +
163 + SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")
164 + SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} -flto -fuse-linker-plugin")
165 +diff --git a/storage/tokudb/PerconaFT/tools/CMakeLists.txt b/storage/tokudb/PerconaFT/tools/CMakeLists.txt
166 +index f11b9f350d72..e62931524c9d 100644
167 +--- a/storage/tokudb/PerconaFT/tools/CMakeLists.txt
168 ++++ b/storage/tokudb/PerconaFT/tools/CMakeLists.txt
169 +@@ -12,5 +12,5 @@ endforeach(tool)
170 + # link in math.h library just for this tool.
171 + target_link_libraries(ftverify m)
172 +
173 +-install(TARGETS tokuftdump DESTINATION ${INSTALL_BINDIR} COMPONENT tokudb-engine)
174 +-install(TARGETS tokuft_logprint DESTINATION ${INSTALL_BINDIR} COMPONENT tokudb-engine)
175 ++install(TARGETS tokuftdump DESTINATION ${INSTALL_BINDIR} COMPONENT Server)
176 ++install(TARGETS tokuft_logprint DESTINATION ${INSTALL_BINDIR} COMPONENT Server)
177
178 diff --git a/20037_all_mariadb-10.3-restore-jemalloc.patch b/20037_all_mariadb-10.3-restore-jemalloc.patch
179 new file mode 100644
180 index 0000000..e8d239b
181 --- /dev/null
182 +++ b/20037_all_mariadb-10.3-restore-jemalloc.patch
183 @@ -0,0 +1,130 @@
184 +diff --git a/CMakeLists.txt b/CMakeLists.txt
185 +index be86adbf67b8..59dc149410f1 100644
186 +--- a/CMakeLists.txt
187 ++++ b/CMakeLists.txt
188 +@@ -154,6 +154,7 @@ INCLUDE(ssl)
189 + INCLUDE(readline)
190 + INCLUDE(libutils)
191 + INCLUDE(dtrace)
192 ++INCLUDE(jemalloc)
193 + INCLUDE(pcre)
194 + INCLUDE(ctest)
195 + INCLUDE(plugin)
196 +@@ -329,6 +328,7 @@ MYSQL_CHECK_SSL()
197 + MYSQL_CHECK_READLINE()
198 +
199 + SET(MALLOC_LIBRARY "system")
200 ++CHECK_JEMALLOC()
201 +
202 + CHECK_PCRE()
203 +
204 +diff --git a/include/my_global.h b/include/my_global.h
205 +index e4ca562772e0..30db38ce35b5 100644
206 +--- a/include/my_global.h
207 ++++ b/include/my_global.h
208 +@@ -1071,7 +1071,6 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
209 + #ifdef _WIN32
210 + #define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
211 + #define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
212 +-#define RTLD_DEFAULT GetModuleHandle(NULL)
213 + #define dlclose(lib) FreeLibrary((HMODULE)lib)
214 + static inline char *dlerror(void)
215 + {
216 +diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
217 +index 814993355b0f..243468e095a3 100644
218 +--- a/sql/CMakeLists.txt
219 ++++ b/sql/CMakeLists.txt
220 +@@ -170,7 +170,7 @@ ADD_DEPENDENCIES(sql GenServerSource)
221 + ADD_DEPENDENCIES(sql GenDigestServerSource)
222 + DTRACE_INSTRUMENT(sql)
223 + TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
224 +- mysys mysys_ssl dbug strings vio pcre
225 ++ mysys mysys_ssl dbug strings vio pcre ${LIBJEMALLOC}
226 + ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
227 + ${WSREP_LIB}
228 + ${SSL_LIBRARIES}
229 +diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
230 +index d6b1c76ea004..fd724bc7dd16 100644
231 +--- a/sql/sys_vars.cc
232 ++++ b/sql/sys_vars.cc
233 +@@ -3793,7 +3793,7 @@
234 + static Sys_var_charptr Sys_malloc_library(
235 + "version_malloc_library", "Version of the used malloc library",
236 + READ_ONLY GLOBAL_VAR(malloc_library), CMD_LINE_HELP_ONLY,
237 +- IN_SYSTEM_CHARSET, DEFAULT(guess_malloc_library()));
238 ++ IN_SYSTEM_CHARSET, DEFAULT(MALLOC_LIBRARY));
239 +
240 + static char *ssl_library;
241 + static Sys_var_charptr Sys_ssl_library(
242 +diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
243 +index 4cfb177e495f..fd9a4790a7ea 100644
244 +--- a/storage/tokudb/CMakeLists.txt
245 ++++ b/storage/tokudb/CMakeLists.txt
246 +@@ -5,8 +5,6 @@
247 + RETURN()
248 + ELSEIF(CMAKE_VERSION VERSION_LESS "2.8.9")
249 + MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
250 +-ELSEIF(NOT HAVE_DLOPEN)
251 +- MESSAGE(STATUS "dlopen is required by TokuDB")
252 + ELSEIF(PLUGIN_PERFSCHEMA MATCHES "^NO$")
253 + MESSAGE(STATUS "Performance Schema is required by TokuDB")
254 + RETURN()
255 +@@ -37,8 +35,7 @@
256 + tokudb_sysvars.cc
257 + tokudb_thread.cc
258 + tokudb_dir_cmd.cc)
259 +-MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY
260 +- COMPONENT tokudb-engine CONFIG ${CMAKE_CURRENT_BINARY_DIR}/tokudb.cnf)
261 ++MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY COMPONENT Server)
262 +
263 + IF(NOT TARGET tokudb)
264 + RETURN()
265 +@@ -57,27 +54,6 @@
266 + GET_FILENAME_COMPONENT(LIBJEMALLOC_PATH ${LIBJEMALLOC_SO} REALPATH CACHE)
267 + ENDIF()
268 +
269 +-IF(LIBJEMALLOC_PATH AND (RPM OR DEB))
270 +- UNSET(LIBJEMALLOC)
271 +- GET_DIRECTORY_PROPERTY(V DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITION CPACK_RPM_tokudb-engine_PACKAGE_REQUIRES)
272 +- SET(CPACK_RPM_tokudb-engine_PACKAGE_REQUIRES "${V} jemalloc" PARENT_SCOPE)
273 +- SET(systemd_env "Environment=\"LD_PRELOAD=${LIBJEMALLOC_PATH}\"") #"
274 +- SET(cnf_malloc_lib "malloc-lib=${LIBJEMALLOC_PATH}")
275 +-ELSEIF(LIBJEMALLOC_PATH)
276 +- SET(systemd_env "#Environment=\"LD_PRELOAD=${LIBJEMALLOC_PATH}\"") #"
277 +- SET(cnf_malloc_lib "#malloc-lib=${LIBJEMALLOC_PATH}")
278 +-ELSE()
279 +- SET(systemd_env "#Environment=\"LD_PRELOAD=/path/to/libjemalloc.so\"") #"
280 +- SET(cnf_malloc_lib "#malloc-lib=/path/to/libjemalloc.so")
281 +-ENDIF()
282 +-CONFIGURE_FILE(tokudb.cnf.in tokudb.cnf @ONLY)
283 +-CONFIGURE_FILE(tokudb.conf.in tokudb.conf @ONLY)
284 +-IF(INSTALL_SYSCONFDIR)
285 +- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tokudb.conf
286 +- DESTINATION ${INSTALL_SYSCONFDIR}/systemd/system/mariadb.service.d/
287 +- COMPONENT tokudb-engine)
288 +-ENDIF()
289 +-
290 + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-shadow")
291 + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG)
292 + MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
293 +@@ -154,7 +130,7 @@
294 + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/${TOKU_FT_DIR_NAME}/portability)
295 +
296 + TARGET_LINK_LIBRARIES(tokudb tokufractaltree_static tokuportability_static
297 +- ${ZLIB_LIBRARY} ${LIBJEMALLOC} stdc++)
298 ++ ${ZLIB_LIBRARY} stdc++)
299 +
300 + SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")
301 + SET(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO} -flto -fuse-linker-plugin")
302 +diff --git a/storage/tokudb/PerconaFT/tools/CMakeLists.txt b/storage/tokudb/PerconaFT/tools/CMakeLists.txt
303 +index f11b9f350d72..e62931524c9d 100644
304 +--- a/storage/tokudb/PerconaFT/tools/CMakeLists.txt
305 ++++ b/storage/tokudb/PerconaFT/tools/CMakeLists.txt
306 +@@ -12,5 +12,5 @@ endforeach(tool)
307 + # link in math.h library just for this tool.
308 + target_link_libraries(ftverify m)
309 +
310 +-install(TARGETS tokuftdump DESTINATION ${INSTALL_BINDIR} COMPONENT tokudb-engine)
311 +-install(TARGETS tokuft_logprint DESTINATION ${INSTALL_BINDIR} COMPONENT tokudb-engine)
312 ++install(TARGETS tokuftdump DESTINATION ${INSTALL_BINDIR} COMPONENT Server)
313 ++install(TARGETS tokuft_logprint DESTINATION ${INSTALL_BINDIR} COMPONENT Server)