[MDEV-7369] [PATCH] MariaDB build fails when XTRADB_STORAGE_ENGINE enabled Created: 2014-12-24  Updated: 2014-12-28  Due: 2015-01-24  Resolved: 2014-12-28

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 5.5.40, 5.5.41
Fix Version/s: 5.5.42, 10.0.16

Type: Bug Priority: Major
Reporter: Łukasz Jendrysik Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

Using -DWITHOUT_XTRADB_STORAGE_ENGINE=1 there's no problem to build MariaDB 5.5.40 or .41. Without this switch I get following output:

/usr/bin/ar: creating /home/builder/mariadb/src/mariadb-5.5.41/libmysqld/libmysqld.a
[ 98%] Built target mysqlserver
Scanning dependencies of target symlink_libmysqlclient_r.a
Scanning dependencies of target libmysqld
[ 98%] Generating libmysqlclient_r.a
[ 98%] Built target symlink_libmysqlclient_r.a
[ 99%] Building CXX object libmysqld/CMakeFiles/libmysqld.dir/libmysqld_exports_file.cc.o
Scanning dependencies of target mysql_client_test_embedded
[ 99%] Building C object libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/__/__/tests/mysql_client_test.c.o
Linking CXX shared library libmysqld.so
libmysqld.a(srv0start.c.o): In function `innobase_start_or_create_for_mysql':
/home/builder/mariadb/src/mariadb-5.5.41/storage/xtradb/srv/srv0start.c:1280: undefined reference to `os_stacktrace_print'
collect2: error: ld returned 1 exit status
libmysqld/CMakeFiles/libmysqld.dir/build.make:89: recipe for target 'libmysqld/libmysqld.so.18' failed
make[2]: *** [libmysqld/libmysqld.so.18] Error 1
CMakeFiles/Makefile2:7409: recipe for target 'libmysqld/CMakeFiles/libmysqld.dir/all' failed
make[1]: *** [libmysqld/CMakeFiles/libmysqld.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX static library libsql.a
[ 99%] Built target sql
Linking CXX executable mysql_client_test_embedded
../libmysqld.a(srv0start.c.o): In function `innobase_start_or_create_for_mysql':
/home/builder/mariadb/src/mariadb-5.5.41/storage/xtradb/srv/srv0start.c:1280: undefined reference to `os_stacktrace_print'
collect2: error: ld returned 1 exit status
libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/build.make:89: recipe for target 'libmysqld/examples/mysql_client_test_embedded' failed
make[2]: *** [libmysqld/examples/mysql_client_test_embedded] Error 1
CMakeFiles/Makefile2:7550: recipe for target 'libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/all' failed
make[1]: *** [libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2
>>> ERROR: mariadb: all failed



 Comments   
Comment by Elena Stepanova [ 2014-12-24 ]

We build the server with XtraDB successfully, so apparently it's not a common issue.
Please provide your complete cmake command and information about environment – OS, compiler versions, etc.

Also, are you trying to run an incremental build? If so, did you try to make clean, remove CMakeCache.txt and run a clean one?

Comment by Łukasz Jendrysik [ 2014-12-24 ]

cmake command:

cmake . -DBUILD_CONFIG=mysql_release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DSYSCONFDIR=/etc/mysql \
	-DMYSQL_DATADIR=/var/lib/mysql \
    	-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
    	-DDEFAULT_CHARSET=utf8 \
    	-DDEFAULT_COLLATION=utf8_general_ci \
    	-DENABLED_LOCAL_INFILE=ON \
    	-DINSTALL_INFODIR=share/mysql/docs \
    	-DINSTALL_MANDIR=share/man \
    	-DINSTALL_PLUGINDIR=lib/mysql/plugin \
    	-DINSTALL_SCRIPTDIR=bin \
    	-DINSTALL_INCLUDEDIR=include/mysql \
    	-DINSTALL_DOCREADMEDIR=share/mysql \
    	-DINSTALL_SUPPORTFILESDIR=share/mysql \
    	-DINSTALL_MYSQLSHAREDIR=share/mysql \
    	-DINSTALL_DOCDIR=share/mysql/docs \
    	-DINSTALL_SHAREDIR=share/mysql \
    	-DWITH_READLINE=ON \
    	-DWITH_ZLIB=system \
    	-DWITH_SSL=system \
    	-DWITH_LIBWRAP=OFF \
    	-DWITH_EXTRA_CHARSETS=complex \
    	-DWITH_EMBEDDED_SERVER=ON \
    	-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
    	-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
    	-DWITH_INNOBASE_STORAGE_ENGINE=1 \
    	-DWITH_PARTITION_STORAGE_ENGINE=1 \
    	-DWITH_TOKUDB_STORAGE_ENGINE=1 \
	-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
    	-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
    	-DWITHOUT_PBXT_STORAGE_ENGINE=1 \

Host: Arch Linux i686, Linux 3.17.6, gcc 4.9.2
Build chroot environment: Alpine Linux Edge x86, gcc 4.9.2, zlib 1.2.8, cmake 3.1.0, readline 6.3, libaio 0.3.110, jemalloc 3.6.0, glib 2.42, ncurses 5.9 and probably the most important: musl 1.1.5 (Alpine is a musl based distro).

No, I'm doing a full build every time.

Comment by James Taylor [ 2014-12-27 ]

I'm having a look at the code... Would it be wise to add a conditional so this code is never reached under libc's other than GLIBC?

Comment by James Taylor [ 2014-12-27 ]

"os_stacktrace_print" is only declared if "#if defined (_linux_) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS"

Pull Request: https://github.com/MariaDB/server/pull/14

From 786033366991c1ea2b8a460585096ad8c6a18510 Mon Sep 17 00:00:00 2001
From: James Taylor <james@jtaylor.id.au>
Date: Sat, 27 Dec 2014 03:23:49 +0000
Subject: [PATCH] Add fix for MDEV-7369
 
See also https://mariadb.atlassian.net/browse/MDEV-7369
---
 storage/xtradb/include/os0stacktrace.h | 4 ++--
 storage/xtradb/srv/srv0start.cc        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
 
diff --git a/storage/xtradb/include/os0stacktrace.h b/storage/xtradb/include/os0stacktrace.h
index 58e9a52..e79347c 100644
--- a/storage/xtradb/include/os0stacktrace.h
+++ b/storage/xtradb/include/os0stacktrace.h
@@ -20,7 +20,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef os0stacktrace_h
 #define os0stacktrace_h
 
-#ifdef __linux__
+#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS
 #if HAVE_EXECINFO_H
 #include <execinfo.h>
 #endif
@@ -40,5 +40,5 @@ os_stacktrace_print(
 	siginfo_t* info,     /*!< in: signal information */
 	void*      ucontext);/*!< in: signal context */
 
-#endif /*  __linux__ */
+#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */
 #endif /* os0stacktrace.h */
diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc
index 86bc8ce..c76cbb8 100644
--- a/storage/xtradb/srv/srv0start.cc
+++ b/storage/xtradb/srv/srv0start.cc
@@ -1646,7 +1646,7 @@ innobase_start_or_create_for_mysql(void)
 	stacktrace feature. */
 
 	if (srv_use_stacktrace) {
-#ifdef __linux__
+#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS
 		 struct sigaction sigact;
 
 		 sigact.sa_sigaction = os_stacktrace_print;
@@ -1659,7 +1659,7 @@ innobase_start_or_create_for_mysql(void)
 			 srv_use_stacktrace = FALSE;
 
 		 }
-#endif /* __linux__ */
+#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */
 	}
 
 #ifdef UNIV_DEBUG
-- 
2.2.0

Comment by Łukasz Jendrysik [ 2014-12-27 ]

@James Taylor, thanks for the patch!

Comment by James Taylor [ 2014-12-27 ]

It was a trivial fix once I found out where it was defined .

All I did was copy the conditional to everywhere that used it

Comment by Jan Lindström (Inactive) [ 2014-12-28 ]

revno: 4398
committer: Jan Lindström <jplindst@mariadb.org>
branch nick: 5.5
timestamp: Sun 2014-12-28 13:24:53 +0200
message:
MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled

Patch by James Taylor.

Comment by Jan Lindström (Inactive) [ 2014-12-28 ]

revno: 4546
committer: Jan Lindström <jplindst@mariadb.org>
branch nick: 10.0-innodb
timestamp: Sun 2014-12-28 13:44:30 +0200
message:
MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled

Patch by James Taylor.

Generated at Thu Feb 08 07:19:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.