Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crash on import after GCC 8 builds #6048

Merged
merged 6 commits into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,11 @@ if(BUILD_ONNX_PYTHON)
target_link_libraries(onnx_cpp2py_export
PRIVATE "-Wl,--whole-archive" $<TARGET_FILE:onnx>
"-Wl,--no-whole-archive")
# Prevent "undefined symbol: _ZNSt10filesystem7__cxx114path14_M_split_cmptsEv"
# (std::filesystem::__cxx11::path::_M_split_cmpts()) on gcc 8
if (CMAKE_CXX_STANDARD EQUAL 17 AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
target_link_libraries(onnx_cpp2py_export PRIVATE "-lstdc++fs")
endif()
set_target_properties(onnx_cpp2py_export
PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
endif()
Expand Down
Loading