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

LTO-enabled compilation fails due to type mismatch in TokuDB XZ code.

    XMLWordPrintable

Details

    Description

      Compilation with LTO enabled fails due to mismatching types in the XZ part of TokuDB, throwing the following errors.

      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.h:39:17: error: type of 'lzma_lzma_encoder_create' does not match original declaration [-Werror=lto-type-mismatch]
       extern lzma_ret lzma_lzma_encoder_create(
                       ^
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.c:550:1: note: 'lzma_lzma_encoder_create' was previously declared here
       lzma_lzma_encoder_create(lzma_coder **coder_ptr, lzma_allocator *allocator,
       ^
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.c:550:1: note: code may be misoptimized unless -fno-strict-aliasing is used
       
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.h:45:17: error: type of 'lzma_lzma_encoder_reset' does not match original declaration [-Werror=lto-type-mismatch]
       extern lzma_ret lzma_lzma_encoder_reset(
                       ^
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.c:478:1: note: 'lzma_lzma_encoder_reset' was previously declared here
       lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
       ^
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.c:478:1: note: code may be misoptimized unless -fno-strict-aliasing is used
       
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.h:49:17: error: type of 'lzma_lzma_encode' does not match original declaration [-Werror=lto-type-mismatch]
       extern lzma_ret lzma_lzma_encode(lzma_coder *restrict coder,
                       ^
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.c:314:1: note: 'lzma_lzma_encode' was previously declared here
       lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
       ^
      /builddir/build/BUILD/mariadb-10.1.21/release/storage/tokudb/PerconaFT/xz/src/build_lzma/src/liblzma/lzma/lzma_encoder.c:314:1: note: code may be misoptimized unless -fno-strict-aliasing is used
      lto1: all warnings being treated as errors
      

      Compiling with -Wno-error=lto-type-mismatch allows the compilation to complete. However due to the differing definitions, this might potentially lead to data-corrupting bugs (I have not investigated whether corruption is actually possible here, but until someone does, it should be assumed to be possible).

      Attachments

        Activity

          People

            Unassigned Unassigned
            Dead2 Hans Kristian Rosbach
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.