[MDEV-6503] MariaDB 10.0.13 compilation fails on Raspberry Pi and rpl_parallel.cc Created: 2014-07-29  Updated: 2015-01-28  Resolved: 2014-09-08

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.0.13
Fix Version/s: 10.0.14

Type: Bug Priority: Major
Reporter: eonMcT Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux raspberrypi 3.12.22+ #691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU/Linux

MariaDB 10.0.13 trunk



 Description   

Compilation from the current trunk version of MariaDB 10.0.13 fails on the Raspberry Pi using Raspbian. I did use the "apt-get build-dep mysql-server" dependencies. (I tried this a few months ago and it failed on that file too.)

[ 41%] Building CXX object sql/CMakeFiles/sql.dir/rpl_parallel.cc.o
cd /home/pi/mariadb/maria/trunk/sql && /usr/bin/c++ -DHAVE_CONFIG_H -DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER -DHAVE_POOL_OF_THREADS -Wall -Wall -Wno-unused-parameter -fno-exceptions -fno-rtti -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -DDBUG_OFF -I/home/pi/mariadb/maria/trunk/include -I/home/pi/mariadb/maria/trunk/sql -I/home/pi/mariadb/maria/trunk/pcre -I/home/pi/mariadb/maria/trunk/zlib -I/home/pi/mariadb/maria/trunk/extra/yassl/include -I/home/pi/mariadb/maria/trunk/extra/yassl/taocrypt/include -DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED -o CMakeFiles/sql.dir/rpl_parallel.cc.o -c /home/pi/mariadb/maria/trunk/sql/rpl_parallel.cc
/home/pi/mariadb/maria/trunk/sql/rpl_parallel.cc: In function ‘void* handle_rpl_parallel_thread(void*)’:
/home/pi/mariadb/maria/trunk/sql/rpl_parallel.cc:800:11: error: ‘rli’ was not declared in this scope
/home/pi/mariadb/maria/trunk/sql/rpl_parallel.cc:813:7: error: ‘rli’ was not declared in this scope
make[2]: *** [sql/CMakeFiles/sql.dir/rpl_parallel.cc.o] Error 1
make[2]: Leaving directory `/home/pi/mariadb/maria/trunk'
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make[1]: Leaving directory `/home/pi/mariadb/maria/trunk'
make: *** [all] Error 2

Deleting the functions starting from line 800 and 813 respectively, resulted in a complete compilation. But i did try this just to see if this is the only thing blocking it.



 Comments   
Comment by Melanie Chevalier [ 2014-08-20 ]

Just confirming this exact compilation error when building on an ARM7 Allwinner A10 SoC.

gcc version is irrelevant, it really is an undeclared variable. I've dug up that the offending lines came over from one of the patches mentioned on this mailing list post:

https://lists.launchpad.net/maria-developers/msg07484.html

Comment by Nathan Malinoski [ 2014-08-27 ]

I'm also experiencing the same 10.0.13 compilation errors at the same lines (7, 11) in rpl_parallel.cc, though on gentoo sparc.

Comment by Sergei Golubchik [ 2014-09-07 ]

Somehow cmake decides that gcc on your platform does not support __sync_* builtins.
And then it falls back to using rwlocks, and gets that error that you have.

As far as I know, both ARM and sparc support atomic ops just fine, and I suspect that any reasonable gcc version would support __sync_* builtins on these architectures. May be gcc 2.95 doesn't.

You can try using -DWITH_ATOMIC_OPS=smp (optionally with -DHAVE_SOLARIS_ATOMIC=1 on sparc). But this, really, should've been detected by cmake.

For Raspberry PI you can consider using -DWITH_ATOMIC_OPS=up this will use the dummy implementation of atomic ops that isn't atomic against threads executing on other CPUs, but perfectly fine on uni-processor system (with no inter-CPU synchronization overhead).

I'll fix the compilation error when rwlocks are used. But you shouldn't have been using in the first place.

Comment by Nathan Malinoski [ 2014-09-08 ]

I'm using gcc 4.7.3, the latest marked as stable for Gentoo sparc.

-DWITH_ATOMIC_OPS=smp doesn't seem to make a difference; fails at the same spot: https://gist.github.com/anonymous/bc0b6435ade6f30d9bfe
-DHAVE_SOLARIS_ATOMIC=1 added to -DWITH_ATOMIC_OPS=smp causes the build to fail much earlier: http://dpaste.com/1E4T5YJ

After discussing it with the #gentoo-sparc devs, I'm going to file a bug on Gentoo's Bugzilla; might be a misconfiguration with GCC.

Comment by Brad Smith [ 2014-09-20 ]

Also ran into this on OpenBSD/powerpc utilizing GCC 4.2.1.

Comment by Brad Smith [ 2014-09-23 ]

I was looking at the commit list to try and see if I could spot a commit to fix the rw locks. Any word on this?

Comment by Sergei Golubchik [ 2014-10-01 ]

it's revid:sergii@pisem.net-20140908105957-90cv53n21kokv1uk

Comment by Brad Smith [ 2014-10-02 ]

Yes, thanks. I am using 10.0.14 now and noticed the issue has been fixed.

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