Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23585

checksum.c: only use clmul if available

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5.4
    • 10.5.7
    • Server
    • None

    Description

      If the build environment does not support PCLMUL, then crc32_x86.c is not compiled in, and this fails to link.
      Only call the functions in crc32_x86.c if they have been included.

      fixes builds on older processors without PCLMUL

      see: https://trac.macports.org/ticket/61063

      Patch of interest dec3f8ca69e5e

      Attachments

        Issue Links

          Activity

            There were actually three separate problems, which I fixed:

            1. In some GCC-compatible AMD64 build environments, the CMake check for HAVE_CLMUL_INSTRUCTION was being skipped unnecessarily.
            2. The result of the HAVE_CLMUL_INSTRUCTION check was not passed to the compilation.
            3. The SIMD acceleration was unnecessarily limited to 64-bit builds, while it works fine on 32-bit too.
            marko Marko Mäkelä added a comment - There were actually three separate problems, which I fixed: In some GCC-compatible AMD64 build environments, the CMake check for HAVE_CLMUL_INSTRUCTION was being skipped unnecessarily. The result of the HAVE_CLMUL_INSTRUCTION check was not passed to the compilation. The SIMD acceleration was unnecessarily limited to 64-bit builds, while it works fine on 32-bit too.

            I revised the HAVE_CLMUL_INSTRUCTION check to include inline assembler code for the cpuid instruction, because 32-bit -fPIC builds would fail on GCC 4.8.2. GCC 5 implemented register spilling for the PIC register (ebx) that would be clobbered by the cpuid instruction.

            marko Marko Mäkelä added a comment - I revised the HAVE_CLMUL_INSTRUCTION check to include inline assembler code for the cpuid instruction, because 32-bit -fPIC builds would fail on GCC 4.8.2. GCC 5 implemented register spilling for the PIC register ( ebx ) that would be clobbered by the cpuid instruction.

            People

              marko Marko Mäkelä
              anel Anel Husakovic
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.