Bug #95313 cross compile mysql-connector-odbc-8.0.16 failed
Submitted: 9 May 2019 6:07 Modified: 3 Sep 2020 11:40
Reporter: Wakke Wang Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:8.0.16 OS:Linux
Assigned to: Assigned Account CPU Architecture:ARM

[9 May 2019 6:07] Wakke Wang
Description:
 I am compiling  mysql-connector for armv7 , but some issues ocured, please help me to solve it, thanks.

Build platform : Ubuntu16.06(64 bits)
Target Platform : ARM V7
Tool-chain : gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf
mysql-connector version: 8.0.16
mysql server versoin : 8.0.16

Error log :
[ 38%] Built target mysql_sys
[ 50%] Built target myodbc8w
[ 61%] Built target myodbc8a
[ 62%] Building CXX object setupgui/CMakeFiles/myodbc8S.dir/callbacks.cc.o
In file included from /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/bits/localefwd.h:41:0,
                 from /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/string:43,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/lex_string.h:30,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/m_string.h:39,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/my_sys.h:54,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/MYODBC_MYSQL.h:55,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/setupgui/setupgui.h:67,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/setupgui/callbacks.cc:31:
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:147:11: error: 'basic_stringbuf' does not name a type
   typedef basic_stringbuf<char>  stringbuf;
           ^~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:150:11: error: 'basic_istringstream' does not name a type
   typedef basic_istringstream<char>  istringstream;
           ^~~~~~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:153:11: error: 'basic_ostringstream' does not name a type
   typedef basic_ostringstream<char>  ostringstream;
           ^~~~~~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:156:11: error: 'basic_stringstream' does not name a type
   typedef basic_stringstream<char>  stringstream;
           ^~~~~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:187:11: error: 'basic_stringbuf' does not name a type
   typedef basic_stringbuf<wchar_t>  wstringbuf;
           ^~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:190:11: error: 'basic_istringstream' does not name a type
   typedef basic_istringstream<wchar_t>  wistringstream;
           ^~~~~~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:193:11: error: 'basic_ostringstream' does not name a type
   typedef basic_ostringstream<wchar_t>  wostringstream;
           ^~~~~~~~~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/iosfwd:196:11: error: 'basic_stringstream' does not name a type
   typedef basic_stringstream<wchar_t>  wstringstream;
CharT, _Traits>& __is,
     ^~~~~~~
In file included from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/m_string.h:39:0,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/my_sys.h:54,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/MYODBC_MYSQL.h:55,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/setupgui/setupgui.h:67,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/setupgui/callbacks.cc:31:
/home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/lex_string.h:44:20: error: 'string' in namespace 'std' does not name a type
 static inline std::string to_string(const LEX_STRING &str) {
                    ^~~~~~
/home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/lex_string.h:48:20: error: 'string' in namespace 'std' does not name a type
 static inline std::string to_string(const LEX_CSTRING &str) {
                    ^~~~~~
In file included from /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/array:39:0,
                 from /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/tuple:39,
                 from /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/functional:55,
                 from /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/memory:79,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/include/mysql-8.0/my_alloc.h:35,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/MYODBC_MYSQL.h:58,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/setupgui/setupgui.h:67,
                 from /home/user/work/cross_compile/mysql-connector-odbc-8.0.16-src/setupgui/callbacks.cc:31:
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/stdexcept:56:29: error: 'string' in namespace 'std' does not name a type
     __cow_string(const std::string&);
                             ^~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/stdexcept:67:11: error: 'std::basic_string' is not a template
   typedef basic_string<char> __sso_string;
           ^~~~~~~~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/stdexcept:120:23: error: 'string' does not name a type
     logic_error(const string& __arg) _GLIBCXX_TXN_SAFE;
                       ^~~~~~
/opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/stdexcept:150:33: error: 'string' does not name a type
     explicit domain_error(const string& __arg) _GLIBCXX_TXN_SAFE;
                                 ^~~~~~

How to repeat:

Build platform : Ubuntu16.06(64 bits)
Target Platform : ARM V7
Tool-chain : gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf
mysql-connector version: 8.0.16
mysql server versoin : 8.0.16

On Ubunru16.04:

$ export MYSQL_INCLUDE_DIR=/home/user/work/cross_compile/mysql-8.0.16/_install/include

$ export MYSQL_LIB_DIR=/home/user/work/cross_compile/mysql-8.0.16/_install/lib
$ export MYSQL_DIR=/home/user/work/cross_compile/mysql-8.0.16/_install

$ cd  mysql-connector-odbc-8.0.16 && mkdir _build && cd _build

$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross.cmake  -DSTACK_DIRECTION=1 -DODBC_INCLUDES=/home/user/work/cross_compile/unixODBC-2.3.7/_install/include -DODBC_LIB_DIR=/home/user/work/cross_compile/unixODBC-2.3.7/_install/lib -DWITH_UNIXODBC=1 -DMYSQLCLIENT_STATIC_LINKING=FALSE -DMYSQL_CFLAGS="-I/home/user/work/cross_compile/mysql-8.0.16/_install/include "  -DMYSQL_CXXFLAGS="-I/home/user/work/cross_compile/mysql-8.0.16/_install/include " -DMYSQL_LIB=/home/user/work/cross_compile/mysql-8.0.16/_install/lib/libmysqlclient.so -DMYSQL_CXX_LINKAGE=1  

$ make 

=========================
Care: my cross.cmake is as follows:

# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)

SET(CMAKE_C_COMPILER /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-g++)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH /opt/ti-processor-sdk-linux-rt-am335x-evm-04.03.00.05/linux-devkit/sysroots/armv7ahf-neon-linux-gnueaf)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(DL_LIBS /home/user/docker/bin_dir/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/lib/libdl.so)
SET(HAVE_LLVM_LIBCPP_EXITCODE 1)
SET(HAVE_CLOCK_GETTIME_EXITCODE 1)
SET(HAVE_CLOCK_REALTIME_EXITCODE 1)
[10 May 2019 1:10] Wakke Wang
cross compile
[10 May 2019 1:31] Wakke Wang
change the category
[3 Aug 2020 11:41] MySQL Verification Team
Hello Wakke Wang,

Thank you for the bug report.
Please check with the new downloads and report us back if issue persist even in the new downloads. Thanks.

Regards,
Ashwini Patil
[4 Sep 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".