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

Do not compile 32-bit instructions for wolfSSL on 64bit platforms.

    XMLWordPrintable

Details

    • Bug
    • Status: In Review (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11
    • 10.11
    • Compiling
    • None
    • Related to performance

    Description

      WolfSSL has different implementations of integer handling functions in sp_c32.c and sp_c64.c.
      Which one is used is determined by the SP_WORD_SIZE define. SP_WORD_SIZE is auto-detected from indirect tests, like e.g. the presence of _uint128_t (as determined by checking the HAVE__UINT128_T define).

      Checking for this data type triggers SP_WORD_SIZE to be 64 on Mac (arm64) and causes the code in sp_c32.c to be compiled out.

      This also fixes the UBSAN warnings in it. See https://github.com/wolfSSL/wolfssl/issues/11874 for details on these
      warnings.

      Fixed by adding a check for _uint128_t in wolfssl's cmake file and by exporting the HAVE__UINT128_T define to all wolfssl related headers. The latter is required since some of the headers used by the server rely on this define.

      Note that the code in sp_c64.c is supposedly more optimized for 64bit platforms, so some modest performance improvement is also possible.

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            gkodinov Georgi Kodinov
            Vladislav Vaintroub Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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