diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5f72fea..1605958 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,9 +7,9 @@ repos: rev: v4.0.1 hooks: - id: trailing-whitespace - exclude: cmake/ippcrypto_patch.patch + exclude: cmake/patch/ippcrypto_patch.patch - id: end-of-file-fixer - exclude: cmake/ippcrypto_patch.patch + exclude: cmake/patch/ippcrypto_patch.patch - id: check-merge-conflict - id: mixed-line-ending - id: check-byte-order-marker diff --git a/CMakeLists.txt b/CMakeLists.txt index a1fb8da..52a1d95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,12 +43,21 @@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "/opt/intel/ipcl") endif() -set(CMAKE_C_FLAGS "-O2 -Wno-error=deprecated-declarations") -set(CMAKE_CXX_FLAGS "-O2 -fpermissive -Wno-error=deprecated-declarations -Wstringop-overflow=1") +set(CMAKE_C_FLAGS "-O2 -Wno-error=deprecated-declarations -Wno-error=deprecated-copy") +set(CMAKE_CXX_FLAGS "-O2 -fpermissive -Wno-error=deprecated-declarations -Wno-error=deprecated-copy") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/ipcl;${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/ipcl/ippcrypto") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}) +# Compiler version check - icx/icpx-2021.3.0 is supported +if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 2021.3.0) + message(FATAL_ERROR + " ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} is not supported." + " Please refer to Intel IPP-Crypto (https://github.com/intel/ipp-crypto" + " for more information.") + endif() +endif() #--------------------------------------------------- option(IPCL_TEST "Enable testing" ON) diff --git a/cmake/gtest.cmake b/cmake/gtest.cmake index b5d9dc5..cdfb1df 100644 --- a/cmake/gtest.cmake +++ b/cmake/gtest.cmake @@ -5,7 +5,7 @@ include(ExternalProject) set(GTEST_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ext_gtest) set(GTEST_GIT_REPO_URL https://github.com/google/googletest.git) -set(GTEST_GIT_LABEL release-1.10.0) +set(GTEST_GIT_LABEL release-1.12.1) set(GTEST_CXX_FLAGS "${IPCL_FORWARD_CMAKE_ARGS} -fPIC") ExternalProject_Add( @@ -21,12 +21,6 @@ ExternalProject_Add( INSTALL_COMMAND "" ) -# install( -# DIRECTORY ${GTEST_DESTDIR}/${CMAKE_INSTALL_PREFIX}/ -# DESTINATION "." -# USE_SOURCE_PERMISSIONS -# ) - ExternalProject_Get_Property(ext_gtest SOURCE_DIR BINARY_DIR) add_library(libgtest INTERFACE) diff --git a/cmake/ippcrypto.cmake b/cmake/ippcrypto.cmake index 28ed163..5c53183 100644 --- a/cmake/ippcrypto.cmake +++ b/cmake/ippcrypto.cmake @@ -35,7 +35,7 @@ ExternalProject_Add( -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_INSTALL_INCLUDEDIR=${IPPCRYPTO_DEST_INCLUDE_DIR} UPDATE_COMMAND "" - PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/ippcrypto_patch.patch + PATCH_COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/patch/ippcrypto_patch.patch INSTALL_COMMAND make DESTDIR=${IPPCRYPTO_DESTDIR} install ) diff --git a/cmake/ippcrypto_patch.patch b/cmake/ippcrypto_patch.patch deleted file mode 100644 index ebc60cc..0000000 --- a/cmake/ippcrypto_patch.patch +++ /dev/null @@ -1,242 +0,0 @@ -# Copyright (C) 2022 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ddb61db..302ca95 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -54,6 +54,7 @@ endif() - project(${PROJECT_NAME} - VERSION ${PROJECT_VERSION} - LANGUAGES C CXX) -+include(GNUInstallDirs) - - if("${CMAKE_BUILD_TYPE}" STREQUAL "") - message(STATUS "CMAKE_BUILD_TYPE is unset, defaulting to Release") -diff --git a/sources/cmake/linux/Clang9.0.0.cmake b/sources/cmake/linux/Clang9.0.0.cmake -index b99d637..4a0c5bc 100644 ---- a/sources/cmake/linux/Clang9.0.0.cmake -+++ b/sources/cmake/linux/Clang9.0.0.cmake -@@ -100,7 +100,7 @@ if(${ARCH} MATCHES "ia32") - endif(${ARCH} MATCHES "ia32") - - # Optimization level = 3, no-debug definition (turns off asserts), warnings=errors --set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Werror") -+set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Wno-stringop-overflow -Werror") - - set(w7_opt "${w7_opt} -march=pentium4 -msse2") - set(s8_opt "${s8_opt} -march=core2 -mssse3") -diff --git a/sources/cmake/linux/GNU8.2.0.cmake b/sources/cmake/linux/GNU8.2.0.cmake -index 9c848d5..30ad189 100644 ---- a/sources/cmake/linux/GNU8.2.0.cmake -+++ b/sources/cmake/linux/GNU8.2.0.cmake -@@ -96,7 +96,7 @@ if(${ARCH} MATCHES "ia32") - endif(${ARCH} MATCHES "ia32") - - # Optimization level = 3, no-debug definition (turns off asserts), warnings=errors --set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Werror") -+set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Wno-stringop-overflow -Werror") - - set(w7_opt "${w7_opt} -march=pentium4 -msse2") - set(s8_opt "${s8_opt} -march=core2 -mssse3") -diff --git a/sources/cmake/linux/Intel19.0.0.cmake b/sources/cmake/linux/Intel19.0.0.cmake -index ce0ee06..bbe4acc 100644 ---- a/sources/cmake/linux/Intel19.0.0.cmake -+++ b/sources/cmake/linux/Intel19.0.0.cmake -@@ -99,7 +99,7 @@ if(CODE_COVERAGE) - endif() - - # Optimization level = 3, no-debug definition (turns off asserts), warning level = 3, treat warnings as errors --set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -w3 -Werror") -+set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -w3 -Wno-stringop-overflow -Werror") - # DEBUG flags Optimization level = 0, generation maximum GDB information (-g3) - set (CMAKE_C_FLAGS_DEBUG " -O0 -g3") - -diff --git a/sources/cmake/linux/IntelLLVM2021.3.0.cmake b/sources/cmake/linux/IntelLLVM2021.3.0.cmake -index 73ab46a..bedc0a7 100644 ---- a/sources/cmake/linux/IntelLLVM2021.3.0.cmake -+++ b/sources/cmake/linux/IntelLLVM2021.3.0.cmake -@@ -95,7 +95,7 @@ if(CODE_COVERAGE) - endif() - - # Optimization level = 3, no-debug definition (turns off asserts), warning level = 3, treat warnings as errors --set (CMAKE_C_FLAGS_RELEASE " -Ofast -DNDEBUG -Wall -Wno-unused-function -Wno-missing-braces -Werror") -+set (CMAKE_C_FLAGS_RELEASE " -Ofast -DNDEBUG -Wall -Wno-unused-function -Wno-missing-braces -Wno-stringop-overflow -Werror") - - # Alignment for structures on byte boundaries (= 16) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Zp16") -diff --git a/sources/cmake/macosx/AppleClang11.0.0.cmake b/sources/cmake/macosx/AppleClang11.0.0.cmake -index 0ca0d30..604ebf3 100644 ---- a/sources/cmake/macosx/AppleClang11.0.0.cmake -+++ b/sources/cmake/macosx/AppleClang11.0.0.cmake -@@ -99,7 +99,7 @@ if(${ARCH} MATCHES "ia32") - endif(${ARCH} MATCHES "ia32") - - # Optimization level = 3, no-debug definition (turns off asserts), warnings=errors --set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Werror") -+set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Wno-stringop-overflow -Werror") - - set(w7_opt "${w7_opt} -march=pentium4 -msse2") - set(s8_opt "${s8_opt} -march=core2 -mssse3") -diff --git a/sources/cmake/macosx/Intel19.0.0.cmake b/sources/cmake/macosx/Intel19.0.0.cmake -index 1250802..ffdf8db 100644 ---- a/sources/cmake/macosx/Intel19.0.0.cmake -+++ b/sources/cmake/macosx/Intel19.0.0.cmake -@@ -86,7 +86,7 @@ if(CODE_COVERAGE) - endif() - - # Optimization level = 3, no-debug definition (turns off asserts), warning level = 3, treat warnings as errors --set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -w3 -Werror") -+set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -w3 -Wno-stringop-overflow -Werror") - - # Compile for x64 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch_only x86_64") -diff --git a/sources/ippcp/CMakeLists.txt b/sources/ippcp/CMakeLists.txt -index dd5ef41..b60357e 100644 ---- a/sources/ippcp/CMakeLists.txt -+++ b/sources/ippcp/CMakeLists.txt -@@ -378,7 +378,7 @@ foreach(opt ${PLATFORM_LIST}) - install(TARGETS ${IPPCP_DYN_ITER} - LIBRARY DESTINATION "lib/${ARCH}/$<$:nonpic>" - RUNTIME DESTINATION "lib/${ARCH}/$<$:nonpic>" -- PUBLIC_HEADER DESTINATION "include") -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - list(APPEND IPPCP_LIB_DYNAMIC ${IPPCP_DYN_ITER}) - endif(DYNAMIC_LIB AND NOT MERGED_BLD) - -@@ -407,7 +407,7 @@ foreach(opt ${PLATFORM_LIST}) - set_target_properties(${IPPCP_ST_ITER} PROPERTIES PUBLIC_HEADER "${IPPCP_PUBLIC_HEADERS}") - install(TARGETS ${IPPCP_ST_ITER} - ARCHIVE DESTINATION "lib/${ARCH}/$<$:nonpic>" -- PUBLIC_HEADER DESTINATION "include") -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - endif() - - list(APPEND IPPCP_LIB_STATIC ${IPPCP_ST_ITER}) -@@ -482,7 +482,7 @@ if(MERGED_BLD) - - install(TARGETS ${IPPCP_LIB_MERGED} - ARCHIVE DESTINATION "lib/${ARCH}/$<$:nonpic>" -- PUBLIC_HEADER DESTINATION "include" -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PRIVATE_HEADER DESTINATION "tools/${ARCH}/staticlib") - - set_source_files_properties(${DISPATCHER_C_SOURCES} pcpver.rc PROPERTIES INCLUDE_DIRECTORIES "${C_INCLUDE_DIRECTORIES}") -@@ -521,7 +521,7 @@ if(MERGED_BLD) - install(TARGETS ${IPPCP_LIB_PCS} - LIBRARY DESTINATION "lib/${ARCH}/$<$:nonpic>" - RUNTIME DESTINATION "lib/${ARCH}/$<$:nonpic>" -- PUBLIC_HEADER DESTINATION "include" -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PRIVATE_HEADER DESTINATION "tools/${ARCH}/staticlib") - - if(WIN32) -diff --git a/sources/ippcp/crypto_mb/src/CMakeLists.txt b/sources/ippcp/crypto_mb/src/CMakeLists.txt -index f75f448..2f43255 100644 ---- a/sources/ippcp/crypto_mb/src/CMakeLists.txt -+++ b/sources/ippcp/crypto_mb/src/CMakeLists.txt -@@ -117,12 +117,12 @@ if (MB_STANDALONE) # standalone crypto_mb's cmake run - install(TARGETS ${MB_DYN_LIB_TARGET} - LIBRARY DESTINATION "lib" - RUNTIME DESTINATION "lib" -- PUBLIC_HEADER DESTINATION "include/crypto_mb") -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) - elseif (DYNAMIC_LIB) # build from ippcp's cmake - install(TARGETS ${MB_DYN_LIB_TARGET} - LIBRARY DESTINATION "lib/intel64" - RUNTIME DESTINATION "lib/intel64" -- PUBLIC_HEADER DESTINATION "include/crypto_mb") -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) - endif() - - # Static library -@@ -147,9 +147,9 @@ endif() - if(MB_STANDALONE) - install(TARGETS ${MB_STATIC_LIB_TARGET} - ARCHIVE DESTINATION "lib" -- PUBLIC_HEADER DESTINATION "include/crypto_mb") -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) - else() - install(TARGETS ${MB_STATIC_LIB_TARGET} - ARCHIVE DESTINATION "lib/intel64" -- PUBLIC_HEADER DESTINATION "include/crypto_mb") -+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) - endif() -diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/Clang.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/Clang.cmake -index 17bc125..77b14ee 100644 ---- a/sources/ippcp/crypto_mb/src/cmake/linux/Clang.cmake -+++ b/sources/ippcp/crypto_mb/src/cmake/linux/Clang.cmake -@@ -44,7 +44,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fpic -fPIC") - # Enables important warning and error messages relevant to security during compilation - set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") - # Warnings=errors --set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") -+set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") - - # Linker flags - -diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake -index b95f703..1be6ca7 100644 ---- a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake -+++ b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake -@@ -46,7 +46,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fcf-protection=full") - # Enables important warning and error messages relevant to security during compilation - set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") - # Warnings=errors --set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") -+set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") - - # Linker flags - -diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake -index 39862aa..35d49c1 100644 ---- a/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake -+++ b/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake -@@ -40,7 +40,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fcf-protection=full") - # Enables important warning and error messages relevant to security during compilation - set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") - # Warnings=errors --set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") -+set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") - - # Linker flags - -diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/IntelLLVM.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/IntelLLVM.cmake -index 285c64a..b0f48bf 100644 ---- a/sources/ippcp/crypto_mb/src/cmake/linux/IntelLLVM.cmake -+++ b/sources/ippcp/crypto_mb/src/cmake/linux/IntelLLVM.cmake -@@ -40,7 +40,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fcf-protection=full") - # Enables important warning and error messages relevant to security during compilation - set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") - # Warnings=errors --set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") -+set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") - - # Linker flags - -diff --git a/sources/ippcp/crypto_mb/src/cmake/macosx/AppleClang.cmake b/sources/ippcp/crypto_mb/src/cmake/macosx/AppleClang.cmake -index 5f6ff8c..fefd3a2 100644 ---- a/sources/ippcp/crypto_mb/src/cmake/macosx/AppleClang.cmake -+++ b/sources/ippcp/crypto_mb/src/cmake/macosx/AppleClang.cmake -@@ -40,7 +40,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fpic -fPIC") - # Enables important warning and error messages relevant to security during compilation - set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") - # Warnings=errors --set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") -+set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") - - # Linker flags - -diff --git a/sources/ippcp/crypto_mb/src/cmake/macosx/Intel.cmake b/sources/ippcp/crypto_mb/src/cmake/macosx/Intel.cmake -index 1abac6e..40919a6 100644 ---- a/sources/ippcp/crypto_mb/src/cmake/macosx/Intel.cmake -+++ b/sources/ippcp/crypto_mb/src/cmake/macosx/Intel.cmake -@@ -33,7 +33,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fpic -fPIC") - # Enables important warning and error messages relevant to security during compilation - set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") - # Warnings=errors --set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") -+set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") - - # Linker flags - diff --git a/cmake/patch/ippcrypto_patch.patch b/cmake/patch/ippcrypto_patch.patch new file mode 100644 index 0000000..6dfff68 --- /dev/null +++ b/cmake/patch/ippcrypto_patch.patch @@ -0,0 +1,125 @@ +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ddb61db..302ca95 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,6 +54,7 @@ endif() + project(${PROJECT_NAME} + VERSION ${PROJECT_VERSION} + LANGUAGES C CXX) ++include(GNUInstallDirs) + + if("${CMAKE_BUILD_TYPE}" STREQUAL "") + message(STATUS "CMAKE_BUILD_TYPE is unset, defaulting to Release") +diff --git a/sources/cmake/linux/GNU8.2.0.cmake b/sources/cmake/linux/GNU8.2.0.cmake +index 9c848d5..30ad189 100644 +--- a/sources/cmake/linux/GNU8.2.0.cmake ++++ b/sources/cmake/linux/GNU8.2.0.cmake +@@ -96,7 +96,7 @@ if(${ARCH} MATCHES "ia32") + endif(${ARCH} MATCHES "ia32") + + # Optimization level = 3, no-debug definition (turns off asserts), warnings=errors +-set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Werror") ++set (CMAKE_C_FLAGS_RELEASE " -O3 -DNDEBUG -Wno-stringop-overflow -Werror") + + set(w7_opt "${w7_opt} -march=pentium4 -msse2") + set(s8_opt "${s8_opt} -march=core2 -mssse3") +diff --git a/sources/ippcp/CMakeLists.txt b/sources/ippcp/CMakeLists.txt +index dd5ef41..b60357e 100644 +--- a/sources/ippcp/CMakeLists.txt ++++ b/sources/ippcp/CMakeLists.txt +@@ -378,7 +378,7 @@ foreach(opt ${PLATFORM_LIST}) + install(TARGETS ${IPPCP_DYN_ITER} + LIBRARY DESTINATION "lib/${ARCH}/$<$:nonpic>" + RUNTIME DESTINATION "lib/${ARCH}/$<$:nonpic>" +- PUBLIC_HEADER DESTINATION "include") ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + list(APPEND IPPCP_LIB_DYNAMIC ${IPPCP_DYN_ITER}) + endif(DYNAMIC_LIB AND NOT MERGED_BLD) + +@@ -407,7 +407,7 @@ foreach(opt ${PLATFORM_LIST}) + set_target_properties(${IPPCP_ST_ITER} PROPERTIES PUBLIC_HEADER "${IPPCP_PUBLIC_HEADERS}") + install(TARGETS ${IPPCP_ST_ITER} + ARCHIVE DESTINATION "lib/${ARCH}/$<$:nonpic>" +- PUBLIC_HEADER DESTINATION "include") ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + endif() + + list(APPEND IPPCP_LIB_STATIC ${IPPCP_ST_ITER}) +@@ -482,7 +482,7 @@ if(MERGED_BLD) + + install(TARGETS ${IPPCP_LIB_MERGED} + ARCHIVE DESTINATION "lib/${ARCH}/$<$:nonpic>" +- PUBLIC_HEADER DESTINATION "include" ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PRIVATE_HEADER DESTINATION "tools/${ARCH}/staticlib") + + set_source_files_properties(${DISPATCHER_C_SOURCES} pcpver.rc PROPERTIES INCLUDE_DIRECTORIES "${C_INCLUDE_DIRECTORIES}") +@@ -521,7 +521,7 @@ if(MERGED_BLD) + install(TARGETS ${IPPCP_LIB_PCS} + LIBRARY DESTINATION "lib/${ARCH}/$<$:nonpic>" + RUNTIME DESTINATION "lib/${ARCH}/$<$:nonpic>" +- PUBLIC_HEADER DESTINATION "include" ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PRIVATE_HEADER DESTINATION "tools/${ARCH}/staticlib") + + if(WIN32) +diff --git a/sources/ippcp/crypto_mb/src/CMakeLists.txt b/sources/ippcp/crypto_mb/src/CMakeLists.txt +index f75f448..2f43255 100644 +--- a/sources/ippcp/crypto_mb/src/CMakeLists.txt ++++ b/sources/ippcp/crypto_mb/src/CMakeLists.txt +@@ -117,12 +117,12 @@ if (MB_STANDALONE) # standalone crypto_mb's cmake run + install(TARGETS ${MB_DYN_LIB_TARGET} + LIBRARY DESTINATION "lib" + RUNTIME DESTINATION "lib" +- PUBLIC_HEADER DESTINATION "include/crypto_mb") ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) + elseif (DYNAMIC_LIB) # build from ippcp's cmake + install(TARGETS ${MB_DYN_LIB_TARGET} + LIBRARY DESTINATION "lib/intel64" + RUNTIME DESTINATION "lib/intel64" +- PUBLIC_HEADER DESTINATION "include/crypto_mb") ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) + endif() + + # Static library +@@ -147,9 +147,9 @@ endif() + if(MB_STANDALONE) + install(TARGETS ${MB_STATIC_LIB_TARGET} + ARCHIVE DESTINATION "lib" +- PUBLIC_HEADER DESTINATION "include/crypto_mb") ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) + else() + install(TARGETS ${MB_STATIC_LIB_TARGET} + ARCHIVE DESTINATION "lib/intel64" +- PUBLIC_HEADER DESTINATION "include/crypto_mb") ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/crypto_mb) + endif() +diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake +index b95f703..1be6ca7 100644 +--- a/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake ++++ b/sources/ippcp/crypto_mb/src/cmake/linux/GNU.cmake +@@ -46,7 +46,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fcf-protection=full") + # Enables important warning and error messages relevant to security during compilation + set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") + # Warnings=errors +-set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") ++set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") + + # Linker flags + +diff --git a/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake b/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake +index 39862aa..35d49c1 100644 +--- a/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake ++++ b/sources/ippcp/crypto_mb/src/cmake/linux/Intel.cmake +@@ -40,7 +40,7 @@ set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -fcf-protection=full") + # Enables important warning and error messages relevant to security during compilation + set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wall") + # Warnings=errors +-set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Werror") ++set(CMAKE_C_FLAGS_SECURITY "${CMAKE_C_FLAGS_SECURITY} -Wno-stringop-overflow -Werror") + + # Linker flags + diff --git a/ipcl/keygen.cpp b/ipcl/keygen.cpp index f2d712e..41301d0 100644 --- a/ipcl/keygen.cpp +++ b/ipcl/keygen.cpp @@ -17,7 +17,7 @@ BigNumber getPrimeBN(int max_bits) { ippsPrimeInit(max_bits, reinterpret_cast(prime_ctx.data())); #if defined(IPCL_RNG_INSTR_RDSEED) || defined(IPCL_RNG_INSTR_RDRAND) - bool rand_param = NULL; + Ipp8u* rand_param = NULL; #else auto buff = std::vector(prime_size); auto rand_param = buff.data(); diff --git a/module/heqat.cmake b/module/heqat.cmake index d4a68cb..2960ee4 100644 --- a/module/heqat.cmake +++ b/module/heqat.cmake @@ -17,13 +17,12 @@ ExternalProject_Add( ext_he_qat SOURCE_DIR ${HEQAT_SRC_DIR} PREFIX ${HEQAT_PREFIX} - # INSTALL_DIR ${HEQAT_DESTDIR} CMAKE_ARGS ${HEQAT_CXX_FLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DHE_QAT_MISC=OFF -DHE_QAT_DOCS=${IPCL_DOCS} -DHE_QAT_SHARED=${IPCL_SHARED} - -DHE_QAT_TEST=OFF + -DHE_QAT_TEST=OFF -DCMAKE_BUILD_TYPE=${HEQAT_BUILD_TYPE} UPDATE_COMMAND "" EXCLUDE_FROM_ALL TRUE