[MDEV-27936] hardware lock elision on ppc64{,le} failing to compile Created: 2022-02-24 Updated: 2022-04-01 Resolved: 2022-03-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.6 |
| Fix Version/s: | 10.6.8, 10.7.4, 10.8.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
ppc64 / ppc64le |
||
| Issue Links: |
|
||||||||
| Description |
|
Per https://gcc.gnu.org/onlinedocs/gcc/PowerPC-Hardware-Transactional-Memory-Built-in-Functions.html, the builtins are only available when -mhtm or -mcpu=power8 or later. Neither of these are used in the compile. bb-10.6-danielblack- HTM was introduced POWER8, so I'm unsure if older POWER will survive this change. |
| Comments |
| Comment by Marko Mäkelä [ 2022-02-24 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
Related to this, if you can figure out how to make that code compile on s390x, it would be great if you can do that. The programming interface should be very similar on POWER and s390x. I tried it a few times, but eventually I gave up on s390x because at that time, I only had indirect access to s390x via the CI system, with delays of several hours. For experimenting, you might use https://github.com/dr-m/atomic_sync which is a stand-alone version of the code. Much faster to compile and test than the full MariaDB source code. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-02-25 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
s390x - apparently identical - https://gcc.gnu.org/onlinedocs/gcc/PowerPC-Hardware-Transactional-Memory-Built-in-Functions.html Blind testing on bb-10.6-danielblack- Looking closer, can't see why https://buildbot.mariadb.org/#/grid?branch=10.6, there is ppc64le-debian- {10,11,sid}-autobake all running fine and it fails when it gets to debian. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-02-28 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
comparing an actual supported achitecture, ppc64le
htmxlintrin.h is provided by libgcc-11-dev
Only real difference, minor gcc package version that was released on 23 February. otto please rebuild to see if this reoccurs. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-02 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
Apparently our debian sid ppc64le started failing the same way https://buildbot.mariadb.org/#/grid?branch=10.6 Rebuild unsuccessful Probably need a fix like https://github.com/MariaDB/server/commit/ce895ffe7ccb2d46285c0ae2c14acd65009ba8ce for ppc64, moving the xbegin/xend into non-line functions. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-02 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
bb-10.6-danielblack- | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2022-03-02 ] | |||||||||||||||||||||||||||||||||||||||||||||
Yes it reproducible as you noticed on buildbot now as well. Downstream bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006527 | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-03 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
Avoiding this just requires the -mhtm flag to be passed per:
But cmake isn't doing it for me at the moment. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-04 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
otto Please try https://github.com/MariaDB/server/commit/5c8e9cacea2e913c0da74686bfbfeff0a33c2cee Its failing on our bb on side for unknown reasons, however it looks like its ignoring the addition of the -mhtm flag on the srw_lock.cc file. I built the entire innodb with quay.io/mariadb-foundation/bb-worker:debiansid under ppc64le qemu without a problem. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-08 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
the unit test compile of srw_lock.cc needed the cflag too. marko can you please review bb-10.6-danielblack- | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2022-03-08 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
Thanks! The commit above was applied on Debian packaging repo in https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/3478b9d9b2f0520be4f36b84aa444e4cdb90e9da and uploaded, but unfortunately build still fails: https://buildd.debian.org/status/fetch.php?pkg=mariadb-10.6&arch=ppc64el&ver=1%3A10.6.7-3%7Eexp1&stamp=1646726091&raw=0 Full status of latest version in Debian experimental: https://buildd.debian.org/status/package.php?p=mariadb-10.6&suite=experimental | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
otto wrong patch - its bd5f7f0f8930fa343ee676fdffa1cf26b5e12e70 that includes the storage/innobase/unittest/CMakeLists.txt change adding the htm cflag to ../sync/srw_lock.cc Succeeding on https://buildbot.mariadb.org/#/grid?branch=bb-10.6-danielblack-MDEV-27936-ppc64-htm-build-fail for the ppc64le sid builds. (test failures are something infrastructure related - | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2022-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
danblack Updated Debian patch in https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/be847f26c4b5d2ecd6defa9db267a85dc84745ae - does this look good, shall I upload? | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
I moved https://github.com/MariaDB/server/commit/11e68988d9698c3b1f79b8a3a41f81502b3e095c back to using the high level directives, checked the compile (locally under qemu), for less change and spelt elision right. Are the hot attributes or anything else unacceptable? | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, this looks OK to me. According to https://godbolt.org the hot function attribute is supported already by GCC 4.8.5 and the oldest version of clang that I tested. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2022-03-10 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
I changed the version in Debian now to latest version Daniel posted here: https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/e6f568bf63cbae53e25b7f10170d71c68a3c6e62 End result https://salsa.debian.org/mariadb-team/mariadb-server/-/blob/e6f568bf63cbae53e25b7f10170d71c68a3c6e62/debian/patches/1006527-fix-ppc64-ftbfs.patch equals https://github.com/MariaDB/server/commit/11e68988d9698c3b1f79b8a3a41f81502b3e095c. OK? |