[Maria-discuss] Cross compile issue
Hi, I have problem to do cross compile on mariadb-10.0.21. Where can I find the relative document? Best Regards, Johnson
Hi, Johnson! On Aug 25, Johnson Cheng wrote:
Hi,
I have problem to do cross compile on mariadb-10.0.21. Where can I find the relative document?
Check the knowledgebase and if there's nothing there, then mailing list archives. I'm not sure about knowledgebase, but this topic was certainly discussed on the mailing list. What is the problem that you have? Regards, Sergei
Dear Sergei, Thanks for your reply. I am sorry that I can NOT find any document about cross compile from knowledge base. https://mariadb.com/kb/en/mariadb/getting-installing-and-upgrading-mariadb/ My host machine is Debian5. (gcc version is 4.3.2) My target machine is Intel x86_64 with gcc version is 4.8.3 My Cmake version is 3.2.2 on host machine Here is my cmake command to configure mariadb-10.0.21 for cross compile, PATH=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/:/bin:/sbin:/usr/bin:/usr/sbin AR=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ar AS=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-as LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/ cross_prj /sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ CXXFLAGS="-I/home/johnson/ cross_prj /:sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/ cross_prj /sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake . Unfortunately I meet the below error while typing "make VERBOSE=1", [ 15%] Generating ../include/mysqld_error.h.tmp cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/extra && ./comp_err --charset=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/share/charsets --out-dir=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/share/ --header_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include/mysqld_error.h.tmp --name_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include/mysqld_ername.h.tmp --state_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include/sql_state.h.tmp --in_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/share/errmsg-utf8.txt ./comp_err: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./comp_err) ./comp_err: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./comp_err) make[2]: *** [include/mysqld_error.h.tmp] Error 1 It tries to use my cross compiled extra/comp_err utility to do something at my host machine. Could you give me some advice to fix this issue? Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Wednesday, August 26, 2015 12:39 AM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Aug 25, Johnson Cheng wrote:
Hi,
I have problem to do cross compile on mariadb-10.0.21. Where can I find the relative document?
Check the knowledgebase and if there's nothing there, then mailing list archives. I'm not sure about knowledgebase, but this topic was certainly discussed on the mailing list. What is the problem that you have? Regards, Sergei
Hi, Johnson! On Aug 27, Johnson Cheng wrote:
Dear Sergei,
Thanks for your reply. I am sorry that I can NOT find any document about cross compile from knowledge base. https://mariadb.com/kb/en/mariadb/getting-installing-and-upgrading-mariadb/
Yes, that's why I suggested to search the mailing list too. I wasn't sure there's something in the knowledge base :(
My host machine is Debian5. (gcc version is 4.3.2) My target machine is Intel x86_64 with gcc version is 4.8.3 My Cmake version is 3.2.2 on host machine Here is my cmake command to configure mariadb-10.0.21 for cross compile, PATH=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/:/bin:/sbin:/usr/bin:/usr/sbin AR=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ar AS=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-as LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/ cross_prj /sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ CXXFLAGS="-I/home/johnson/ cross_prj /:sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/ cross_prj /sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake .
Unfortunately I meet the below error while typing "make VERBOSE=1", [ 15%] Generating ../include/mysqld_error.h.tmp cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/extra && ./comp_err --charset=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/share/charsets --out-dir=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/share/ --header_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include/mysqld_error.h.tmp --name_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include/mysqld_ername.h.tmp --state_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include/sql_state.h.tmp --in_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/share/errmsg-utf8.txt ./comp_err: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./comp_err) ./comp_err: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./comp_err) make[2]: *** [include/mysqld_error.h.tmp] Error 1
It tries to use my cross compiled extra/comp_err utility to do something at my host machine.
Right... During the build few helper tools are compiled and used in the build. See http://www.cmake.org/Wiki/CMake_Cross_Compiling In particular, we implement the solution from http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_bui... So, you need to build for the native platform first. Not everything, just "import_executables" target: make import_executables This will create import_executables.cmake file. When you cross-compile you'll need to set IMPORT_EXECUTABLES to the path to that file. Regards, Sergei
Dear Sergei, A little understand but not totally. My native compile directory is "/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native" using "make import_executables" The below is my cross.cmake file content, SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR x86_64) SET(STACK_DIRECTION 1) SET(CMAKE_C_COMPILER /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc) SET(CMAKE_CXX_COMPILER /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++) SET(CMAKE_FIND_ROOT_PATH /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot) SET(IMPORT_EXECUTABLES /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) My configure command is listed as below, PATH=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/:/bin:/sbin:/usr/bin:/usr/sbin AR=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ar AS=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-as LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ CXXFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake ../mariadb-10.0.21 \ -DCMAKE_TOOLCHAIN_FILE=../cross.cmake I get two errors about IMPORTFILE-NOTFOUND and XtraDB as below, CMake Error at CMakeLists.txt:367 (INCLUDE): include could not find load file: IMPORTFILE-NOTFOUND -- Performing Test HAVE_WVLA -- Performing Test HAVE_WVLA - Success -- Looking for include file libaio.h -- Looking for include file libaio.h - found -- Looking for io_queue_init in /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/lib/libaio.so -- Looking for io_queue_init in /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/lib/libaio.so - found -- Looking for sched_getcpu -- Looking for sched_getcpu - found -- Performing Test HAVE_C99_INITIALIZERS -- Performing Test HAVE_C99_INITIALIZERS - Success -- Looking for asprintf -- Looking for asprintf - found -- Check size of pthread_t -- Check size of pthread_t - done -- Performing Test HAVE_WERROR -- Performing Test HAVE_WERROR - Success CMake Error at storage/xtradb/CMakeLists.txt:464 (MESSAGE): Percona XtraDB is not supported on this platform -- Configuring incomplete, errors occurred! Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Thursday, August 27, 2015 3:34 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Aug 27, Johnson Cheng wrote:
Dear Sergei,
Thanks for your reply. I am sorry that I can NOT find any document about cross compile from knowledge base. https://mariadb.com/kb/en/mariadb/getting-installing-and-upgrading-mar iadb/
Yes, that's why I suggested to search the mailing list too. I wasn't sure there's something in the knowledge base :(
My host machine is Debian5. (gcc version is 4.3.2) My target machine is Intel x86_64 with gcc version is 4.8.3 My Cmake version is 3.2.2 on host machine Here is my cmake command to configure mariadb-10.0.21 for cross compile, PATH=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/:/bin:/sbin:/usr/bin:/usr/sbin AR=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ar AS=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-as LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/ cross_prj /sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ CXXFLAGS="-I/home/johnson/ cross_prj /:sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/ cross_prj /sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake .
Unfortunately I meet the below error while typing "make VERBOSE=1", [ 15%] Generating ../include/mysqld_error.h.tmp cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10. 0.21/extra && ./comp_err --charset=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/m ariadb-10.0.21/sql/share/charsets --out-dir=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/m ariadb-10.0.21/sql/share/ --header_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/maria db/mariadb-10.0.21/include/mysqld_error.h.tmp --name_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb /mariadb-10.0.21/include/mysqld_ername.h.tmp --state_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariad b/mariadb-10.0.21/include/sql_state.h.tmp --in_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/m ariadb-10.0.21/sql/share/errmsg-utf8.txt ./comp_err: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./comp_err) ./comp_err: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./comp_err) make[2]: *** [include/mysqld_error.h.tmp] Error 1
It tries to use my cross compiled extra/comp_err utility to do something at my host machine.
Right... During the build few helper tools are compiled and used in the build. See http://www.cmake.org/Wiki/CMake_Cross_Compiling In particular, we implement the solution from http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_bui... So, you need to build for the native platform first. Not everything, just "import_executables" target: make import_executables This will create import_executables.cmake file. When you cross-compile you'll need to set IMPORT_EXECUTABLES to the path to that file. Regards, Sergei
Hi, Johnson! On Aug 27, Johnson Cheng wrote:
Dear Sergei,
A little understand but not totally. ... I get two errors about IMPORTFILE-NOTFOUND and XtraDB as below, CMake Error at CMakeLists.txt:367 (INCLUDE): include could not find load file:
IMPORTFILE-NOTFOUND
Exactly, because I wrote
This will create import_executables.cmake file. When you cross-compile you'll need to set IMPORT_EXECUTABLES to the path to that file.
And you have not done it. The default value of IMPORT_EXECUTABLES is IMPORTFILE-NOTFOUND.
CMake Error at storage/xtradb/CMakeLists.txt:464 (MESSAGE): Percona XtraDB is not supported on this platform
XtraDB needs atomic ops, it won't compile without them. You can either try to figure out why they're not detected (may be, it's because you're cross-compiling or may be your gcc on your target architecture doesn't support atomic ops). Or you can configure the build to disable XtraDB. Regards, Sergei
Dear Sergei, Sorry to update again. (I am a newer on cmake) I did some modifications on my configure command as below, LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ CXXFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake . \ -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \ -DIMPORT_EXECUTABLES=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native/import_executables.cmake \ -DXTRADB_OK=1 It can success to configure, but it still has DB warning message. I am not sure if I can ignore it?? CMake Warning at storage/tokudb/CMakeLists.txt:17 (MESSAGE): TokuDB is enabled, but jemalloc is not. This configuration is not supported Now I type "make" to do cross compiling, It seems it's not easy... [ 17%] Building CXX object storage/xtradb/CMakeFiles/xtradb.dir/buf/buf0buddy.cc.o [ 17%] Building CXX object storage/xtradb/CMakeFiles/xtradb.dir/buf/buf0buf.cc.o /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc: In function �buf_block_t* buf_page_get_gen(ulint, ulint, ulint, ulint, buf_block_t*, ulint, const char*, ulint, mtr_t*)’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc:3021:55: error: �os_atomic_increment_ulint’ was not declared in this scope os_atomic_increment_ulint(&buf_pool->n_pend_unzip, 1); ^ /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc:3060:55: error: �os_atomic_decrement_ulint’ was not declared in this scope os_atomic_decrement_ulint(&buf_pool->n_pend_unzip, 1); ^ /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc: In function �buf_page_t* buf_page_init_for_read(dberr_t*, ulint, ulint, ulint, ulint, ib_int64_t, ulint)’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc:3960:54: error: �os_atomic_increment_ulint’ was not declared in this scope os_atomic_increment_ulint(&buf_pool->n_pend_reads, 1); ^ .......................... Best Regards, Johnson -----Original Message----- From: Johnson Cheng Sent: Thursday, August 27, 2015 8:12 PM To: 'Sergei Golubchik' Cc: maria-discuss@lists.launchpad.net Subject: RE: [Maria-discuss] Cross compile issue Dear Sergei, A little understand but not totally. My native compile directory is "/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native" using "make import_executables" The below is my cross.cmake file content, SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR x86_64) SET(STACK_DIRECTION 1) SET(CMAKE_C_COMPILER /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc) SET(CMAKE_CXX_COMPILER /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++) SET(CMAKE_FIND_ROOT_PATH /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot) SET(IMPORT_EXECUTABLES /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) My configure command is listed as below, PATH=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/:/bin:/sbin:/usr/bin:/usr/sbin AR=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ar AS=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-as LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ CXXFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake ../mariadb-10.0.21 \ -DCMAKE_TOOLCHAIN_FILE=../cross.cmake I get two errors about IMPORTFILE-NOTFOUND and XtraDB as below, CMake Error at CMakeLists.txt:367 (INCLUDE): include could not find load file: IMPORTFILE-NOTFOUND -- Performing Test HAVE_WVLA -- Performing Test HAVE_WVLA - Success -- Looking for include file libaio.h -- Looking for include file libaio.h - found -- Looking for io_queue_init in /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/lib/libaio.so -- Looking for io_queue_init in /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/lib/libaio.so - found -- Looking for sched_getcpu -- Looking for sched_getcpu - found -- Performing Test HAVE_C99_INITIALIZERS -- Performing Test HAVE_C99_INITIALIZERS - Success -- Looking for asprintf -- Looking for asprintf - found -- Check size of pthread_t -- Check size of pthread_t - done -- Performing Test HAVE_WERROR -- Performing Test HAVE_WERROR - Success CMake Error at storage/xtradb/CMakeLists.txt:464 (MESSAGE): Percona XtraDB is not supported on this platform -- Configuring incomplete, errors occurred! Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Thursday, August 27, 2015 3:34 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Aug 27, Johnson Cheng wrote:
Dear Sergei,
Thanks for your reply. I am sorry that I can NOT find any document about cross compile from knowledge base. https://mariadb.com/kb/en/mariadb/getting-installing-and-upgrading-mar iadb/
Yes, that's why I suggested to search the mailing list too. I wasn't sure there's something in the knowledge base :(
My host machine is Debian5. (gcc version is 4.3.2) My target machine is Intel x86_64 with gcc version is 4.8.3 My Cmake version is 3.2.2 on host machine Here is my cmake command to configure mariadb-10.0.21 for cross compile, PATH=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/:/bin:/sbin:/usr/bin:/usr/sbin AR=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ar AS=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-as LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/ cross_prj /sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ CXXFLAGS="-I/home/johnson/ cross_prj /:sysroot/usr/include -I/home/johnson/ cross_prj /sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/ cross_prj /sysroot/lib -L/home/johnson/ cross_prj /sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake .
Unfortunately I meet the below error while typing "make VERBOSE=1", [ 15%] Generating ../include/mysqld_error.h.tmp cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10. 0.21/extra && ./comp_err --charset=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/m ariadb-10.0.21/sql/share/charsets --out-dir=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/m ariadb-10.0.21/sql/share/ --header_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/maria db/mariadb-10.0.21/include/mysqld_error.h.tmp --name_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb /mariadb-10.0.21/include/mysqld_ername.h.tmp --state_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariad b/mariadb-10.0.21/include/sql_state.h.tmp --in_file=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/m ariadb-10.0.21/sql/share/errmsg-utf8.txt ./comp_err: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./comp_err) ./comp_err: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./comp_err) make[2]: *** [include/mysqld_error.h.tmp] Error 1
It tries to use my cross compiled extra/comp_err utility to do something at my host machine.
Right... During the build few helper tools are compiled and used in the build. See http://www.cmake.org/Wiki/CMake_Cross_Compiling In particular, we implement the solution from http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_bui... So, you need to build for the native platform first. Not everything, just "import_executables" target: make import_executables This will create import_executables.cmake file. When you cross-compile you'll need to set IMPORT_EXECUTABLES to the path to that file. Regards, Sergei
Hi, Johnson! On Aug 27, Johnson Cheng wrote:
Dear Sergei,
Sorry to update again. (I am a newer on cmake) I did some modifications on my configure command as below, LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ CXXFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake . \ -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \ -DIMPORT_EXECUTABLES=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native/import_executables.cmake \ -DXTRADB_OK=1
This is not a good idea. I mean -DXTRADB_OK=1. XTRADB_OK is set internally if HAVE_IB_GCC_ATOMIC_BUILTINS or HAVE_IB_SOLARIS_ATOMICS or MSVC is defined. Depending on what exactly is defined, different parts of the code are enabled. When you force XTRADB_OK=1 without enabling any of the other defines, XtraDB will not enable any of these parts of the code. Most probably it won't compile at all. Instead of forcing -DXTRADB_OK=1, you need to do -DHAVE_IB_GCC_ATOMIC_BUILTINS=1. Then XtraDB will compile as if gcc atomic builtins were available. They probably are anyway, but cross-compilation caused the test to fail.
It can success to configure, but it still has DB warning message. I am not sure if I can ignore it?? CMake Warning at storage/tokudb/CMakeLists.txt:17 (MESSAGE): TokuDB is enabled, but jemalloc is not. This configuration is not supported
If you intend to use tokudb, then you probably should not ignore it. if you don't intend to use tokudb, you can as well specify -DWITHOUT_TOKUDB=1 and it won't be compiled at all.
Now I type "make" to do cross compiling, It seems it's not easy... [ 17%] Building CXX object storage/xtradb/CMakeFiles/xtradb.dir/buf/buf0buddy.cc.o [ 17%] Building CXX object storage/xtradb/CMakeFiles/xtradb.dir/buf/buf0buf.cc.o /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc: In function �buf_block_t* buf_page_get_gen(ulint, ulint, ulint, ulint, buf_block_t*, ulint, const char*, ulint, mtr_t*)’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc:3021:55: error: �os_atomic_increment_ulint’ was not declared in this scope os_atomic_increment_ulint(&buf_pool->n_pend_unzip, 1); ^
That's exactly what I meant above. This error happens because you've defined TOKUDB_OK=1 Regards, Sergei
Dear Sergei, My tool chain support atomic oops, but HAVE_IB_GCC_ATOMIC_BUILTINS will not set because I use cross-compiling. (from storage/xtradb/CMakeLists.txt rule) Yes. I use "-DHAVE_IB_GCC_ATOMIC_BUILTINS=1" instead of "-DXTRADB_OK=1" to work around this issue because my tool chain really support atomic opps. As you said, I will meet the cross compile issue. It failed at the below message, [ 47%] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql && /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_OPENSSL -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/include -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -DDBUG_OFF -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/pcre -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -o CMakeFiles/sql.dir/mysqld.cc.o -c /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc: In function ‘void init_pcre()’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc:3585:3: error: ‘pcre_stack_guard’ was not declared in this scope pcre_stack_guard= check_enough_stack_size_slow; ^ make[2]: *** [sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1 Could you give me some advice? Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Thursday, August 27, 2015 10:07 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Aug 27, Johnson Cheng wrote:
Dear Sergei,
Sorry to update again. (I am a newer on cmake) I did some modifications on my configure command as below, LD=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ld NM=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-nm CC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc GCC=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc CXX=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ RANLIB=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-ranlib \ CFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ CXXFLAGS="-I/home/johnson/cross_prj/sysroot/usr/include -I/home/johnson/cross_prj/sysroot/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ CXXLDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib -lm -lz -ldl -lcrypt -pthread" \ ../../cmake/HOST-cmake/bin/cmake . \ -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \ -DIMPORT_EXECUTABLES=/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/native/import_executables.cmake \ -DXTRADB_OK=1
This is not a good idea. I mean -DXTRADB_OK=1. XTRADB_OK is set internally if HAVE_IB_GCC_ATOMIC_BUILTINS or HAVE_IB_SOLARIS_ATOMICS or MSVC is defined. Depending on what exactly is defined, different parts of the code are enabled. When you force XTRADB_OK=1 without enabling any of the other defines, XtraDB will not enable any of these parts of the code. Most probably it won't compile at all. Instead of forcing -DXTRADB_OK=1, you need to do -DHAVE_IB_GCC_ATOMIC_BUILTINS=1. Then XtraDB will compile as if gcc atomic builtins were available. They probably are anyway, but cross-compilation caused the test to fail.
It can success to configure, but it still has DB warning message. I am not sure if I can ignore it?? CMake Warning at storage/tokudb/CMakeLists.txt:17 (MESSAGE): TokuDB is enabled, but jemalloc is not. This configuration is not supported
If you intend to use tokudb, then you probably should not ignore it. if you don't intend to use tokudb, you can as well specify -DWITHOUT_TOKUDB=1 and it won't be compiled at all.
Now I type "make" to do cross compiling, It seems it's not easy... [ 17%] Building CXX object storage/xtradb/CMakeFiles/xtradb.dir/buf/buf0buddy.cc.o [ 17%] Building CXX object storage/xtradb/CMakeFiles/xtradb.dir/buf/buf0buf.cc.o /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc: In function �buf_block_t* buf_page_get_gen(ulint, ulint, ulint, ulint, buf_block_t*, ulint, const char*, ulint, mtr_t*)’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/xtradb/buf/buf0buf.cc:3021:55: error: �os_atomic_increment_ulint’ was not declared in this scope os_atomic_increment_ulint(&buf_pool->n_pend_unzip, 1); ^
That's exactly what I meant above. This error happens because you've defined TOKUDB_OK=1 Regards, Sergei
Hi, Johnson! On Aug 28, Johnson Cheng wrote:
Dear Sergei,
My tool chain support atomic oops, but HAVE_IB_GCC_ATOMIC_BUILTINS will not set because I use cross-compiling. (from storage/xtradb/CMakeLists.txt rule) Yes. I use "-DHAVE_IB_GCC_ATOMIC_BUILTINS=1" instead of "-DXTRADB_OK=1" to work around this issue because my tool chain really support atomic opps. As you said, I will meet the cross compile issue. It failed at the below message, [ 47%] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql && /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_OPENSSL -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/include -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -DDBUG_OFF -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/pcre -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -o CMakeFiles/sql.dir/mysqld.cc.o -c /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc: In function ‘void init_pcre()’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc:3585:3: error: ‘pcre_stack_guard’ was not declared in this scope pcre_stack_guard= check_enough_stack_size_slow; ^ make[2]: *** [sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1
Could you give me some advice?
pcre_stack_guard was our addition to pcre to fix stack overflow issues. we have pcre in the source tree and it was patched to have pcre_stack_guard. We've also submitted the patch upstream and it got into pcre-8.34 (iirc). So our CMakeLists.txt tests whether pcre_stack_guard is present in the system pcre and if not - uses bundled pcre. I suspect that your native system pcre is 8.34 or later and your cross-compilation pcre is older, so cmake thought that it can use system pcre and later that failed. You can fix it either by upgrading your cross-compilation pcre or by forcing bundled pcre. Regards, Sergei
Dear Sergei, You are right. My pcre version of cross compile is 8.30. Now I upgrade it to 8.37. Then I meet the another issue about strerror prototype define because it's different with my Linux 3.1.4.27. [ 62%] Building CXX object storage/connect/CMakeFiles/connect.dir/filamvct.cpp.o /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/connect/filamvct.cpp:70:23: error: declaration of ‘char* strerror(int)’ has a different exception specifier char *strerror(int num); ^ In file included from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/connect/global.h:9:0, from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/connect/filamvct.cpp:51: /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include/string.h:413:14: error: from previous declaration ‘char* strerror(int) throw ()’ extern char *strerror (int __errnum) __THROW; ^ make[2]: *** [storage/connect/CMakeFiles/connect.dir/filamvct.cpp.o] Error 1 make[1]: *** [storage/connect/CMakeFiles/connect.dir/all] Error 2 make: *** [all] Error 2 My solution is commend out strerror define in storage/connect/filamvct.cpp and storage/connect/tabvct.cpp files. #if defined(UNIX) // Add dummy strerror (NGC) //char *strerror(int num); #endif // UNIX Is it right? Or have better solution? Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Friday, August 28, 2015 4:48 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Aug 28, Johnson Cheng wrote:
Dear Sergei,
My tool chain support atomic oops, but HAVE_IB_GCC_ATOMIC_BUILTINS will not set because I use cross-compiling. (from storage/xtradb/CMakeLists.txt rule) Yes. I use "-DHAVE_IB_GCC_ATOMIC_BUILTINS=1" instead of "-DXTRADB_OK=1" to work around this issue because my tool chain really support atomic opps. As you said, I will meet the cross compile issue. It failed at the below message, [ 47%] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql && /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_OPENSSL -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/include -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -DDBUG_OFF -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/pcre -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -o CMakeFiles/sql.dir/mysqld.cc.o -c /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc: In function ‘void init_pcre()’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc:3585:3: error: ‘pcre_stack_guard’ was not declared in this scope pcre_stack_guard= check_enough_stack_size_slow; ^ make[2]: *** [sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1
Could you give me some advice?
pcre_stack_guard was our addition to pcre to fix stack overflow issues. we have pcre in the source tree and it was patched to have pcre_stack_guard. We've also submitted the patch upstream and it got into pcre-8.34 (iirc). So our CMakeLists.txt tests whether pcre_stack_guard is present in the system pcre and if not - uses bundled pcre. I suspect that your native system pcre is 8.34 or later and your cross-compilation pcre is older, so cmake thought that it can use system pcre and later that failed. You can fix it either by upgrading your cross-compilation pcre or by forcing bundled pcre. Regards, Sergei
Dear Sergei, I am sorry that I meet another cross compile issue about this, Linking CXX shared module ha_archive.so [ 72%] Built target archive Scanning dependencies of target tokuportability_static_conv [ 72%] Building CXX object storage/tokudb/ft-index/portability/CMakeFiles/tokuportability_static_conv.dir/huge_page_detection.c c.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/features.h:378:0, from /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/mman.h:22, from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/tokudb/ft-index/portab ility/huge_page_detection.cc:91: /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/cdefs.h:286:63: error: ‘int stat(const char*, s tat*)’ hides constructor for ‘struct stat’ [-Werror=shadow] # define __nonnull(params) __attribute__ ((__nonnull__ params)) ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/stat.h:219:6: note: in expansion of macro ‘__no nnull’ __nonnull ((1, 2)); ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/cdefs.h:286:63: error: ‘int stat64(const char*, stat64*)’ hides constructor for ‘struct stat64’ [-Werror=shadow] # define __nonnull(params) __attribute__ ((__nonnull__ params)) ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/stat.h:229:47: note: in expansion of macro ‘__n onnull’ struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); ^ cc1plus: all warnings being treated as errors I am not sure which library I miss. Could you give me some suggestions? Best Regards, Johnson -----Original Message----- From: Johnson Cheng Sent: Friday, August 28, 2015 7:43 PM To: 'Sergei Golubchik' Cc: maria-discuss@lists.launchpad.net Subject: RE: [Maria-discuss] Cross compile issue Dear Sergei, You are right. My pcre version of cross compile is 8.30. Now I upgrade it to 8.37. Then I meet the another issue about strerror prototype define because it's different with my Linux 3.1.4.27. [ 62%] Building CXX object storage/connect/CMakeFiles/connect.dir/filamvct.cpp.o /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/connect/filamvct.cpp:70:23: error: declaration of ‘char* strerror(int)’ has a different exception specifier char *strerror(int num); ^ In file included from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/connect/global.h:9:0, from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/connect/filamvct.cpp:51: /home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include/string.h:413:14: error: from previous declaration ‘char* strerror(int) throw ()’ extern char *strerror (int __errnum) __THROW; ^ make[2]: *** [storage/connect/CMakeFiles/connect.dir/filamvct.cpp.o] Error 1 make[1]: *** [storage/connect/CMakeFiles/connect.dir/all] Error 2 make: *** [all] Error 2 My solution is commend out strerror define in storage/connect/filamvct.cpp and storage/connect/tabvct.cpp files. #if defined(UNIX) // Add dummy strerror (NGC) //char *strerror(int num); #endif // UNIX Is it right? Or have better solution? Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Friday, August 28, 2015 4:48 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Aug 28, Johnson Cheng wrote:
Dear Sergei,
My tool chain support atomic oops, but HAVE_IB_GCC_ATOMIC_BUILTINS will not set because I use cross-compiling. (from storage/xtradb/CMakeLists.txt rule) Yes. I use "-DHAVE_IB_GCC_ATOMIC_BUILTINS=1" instead of "-DXTRADB_OK=1" to work around this issue because my tool chain really support atomic opps. As you said, I will meet the cross compile issue. It failed at the below message, [ 47%] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o cd /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql && /home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DHAVE_OPENSSL -DHAVE_POOL_OF_THREADS -DMYSQL_SERVER -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/include -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -DDBUG_OFF -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/include -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql -I/home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/pcre -I/home/johnson/SanSoft/model/Phoenix_130313/build/sysroot/usr/include -o CMakeFiles/sql.dir/mysqld.cc.o -c /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc: In function ‘void init_pcre()’: /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/sql/mysqld.cc:3585:3: error: ‘pcre_stack_guard’ was not declared in this scope pcre_stack_guard= check_enough_stack_size_slow; ^ make[2]: *** [sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1
Could you give me some advice?
pcre_stack_guard was our addition to pcre to fix stack overflow issues. we have pcre in the source tree and it was patched to have pcre_stack_guard. We've also submitted the patch upstream and it got into pcre-8.34 (iirc). So our CMakeLists.txt tests whether pcre_stack_guard is present in the system pcre and if not - uses bundled pcre. I suspect that your native system pcre is 8.34 or later and your cross-compilation pcre is older, so cmake thought that it can use system pcre and later that failed. You can fix it either by upgrading your cross-compilation pcre or by forcing bundled pcre. Regards, Sergei
Hi, Johnson! On Sep 01, Johnson Cheng wrote:
Dear Sergei,
I am sorry that I meet another cross compile issue about this,
Linking CXX shared module ha_archive.so [ 72%] Built target archive Scanning dependencies of target tokuportability_static_conv [ 72%] Building CXX object storage/tokudb/ft-index/portability/CMakeFiles/tokuportability_static_conv.dir/huge_page_detection.cc.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/features.h:378:0, from /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/mman.h:22, from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/tokudb/ft-index/portability/huge_page_detection.cc:91: /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/cdefs.h:286:63: error: ’int stat(const char*, stat*)’ hides constructor for ’struct stat’ [-Werror=shadow] # define __nonnull(params) __attribute__ ((__nonnull__ params)) ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/stat.h:219:6: note: in expansion of macro ’__nonnull’ __nonnull ((1, 2)); ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/cdefs.h:286:63: error: ’int stat64(const char*, stat64*)’ hides constructor for ’struct stat64’ [-Werror=shadow] # define __nonnull(params) __attribute__ ((__nonnull__ params)) ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/stat.h:229:47: note: in expansion of macro ’__nonnull’ struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); ^ cc1plus: all warnings being treated as errors
I am not sure which library I miss. Could you give me some suggestions?
This looks like an issue with your system headers. TokuDB only makes it fatal by using -Werror. If I were you I'd simply remove -Werror and let the compilation continue. Regards, Sergei
Dear Sergei, Thanks for your reply. I am not sure what it happened because it is disappeared when I re-cross-compile mariaDB at another new environment. Actually I am dig out a problem about DB_TXN error message as below, [ 80%] Building CXX object storage/tokudb/CMakeFiles/tokudb.dir/ha_tokudb.cc.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/ha_tokudb.cc:122:0: /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h: In function int txn_begin(DB_ENV*, DB_TXN*, DB_TXN**, uint32_t, THD*): /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h:407:19: error: DB_TXN has no member named ‘set_client_id this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); ^ In file included from /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/ha_tokudb.cc:139:0: /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/tokudb_status.h: In function int tokudb::remove_metadata(DB*, void*, uint, DB_TXN*): /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/tokudb_status.h:159:58: error: DB_DELETE_ANY was not declared in this scope int error = status_db->del(status_db, txn, &key, DB_DELETE_ANY); ^ /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/tokudb_status.h: In function int tokudb::open_status(DB_ENV*, DB**, const char*, DB_TXN*): /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/tokudb_status.h:212:36: error: DB has no member named change_pagesize error = status_db->change_pagesize(status_db, status_dict_pagesize); ^ ......... /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/tokudb_card.h:265:62: error: TOKUDB_INTERRUPTED was not declared in this scope if (error == DB_NOTFOUND || error == TOKUDB_INTERRUPTED) ^ Fortunately, I find out the root cause because I have installed BerkeleyDB at first. It seems mariaDB and BerkeleyDB can't co-exist. Now I can cross compile mariaDB every time, and I am doing the final fine tune. Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Wednesday, September 02, 2015 10:14 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Sep 01, Johnson Cheng wrote:
Dear Sergei,
I am sorry that I meet another cross compile issue about this,
Linking CXX shared module ha_archive.so [ 72%] Built target archive Scanning dependencies of target tokuportability_static_conv [ 72%] Building CXX object storage/tokudb/ft-index/portability/CMakeFiles/tokuportability_static_ conv.dir/huge_page_detection.cc.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/features.h:378:0, from /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/mman.h:22, from /home/johnson/SanSoft/model/Phoenix_130313/Package/mariadb/mariadb-10.0.21/storage/tokudb/ft-index/portability/huge_page_detection.cc:91: /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/incl ude/sys/cdefs.h:286:63: error: ’int stat(const char*, stat*)’ hides constructor for ’struct stat’ [-Werror=shadow] # define __nonnull(params) __attribute__ ((__nonnull__ params)) ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/stat.h:219:6: note: in expansion of macro ’__nonnull’ __nonnull ((1, 2)); ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/incl ude/sys/cdefs.h:286:63: error: ’int stat64(const char*, stat64*)’ hides constructor for ’struct stat64’ [-Werror=shadow] # define __nonnull(params) __attribute__ ((__nonnull__ params)) ^ /home/johnson/SanSoft/model/Phoenix_130313-0831/build/sysroot/usr/include/sys/stat.h:229:47: note: in expansion of macro ’__nonnull’ struct stat64 *__restrict __buf) __THROW __nonnull ((1, 2)); ^ cc1plus: all warnings being treated as errors
I am not sure which library I miss. Could you give me some suggestions?
This looks like an issue with your system headers. TokuDB only makes it fatal by using -Werror. If I were you I'd simply remove -Werror and let the compilation continue. Regards, Sergei
Hi, Johnson! On Sep 03, Johnson Cheng wrote:
Dear Sergei,
Thanks for your reply. I am not sure what it happened because it is disappeared when I re-cross-compile mariaDB at another new environment. Actually I am dig out a problem about DB_TXN error message as below, [ 80%] Building CXX object storage/tokudb/CMakeFiles/tokudb.dir/ha_tokudb.cc.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/ha_tokudb.cc:122:0: /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h: In function int txn_begin(DB_ENV*, DB_TXN*, DB_TXN**, uint32_t, THD*): /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h:407:19: error: DB_TXN has no member named ‘set_client_id this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); ^ Fortunately, I find out the root cause because I have installed BerkeleyDB at first. It seems mariaDB and BerkeleyDB can't co-exist.
Yes, TokuDB uses uses data types with the same name. But they can coexist (they do on my laptop), so that must be something related to cross compilation again, may be cmake gets include paths incorrectly...
Now I can cross compile mariaDB every time, and I am doing the final fine tune.
Congrats! Regards, Sergei
Dear Sergei, After spent a lot of time on try-and-error method, I find out a solution. This issue happened because it conflicts to berkeleyDB db.h and db_cxx.h include files, so you just remove these two files before cross compiling mariaDB. It's work but this is not my solution. Because my mariaDB include path is set to sysroot/include and sysroot/usr/include, and my berkeleyDB installed path is also set to "sysroot/usr" (sysroot/usr/include, sysroot/usr/lib/, ..), I just correct my berkeleyDB installed path from "sysroot/usr" to "sysroot/usr/local". It can solve data structure conflict issue between berkeleyDB and mariaDB, like DB_TXN ... Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Thursday, September 03, 2015 9:00 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Sep 03, Johnson Cheng wrote:
Dear Sergei,
Thanks for your reply. I am not sure what it happened because it is disappeared when I re-cross-compile mariaDB at another new environment. Actually I am dig out a problem about DB_TXN error message as below, [ 80%] Building CXX object storage/tokudb/CMakeFiles/tokudb.dir/ha_tokudb.cc.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/ha_tokudb.cc:122:0: /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h: In function int txn_begin(DB_ENV*, DB_TXN*, DB_TXN**, uint32_t, THD*): /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h:407:19: error: DB_TXN has no member named ‘set_client_id this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); ^ Fortunately, I find out the root cause because I have installed BerkeleyDB at first. It seems mariaDB and BerkeleyDB can't co-exist.
Yes, TokuDB uses uses data types with the same name. But they can coexist (they do on my laptop), so that must be something related to cross compilation again, may be cmake gets include paths incorrectly...
Now I can cross compile mariaDB every time, and I am doing the final fine tune.
Congrats! Regards, Sergei
Dear All, SOLVED. I share my final solution here, and hope it can help more people in the future. Prerequisite packages: (I list the dependency packages with my version) cmake 3.22 ncurses 5.5 zlib 1.2.8 pcre 8.37 The content of my cross.cmake file: SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR x86_64) SET(STACK_DIRECTION -1) SET(HAVE_IB_GCC_ATOMIC_BUILTINS 1) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) Steps to cross compile mariadb-10.0.21: 1. Untar mariadb-10.0.21 # mkdir mariadb # cd mariadb && tar zxvf mariadb-10.0.21.tar.gz 2. build host utility # mkdir native # cd native && /home/johnson/cmake/HOST-cmake/bin/cmake ../mariadb-10.0.21 # make import_executables 3. Patch storage/connect/filamvct.cpp and storage/connect/tabvct.cp, otherwise you will have trouble on Linux 3.14.x during cross-compiling because the prototype is not the same. Comment out strerror definition as below, //char *strerror(int num); 4. cross compile # mkdir cross # CFLAGS="-I/home/johnson/cross_prj/sysroot/include -I/home/johnson/cross_prj/sysroot/usr/include" \ CXXFLAGS="-I/home/johnson/cross_prj/sysroot/include -I/home/johnson/cross_prj/sysroot/usr/include" \ LDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib" \ CXXLDFLAGS="-L/home/johnson/cross_prj/sysroot/lib -L/home/johnson/cross_prj/sysroot/usr/lib" \ /home/johnson/cmake/HOST-cmake/bin/cmake ../mariadb-10.0.21 \ -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \ -DCMAKE_C_COMPILER=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-gcc \ -DCMAKE_CXX_COMPILER=/home/johnson/x86_64_TCglibc-2.19-3/usr/bin/x86_64-buildroot-linux-gnu-g++ \ -DIMPORT_EXECUTABLES=/home/johnson/mariadb/native/import_executables.cmake \ -DCMAKE_FIND_ROOT_PATH=/home/johnson/cross_prj/sysroot # make Trouble shooting: 1. If you have problem on DB_TXN that no member named set_client_id during cross-compiling Maybe it’s conflict with berkeleyDB data structure. You can modify berkeleyDB installed path to /home/johnson/cross_prj/sysroot/usr/local. 2. If you have problem on pcre_stack_guard that not declared during cross-compiling, I suspect that your native system pcre is 8.34 or later and your cross-compilation pcre is older. You can upgrade your pcre version to 8.37. It's OK on my environment. Finally, thanks for the help of Sergei. Best Regards, Johnson -----Original Message----- From: Johnson Cheng Sent: Sunday, September 06, 2015 4:37 PM To: 'Sergei Golubchik' Cc: maria-discuss@lists.launchpad.net Subject: RE: [Maria-discuss] Cross compile issue Dear Sergei, After spent a lot of time on try-and-error method, I find out a solution. This issue happened because it conflicts to berkeleyDB db.h and db_cxx.h include files, so you just remove these two files before cross compiling mariaDB. It's work but this is not my solution. Because my mariaDB include path is set to sysroot/include and sysroot/usr/include, and my berkeleyDB installed path is also set to "sysroot/usr" (sysroot/usr/include, sysroot/usr/lib/, ..), I just correct my berkeleyDB installed path from "sysroot/usr" to "sysroot/usr/local". It can solve data structure conflict issue between berkeleyDB and mariaDB, like DB_TXN ... Best Regards, Johnson -----Original Message----- From: Sergei Golubchik [mailto:serg@mariadb.org] Sent: Thursday, September 03, 2015 9:00 PM To: Johnson Cheng Cc: maria-discuss@lists.launchpad.net Subject: Re: [Maria-discuss] Cross compile issue Hi, Johnson! On Sep 03, Johnson Cheng wrote:
Dear Sergei,
Thanks for your reply. I am not sure what it happened because it is disappeared when I re-cross-compile mariaDB at another new environment. Actually I am dig out a problem about DB_TXN error message as below, [ 80%] Building CXX object storage/tokudb/CMakeFiles/tokudb.dir/ha_tokudb.cc.o In file included from /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/ha_tokudb.cc:122:0: /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h: In function int txn_begin(DB_ENV*, DB_TXN*, DB_TXN**, uint32_t, THD*): /home/johnson/SanSoft/model/Phoenix_130313-0901/Package/maria/mariadb-10.0.21/storage/tokudb/hatoku_defines.h:407:19: error: DB_TXN has no member named ‘set_client_id this_txn->set_client_id(this_txn, thd_get_thread_id(thd)); ^ Fortunately, I find out the root cause because I have installed BerkeleyDB at first. It seems mariaDB and BerkeleyDB can't co-exist.
Yes, TokuDB uses uses data types with the same name. But they can coexist (they do on my laptop), so that must be something related to cross compilation again, may be cmake gets include paths incorrectly...
Now I can cross compile mariaDB every time, and I am doing the final fine tune.
Congrats! Regards, Sergei
Hi, Johnson! Thanks a lot! Based on this thread I've created a page in the knowledge base with the instructions: https://mariadb.com/kb/en/mariadb/cross-compiling-mariadb/ Hopefully, the next developer who will try cross-compiling MariaDB will find it almost as simple as normal compilation :) Regards, Sergei On Sep 07, Johnson Cheng wrote:
Dear All,
SOLVED. I share my final solution here, and hope it can help more people in the future. ...
participants (2)
-
Johnson Cheng
-
Sergei Golubchik