build: -Wno-stringop-overflow during LTO phase 86/34386/3
authorDamjan Marion <damarion@cisco.com>
Sat, 6 Nov 2021 16:09:37 +0000 (17:09 +0100)
committerBeno�t Ganne <bganne@cisco.com>
Mon, 8 Nov 2021 16:39:06 +0000 (16:39 +0000)
Type: make
Change-Id: I735fa411366c41981e255921eceb18ebbb4b5fe1
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/CMakeLists.txt
src/cmake/library.cmake

index 5327735..3966bc3 100644 (file)
@@ -125,6 +125,10 @@ if (CMAKE_BUILD_TYPE_UC STREQUAL "RELEASE")
   endif()
 endif()
 
+if(VPP_USE_LTO)
+  check_c_compiler_flag("-Wno-stringop-overflow"
+                       compiler_flag_no_stringop_overflow)
+endif()
 ##############################################################################
 # sanitizers
 ##############################################################################
index c80d7f2..fbb2c68 100644 (file)
@@ -51,6 +51,9 @@ macro(add_vpp_library lib)
      target_compile_options (${lib} PRIVATE "-ffunction-sections")
      target_compile_options (${lib} PRIVATE "-fdata-sections")
      target_link_libraries (${lib} "-Wl,--gc-sections")
+     if(compiler_flag_no_stringop_overflow)
+       target_link_libraries (${lib} "-Wno-stringop-overflow")
+     endif()
   endif()
 
   if(ARG_MULTIARCH_SOURCES)