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

XXH fails to build with GCC 14+ -Og -mavx512f

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q2/2026 Server Maintenance

    Description

      The xxHash implementation that was introduced in MDEV-9826 includes some code that is targeting the AVX512 ISA extension. Unlike in (say) MDEV-33817, we fail to detect and enable this ISA extension.

      Even worse, the code would fail to build if CMAKE_C_FLAGS includes or implies -mavx512f. On my system, this is implied by -march=native, which I usually use.

      12.3 02aedc106596fe494b4fa408a627081319fbecad

      /usr/bin/gcc-16 -DDISABLE_MYSQL_THREAD_H -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -I/mariadb/server/wsrep-lib/include -I/mariadb/server/wsrep-lib/wsrep-API/v26 -I/dev/shm/s/include -I/mariadb/server/include/providers -I/mariadb/server/include -I/dev/shm/s/strings -Og -mavx512f -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -fPIC -g -DPROTECT_STATEMENT_MEMROOT -DENABLED_DEBUG_SYNC -ggdb3 -DSAFE_MUTEX -DTRASH_FREED_MEMORY -Wall -Wdeclaration-after-statement -Wenum-compare -Wenum-conversion -Wextra -Wmissing-braces -Wno-format-truncation -Wno-init-self -Wno-nonnull-compare -Wno-unused-parameter -Wvla -Wwrite-strings -Wframe-larger-than=16384 -std=gnu99 -MD -MT strings/CMakeFiles/strings.dir/hasher-xxh.c.o -MF strings/CMakeFiles/strings.dir/hasher-xxh.c.o.d -o strings/CMakeFiles/strings.dir/hasher-xxh.c.o -c /mariadb/server/strings/hasher-xxh.c
      In file included from /mariadb/server/strings/hasher-xxh.c:10:
      In function 'XXH3_hashLong_64b_withSeed_internal',
          inlined from 'XXH3_hashLong_64b_withSeed' at /mariadb/server/strings/../mysys/xxhash.h:6151:12:
      /mariadb/server/strings/../mysys/xxhash.h:5038:1: error: inlining failed in call to 'always_inline' 'XXH3_initCustomSecret_avx512': function not considered for inlining
       5038 | XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64)
            | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /mariadb/server/strings/../mysys/xxhash.h:6137:9: note: called from here
       6137 |         f_initSec(secret, seed);
            |         ^~~~~~~~~~~~~~~~~~~~~~~
      In function 'XXH3_hashLong_128b_withSeed_internal',
          inlined from 'XXH3_hashLong_128b_withSeed' at /mariadb/server/strings/../mysys/xxhash.h:6963:12:
      /mariadb/server/strings/../mysys/xxhash.h:5038:1: error: inlining failed in call to 'always_inline' 'XXH3_initCustomSecret_avx512': function not considered for inlining
       5038 | XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64)
            | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /mariadb/server/strings/../mysys/xxhash.h:6949:9: note: called from here
       6949 |         f_initSec(secret, seed64);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~
      

      If I change the gcc-16 in the above invocation to gcc-14 or gcc-15, the build fails in the same way. Curiously, with gcc-13 (Debian 13.4.0-9), the build would succeed.

      Based on https://github.com/Cyan4973/xxHash/issues/464 the AVX512 Foundation (avx512f) ISA extension should be supported on any target platform of this major version. I believe that the oldest GCC version that we support starting with 11.8 is GCC 7.

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              marko Marko Mäkelä
              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.