maria-discuss team mailing list archive
Mailing list archive
Re: Cross compile issue
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 220.127.116.11.
[ 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,
/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: *** [storage/connect/CMakeFiles/connect.dir/filamvct.cpp.o] Error 1
make: *** [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.
// Add dummy strerror (NGC)
//char *strerror(int num);
#endif // UNIX
Is it right? Or have better solution?
From: Sergei Golubchik [mailto:serg@xxxxxxxxxxx]
Sent: Friday, August 28, 2015 4:48 PM
To: Johnson Cheng
Subject: Re: [Maria-discuss] Cross compile issue
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: *** [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.