mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-02 03:55:34 +00:00
Fix Flatbuffer build issue. (#19296)
### Description Building on g++ 13.2.0 results in -Wstringop-overread errors on Linux. This commit addresses the flatbuffer build issue with the following changes: 1. Remove the Werror flag in the flarbuffer patch. 2. Add a compilation option to suppress the 'stringop-overflow' error in the Flatbuffers within the xnnpack provider. ### Motivation and Context https://github.com/google/flatbuffers/issues/8119 https://github.com/microsoft/onnxruntime/pull/19239 Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
This commit is contained in:
parent
d87f73ab44
commit
2b361c04d6
3 changed files with 8 additions and 1 deletions
|
|
@ -641,6 +641,7 @@ else()
|
|||
check_cxx_compiler_flag(-Wunused-but-set-variable HAS_UNUSED_BUT_SET_VARIABLE)
|
||||
check_cxx_compiler_flag(-Wunused-variable HAS_UNUSED_VARIABLE)
|
||||
check_cxx_compiler_flag(-Wuseless-cast HAS_USELESS_CAST)
|
||||
check_cxx_compiler_flag(-Wstringop-overflow HAS_STRINGOP_OVERFLOW)
|
||||
check_function_exists(reallocarray HAS_REALLOCARRAY)
|
||||
if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND onnxruntime_target_platform STREQUAL "aarch64")
|
||||
check_cxx_compiler_flag(-march=armv8.2-a+bf16 HAS_ARM64_BFLOAT16)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@
|
|||
flatbuffers::flatbuffers Boost::mp11 safeint_interface
|
||||
)
|
||||
|
||||
# TODO fix stringop-overflow warnings
|
||||
# Add compile option to suppress stringop-overflow error in Flatbuffers.
|
||||
if (HAS_STRINGOP_OVERFLOW)
|
||||
target_compile_options(onnxruntime_providers_xnnpack PRIVATE -Wno-error=stringop-overflow)
|
||||
endif()
|
||||
|
||||
add_dependencies(onnxruntime_providers_xnnpack onnx ${onnxruntime_EXTERNAL_DEPENDENCIES})
|
||||
set_target_properties(onnxruntime_providers_xnnpack PROPERTIES FOLDER "ONNXRuntime")
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ index 3987eac9..5e5462f1 100644
|
|||
endif(CYGWIN)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
- "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow")
|
||||
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow -Wno-error=stringop-overflow")
|
||||
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Werror=shadow -Wno-error=stringop-overflow")
|
||||
set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue