Skip to content

Building with GCC 13 results in error #105

Description

@mateusz-mowka

When building from the tip of the develop branch and cryptography-primitives_2_3_0 with GCC 13 there's "Werror=stringop-overflow=" error

On branch cryptography-primitives_2_2_0 this issue does not appear.

fst@gklab-070-100:~/cryptography-primitives$ sudo CC=gcc CXX=g++ cmake CMakeLists.txt -B_build -DARCH=intel64
-- CMAKE_BUILD_TYPE is unset, defaulting to Release
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /usr/bin/python3 (found version "3.12.3") found components: Interpreter
-- CMAKE_VERSION ......................... 3.28.3
-- NONPIC_LIB ............................ off
-- PROJECT ............................... Intel® Cryptography Primitives Library
-- CMAKE_BINARY_DIR ...................... /home/fst/cryptography-primitives/_build
-- CMAKE_OUTPUT_DIR ...................... /home/fst/cryptography-primitives/_build/.build
-- CMAKE_SOURCE_DIR ...................... /home/fst/cryptography-primitives
-- IPP_CRYPTO_DIR ........................ /home/fst/cryptography-primitives
-- CMAKE_GENERATOR ....................... Unix Makefiles
-- CMAKE_C_COMPILER_ID ................... GNU
-- CMAKE_CXX_COMPILER_ID ................. GNU
-- IPP_CRYPTO_INCLUDE_DIR ................ /home/fst/cryptography-primitives/include
-- IPP_CRYPTO_SOURCES_INCLUDE_DIR ........ /home/fst/cryptography-primitives/sources/include
-- IPP_CRYPTO_SOURCES_DIR ................ /home/fst/cryptography-primitives/sources/ippcp
-- ARCH .................................. intel64
-- DYNAMIC_LIB ........................... ON
-- CMAKE_INSTALL_PREFIX .................. /root/intel/ippcp_2.3.0
-- CLANG_TIDY ............................ off
-- PYTHON_VERSION_STRING ................. 3.12.3
-- MERGED_BLD ............................ on
-- BUILD_EXAMPLES ........................ off
-- BUILD_WITH_SANITIZERS ................. off - use -DBUILD_WITH_SANITIZERS=[memory,address,undefined,thread] with CLANG compiler to enable this option
-- Using compiler options from ........... /home/fst/cryptography-primitives/sources/cmake/linux/GNU8.2.0.cmake
-- The ASM_NASM compiler identification is NASM
-- Found assembler: /usr/bin/nasm
-- Assembler path ........................ /usr/bin/nasm
-- Assembler version string .............. NASM version 2.16.02 compiled on Mar 26 2026
-- Assembler version ..................... 2.16.02
-- Assembler object format ............... elf64
-- CMAKE_BUILD_TYPE is not set to Debug explicitly, defaulting to Release
-- Intel® AVX-IFMA ....................... on
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found suitable version "3.5.5", minimum required is "3.5.5")
-- Configuring done (3.1s)
-- Generating done (1.2s)
-- Build files have been written to: /home/fst/cryptography-primitives/_build

[ 18%] Building C object sources/ippcp/CMakeFiles/ippcp_s_l9.dir///c_sources/l9/c_intel64/l9_k_pke_encrypt.c.o
[ 18%] Building C object sources/ippcp/CMakeFiles/ippcp_s_l9.dir///c_sources/l9/c_intel64/l9_k_pke_keygen.c.o
[ 18%] Building C object sources/ippcp/CMakeFiles/ippcp_s_l9.dir///c_sources/l9/c_intel64/l9_kernels.c.o
In function ‘cp_bytesToBits’,
inlined from ‘cp_bytesToBits’ at /home/fst/cryptography-primitives/_build/c_sources/l9/c_intel64/l9_kernels.c:64:24,
inlined from ‘l9_cp_samplePolyCBD’ at /home/fst/cryptography-primitives/_build/c_sources/l9/c_intel64/l9_kernels.c:317:20:
/home/fst/cryptography-primitives/_build/c_sources/l9/c_intel64/l9_kernels.c:76:29: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=]
76 | pOut[8 * i + j] = (C >> j) & 1;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/home/fst/cryptography-primitives/_build/c_sources/l9/c_intel64/l9_kernels.c: In function ‘l9_cp_samplePolyCBD’:
/home/fst/cryptography-primitives/_build/c_sources/l9/c_intel64/l9_kernels.c:299:11: note: at offset 96 into destination object ‘seedBits’ of size 96
299 | Ipp8u seedBits[SEED_BITS_BUFFER_BYTESIZE];
| ^~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [sources/ippcp/CMakeFiles/ippcp_s_l9.dir/build.make:1364: sources/ippcp/CMakeFiles/ippcp_s_l9.dir///c_sources/l9/c_intel64/l9_kernels.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:214: sources/ippcp/CMakeFiles/ippcp_s_l9.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc

cmake version 3.28.3

fst@gklab-070-100:~/cryptography-primitives/_build$ git log
commit bfcdb6c (HEAD -> develop, origin/develop, origin/cryptography-primitives_2_3_0, origin/HEAD, cryptography-primitives_2_3_0)
Author: Ivan Martianov ivan.martyanov@intel.com
Date: Mon Jul 13 14:54:07 2026 +0000

[SB][Doc] Add changelog entry for ML-KEM update

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions