mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
MDEV-23585: Fix the 32-bit build on GCC 4
GCC before version 5 would fail to emit the CPUID instruction when targeting IA-32 in -fPIC mode. Therefore, we must add the CPUID instruction to the HAVE_CLMUL_INSTRUCTION check. This means that the PCLMUL accelerated crc32() function will not be available on i686 executables that are compiled with GCC 4. The limitation does not impact AMD64 builds or non-PIC x86 builds, or other compilers (clang, or GCC 5 or newer).
This commit is contained in:
parent
05aa7ae7ba
commit
fe5dbfe723
1 changed files with 3 additions and 1 deletions
|
|
@ -59,10 +59,12 @@ IF (WIN32)
|
|||
ENDIF()
|
||||
|
||||
IF(NOT MSVC AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|i[36]86")
|
||||
#Check for PCLMUL instruction (x86)
|
||||
#Check for CPUID and PCLMUL. GCC before version 5 would refuse to emit the
|
||||
#CPUID instruction for -m32 -fPIC because it would clobber the EBX register.
|
||||
CHECK_C_SOURCE_COMPILES("
|
||||
int main()
|
||||
{
|
||||
asm volatile (\"cpuid\" : : \"a\"(1) : \"ebx\");
|
||||
asm volatile (\"pclmulqdq \\$0x00, %%xmm1, %%xmm0\":::\"cc\");
|
||||
return 0;
|
||||
}" HAVE_CLMUL_INSTRUCTION)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue