File tree Expand file tree Collapse file tree 7 files changed +11
-75
lines changed
Expand file tree Collapse file tree 7 files changed +11
-75
lines changed Original file line number Diff line number Diff line change @@ -227,18 +227,17 @@ foreach(flag ${FLEX_BISON_WARN_SUPPRESS_FLAGS_TO_CHECK})
227227 endif ()
228228endforeach ()
229229
230- #Suppress IPO link warnings
231- set (IPO_LINK_WARN_SUPRESS_FLAGS " " )
232- set (IPO_LINK_WARN_SUPRESS_FLAGS_TO_CHECK
233- "-Wno-null-dereference"
234- )
235- foreach (flag ${IPO_LINK_WARN_SUPRESS_FLAGS_TO_CHECK} )
236- CHECK_CXX_COMPILER_FLAG(${flag} CXX_COMPILER_SUPPORTS_${flag} )
237- if (CXX_COMPILER_SUPPORTS_${flag} )
238- #Flag supported, so enable it
239- set (IPO_LINK_WARN_SUPRESS_FLAGS "${IPO_LINK_WARN_SUPRESS_FLAGS} ${flag} " )
240- endif ()
241- endforeach ()
230+ # Suppress IPO link warnings.
231+ # When IPO is turned on, it sometimes leads to false positives for warnings
232+ # since it checks for warnings after some of the source files have been compiled.
233+ # We globally suppress these warnings here. Any CMake executable which is added
234+ # after this line.
235+ if (CMAKE_INTERPROCEDURAL_OPTIMIZATION)
236+ message (STATUS "IPO: Suppressing known VTR warnings." )
237+ add_link_options (-Wno-alloc-size-larger-than # libarchfpga allocates C-style arrays using integers.
238+ -Wno-stringop-overflow # EXTERNAL/capnproto has some string overflow warnings.
239+ )
240+ endif ()
242241
243242#
244243# Sanitizer flags
Original file line number Diff line number Diff line change @@ -56,13 +56,6 @@ else()
5656 ${CMAKE_DL_LIBS}
5757 )
5858
59- #Supress IPO link warnings if IPO is enabled
60- get_target_property (TEST_BLIFEXPLORER_USES_IPO blifexplorer INTERPROCEDURAL_OPTIMIZATION )
61- if (TEST_BLIFEXPLORER_USES_IPO)
62- set_property (TARGET blifexplorer APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
63- endif ()
64-
65-
6659 install (TARGETS blifexplorer DESTINATION bin)
6760
6861endif ()
Original file line number Diff line number Diff line change @@ -53,28 +53,10 @@ endif()
5353
5454target_compile_definitions (libarchfpga PUBLIC ${INTERCHANGE_SCHEMA_HEADERS} )
5555
56- # Supress IPO link warnings if IPO is enabled
57- get_target_property (LIBARCHFPGA_USES_IPO libarchfpga INTERPROCEDURAL_OPTIMIZATION )
58- if (LIBARCHFPGA_USES_IPO)
59- # LibArchFPGA uses ints in many of its data structures instead of size_t for
60- # the size of arrays which are used to allocate arrays. At link-time, this
61- # causes many false allocation warnings when IPO is enabled.
62- # In order to suppress these warnings, we must make this PUBLIC so that not
63- # only we suppress the warning for libarchfpga, but also anything else that
64- # links with it.
65- target_link_options (libarchfpga PUBLIC -Wno-alloc-size-larger-than)
66- endif ()
67-
6856#Create the test executable
6957add_executable (read_arch ${READ_ARCH_EXEC_SRC} )
7058target_link_libraries (read_arch libarchfpga)
7159
72- #Supress IPO link warnings if IPO is enabled
73- get_target_property (READ_ARCH_USES_IPO read_arch INTERPROCEDURAL_OPTIMIZATION )
74- if (READ_ARCH_USES_IPO)
75- set_property (TARGET read_arch APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
76- endif ()
77-
7860install (TARGETS libarchfpga DESTINATION bin)
7961install (FILES ${LIB_HEADERS} DESTINATION include /libarchfpga)
8062
Original file line number Diff line number Diff line change @@ -184,11 +184,5 @@ foreach(ODIN_LINK_FLAG ${ODIN_EXTRA_LINK_FLAGS})
184184 target_link_libraries (odin_ii ${ODIN_LINK_FLAG} )
185185endforeach ()
186186
187- #Supress IPO link warnings if IPO is enabled
188- get_target_property (ODIN_USES_IPO odin_ii INTERPROCEDURAL_OPTIMIZATION )
189- if (ODIN_USES_IPO)
190- set_property (TARGET odin_ii APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
191- endif ()
192-
193187install (TARGETS odin_ii libodin_ii DESTINATION bin)
194188install (FILES ${LIB_HEADERS} DESTINATION include /libodin_ii)
Original file line number Diff line number Diff line change @@ -27,12 +27,6 @@ target_link_libraries(fasm
2727add_executable (genfasm src/main.cpp)
2828target_link_libraries (genfasm fasm)
2929
30- #Supress IPO link warnings if IPO is enabled
31- get_target_property (GENFASM_USES_IPO genfasm INTERPROCEDURAL_OPTIMIZATION )
32- if (GENFASM_USES_IPO)
33- set_property (TARGET genfasm APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
34- endif ()
35-
3630#Specify link-time dependencies
3731install (TARGETS genfasm DESTINATION bin)
3832
@@ -49,12 +43,6 @@ set(TEST_SOURCES
4943add_executable (test_fasm ${TEST_SOURCES} )
5044target_link_libraries (test_fasm fasm Catch2::Catch2WithMain)
5145
52- #Suppress IPO link warnings if IPO is enabled
53- get_target_property (TEST_FASM_USES_IPO test_fasm INTERPROCEDURAL_OPTIMIZATION )
54- if (TEST_FASM_USES_IPO)
55- set_property (TARGET test_fasm APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
56- endif ()
57-
5846add_test (
5947 NAME test_fasm
6048 COMMAND test_fasm --colour-mode ansi
Original file line number Diff line number Diff line change @@ -8,9 +8,3 @@ target_link_libraries(route_diag
88 libvpr
99 )
1010
11- #Suppress IPO link warnings if IPO is enabled
12- get_target_property (TEST_ROUTE_DIAG_USES_IPO route_diag INTERPROCEDURAL_OPTIMIZATION )
13- if (TEST_ROUTE_DIAG_USES_IPO)
14- set_property (TARGET route_diag APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
15- endif ()
16-
Original file line number Diff line number Diff line change @@ -175,14 +175,6 @@ add_executable(vpr ${EXEC_SOURCES})
175175target_link_libraries (vpr libvpr)
176176
177177
178- #Suppress IPO link warnings if IPO is enabled
179- get_target_property (VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION )
180- if (VPR_USES_IPO)
181- set_property (TARGET vpr APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
182- endif ()
183-
184-
185-
186178#
187179# Profile Guilded Optimization Configuration
188180#
@@ -303,12 +295,6 @@ target_link_libraries(test_vpr
303295 Catch2::Catch2WithMain
304296 libvpr)
305297
306- #Suppress IPO link warnings if IPO is enabled
307- get_target_property (TEST_VPR_USES_IPO vpr INTERPROCEDURAL_OPTIMIZATION )
308- if (TEST_VPR_USES_IPO)
309- set_property (TARGET test_vpr APPEND PROPERTY LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS} )
310- endif ()
311-
312298add_test (NAME test_vpr
313299 COMMAND test_vpr --colour-mode ansi
314300 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /test
You can’t perform that action at this time.
0 commit comments