From 9bd1392ccef6420e9466d442876f26efda1f360a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=85=86=E4=B8=B0?= Date: Thu, 11 Sep 2025 08:56:47 +0800 Subject: [PATCH] update lto linker option --- src/torch_atb/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/torch_atb/CMakeLists.txt b/src/torch_atb/CMakeLists.txt index f75429df..d6379a55 100644 --- a/src/torch_atb/CMakeLists.txt +++ b/src/torch_atb/CMakeLists.txt @@ -11,7 +11,8 @@ file(GLOB_RECURSE pybind11_source_files "*.cpp") pybind11_add_module(_C ${pybind11_source_files}) set_target_properties(_C PROPERTIES OUTPUT_NAME "_C" SUFFIX ".so") -target_link_options(_C PRIVATE -Wno-odr -rdynamic -ldl -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--build-id=none -fexceptions) +target_link_options(_C PRIVATE -rdynamic -ldl -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,--build-id=none -fexceptions) +target_compile_options(_C PRIVATE -Wno-lto-type-mismatch) target_link_libraries(_C PRIVATE torch_npu) target_include_directories(_C PRIVATE ${ATB_INCLUDE_DIR}) install(TARGETS _C DESTINATION ${CMAKE_SOURCE_DIR}/output/torch_atb) \ No newline at end of file -- Gitee