[MDEV-23900] x86_32 fail to build on innodb crc32q Created: 2020-10-06 Updated: 2020-11-09 Resolved: 2020-11-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Marko Mäkelä |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback, not-10.1, not-10.5 | ||
| Environment: |
x86_32 |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970662 storage/innobase/ut/ut0crc32.cc is gone from the 10.5.5 branch now bug marked as not effecting 10.4 might just be them hitting the MSAN path https://salsa.debian.org/mariadb-team/mariadb-10.5/-/commit/2920d282168f0986430f2feb65273af04ecb2240 |
| Comments |
| Comment by Marko Mäkelä [ 2020-10-07 ] | |||||||||||||||||||||
|
Indeed, related to The patch suggests to replace the generic (register or memory) operand "%0" with "%q0". GCC documentation does not cover the x32 mode of AMD64 very well. I cannot even find a separate section for AMD64; it seems to be covered by the x86 section, which documents the suggested q prefix as follows:
As far as I understand, replacing the "%0" with "%q0" would no longer allow the operand to be a memory address. Let us try to understand what the original code does:
First, this is AT&T syntax, and hence the target operand ("%0" is an alias for the read-modify-write register constraint "+r" holding the variable crc) is specified last, and the q suffix explicitly specifies 64-bit operand size. In Intel syntax (quoting the Intel® SSE4 Programming Reference, July 2007, page 61), this should match the following instruction:
Most notably, all variants specified on that page specify the target operand (first operand in Intel syntax, corresponding to the second operand "%0" above) as a register. All in all, it would seem to be perfectly OK to specify "%q0" instead of "%0" as the target operand on AMD64 or its ABI subset x32:
It might not be equivalent to specify "%q0" for IA-32 mode (if any other registers than eax,ebx,ecx,edx were possible in the first place), but the patch (against an older 10.5 version) was not suggesting that. | |||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-10-07 ] | |||||||||||||||||||||
|
Debian does package MariaDB Server 10.3, and apparently, only starting with the current Debian Sid (unstable), for x32: https://packages.debian.org/sid/mariadb-server-10.3 An x32 package seems to be available. Does it include a similar patch? The linked patch was only applicable to an earlier release in the 10.5 branch. Let me check:
This seems to return mostly irrelevant matches:
I think that only the two matches in debian could be relevant. Let us look closer:
The CRC-32C code was improved several times in 10.5. Before danblack, do we really have to do something? 10.3 apparently seems to compile just fine on x32. It looks like we could technically add the "%q0" constraint in 10.2, 10.3, 10.4, but is it necessary? |