[MDEV-13009] 10.1.24 does not compile on architectures without 64-bit atomics Created: 2017-06-06 Updated: 2017-09-22 Resolved: 2017-06-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling, Storage Engine - InnoDB |
| Affects Version/s: | 10.1.24, 10.0.31 |
| Fix Version/s: | 10.1.25, 10.0.33, 10.2.7, 10.3.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | James Cowgill | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian Stretch 32-bit MIPS |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Attempting to compile mariadb 10.1.24 on 32-bit MIPS fails with this error:
This appears to be caused by this change from Adding the missing #include "sync0types.h" again fixes the issue. |
| Comments |
| Comment by Marko Mäkelä [ 2017-06-13 ] | ||||||||||||||||||||||||||||||||||||||
|
jcowgill, thank you for pointing this out. For the record, InnoDB in MariaDB 10.2 will only support platforms with 64-bit atomics. Also MySQL 5.7 is only supporting 64-bit atomics. I will consider using a mutex-based fallback for 64-bit atomics for the affected 10.1 platforms. Another option would be to ditch the atomics and reintroduce | ||||||||||||||||||||||||||||||||||||||
| Comment by James Cowgill [ 2017-06-13 ] | ||||||||||||||||||||||||||||||||||||||
|
OK. If (since you're talking about mutex fallback) you don't need lock-free atomics, you alternatively link against GCC's libatomic which provides implementations of missing atomics using locks for architectures which don't implement them natively. | ||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-06-13 ] | ||||||||||||||||||||||||||||||||||||||
|
I was able to repeat the problem by applying the following patch to disable 64-bit atomics on my AMD64 development platform:
Strangely, the XtraDB code compiles just fine with the above patch. InnoDB needs the following:
For 10.2, it might be the case that my_atomic_add64() and friends are already working out of the box. jcowgill, can you confirm this? | ||||||||||||||||||||||||||||||||||||||
| Comment by James Cowgill [ 2017-06-14 ] | ||||||||||||||||||||||||||||||||||||||
|
I've been building MariaDB in the context of Debian which already has some patches applied to it. With 10.2, I needed this patch (with some tweaks) to get MariaDB to build on MIPS: https://sources.debian.net/src/mariadb-10.1/10.1.24-3/debian/patches/c11_atomics.patch/ Without it I get "error: #error atomic ops for this platform are not implemented" After applying that patch everything seems to work OK. In any case that is a different bug to this one. | ||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2017-06-26 ] | ||||||||||||||||||||||||||||||||||||||
|
This needs to be backported to 10.0.31 as well to get security updates into Debian and Ubuntu, where .31 stopped building on certain platforms. Here the regression is visible on PowerPC (the old one, not 64-bit): https://bugs.launchpad.net/ubuntu/+source/mariadb-10.0/+bug/1698689 cvicentiu will look into the issue later this week | ||||||||||||||||||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2017-06-28 ] | ||||||||||||||||||||||||||||||||||||||
|
The reason why xtradb works even without the # include "sync0types.h" is due to how "univ.i" (included by srv0mon.h) includes other files and how those files subsequently include "sync0types.h". This difference in behaviour comes from the HOTBACKUP extention that Percona has added to xtradb. | ||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-09-04 ] | ||||||||||||||||||||||||||||||||||||||
|
otto, sorry, I missed your request to backport this to 10.0. I just did that under | ||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-09-04 ] | ||||||||||||||||||||||||||||||||||||||
|
jcowgill, are you able to compile 10.2.7 without any patches related to this? This fix was merged to 10.2 (potentially incorrectly; that is why I ask) a day after your comment, and first released in 10.2.7. | ||||||||||||||||||||||||||||||||||||||
| Comment by James Cowgill [ 2017-09-22 ] | ||||||||||||||||||||||||||||||||||||||
|
@marko, I can confirm that this particular bug is fixed in 10.2.7 (the original error goes away). However, I can't build 10.2.7 on mips without any patches because there are some other atomics issues. I needed a patch similar to this one applied in Debian to build it: |