intel / intel/cryptography-primitives

Building with GCC 13 results in error

Open
#105 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
387
Forks
108
PR merge metrics
No merged PRs in 30d

Description

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 bfcdb6c273be2e90430d3b7c971a93971ab11baa (HEAD -> develop, origin/develop, origin/cryptography-primitives_2_3_0, origin/HEAD, cryptography-primitives_2_3_0)
Author: Ivan Martianov
Date: Mon Jul 13 14:54:07 2026 +0000

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

Contributor guide

Open the contributing guide

Research direction

Start with c_sources/l9/c_intel64/l9_kernels.c, especially cp_bytesToBits and l9_cp_samplePolyCBD, and compare the develop or cryptography-primitives_2_3_0 code with cryptography-primitives_2_2_0. Reproduce the failure using the reported CMake command and GCC 13. Done means the project builds successfully with GCC 13 without the stringop-overflow warning being treated as an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.