Add -gsplit-dwarf flag to reduce debug section size and fix ckProfiler link errors (#2611)

Resolves R_X86_64_32 relocation out of range errors in grouped conv2d instances
by splitting debug information into separate .dwo files.

Add explicit cast to avoid signed/unsigned comparison warning.
This commit is contained in:
Jinchao Xu
2025-08-05 02:26:08 +08:00
committed by GitHub
parent 8655ba989c
commit 15eb493152
3 changed files with 11 additions and 6 deletions

View File

@@ -175,6 +175,10 @@ function(add_instance_library INSTANCE_NAME)
target_compile_features(${INSTANCE_NAME} PUBLIC)
# splits debug information into separate .dwo files to reduce debug section size
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
target_compile_options(${INSTANCE_NAME} PRIVATE -gsplit-dwarf)
endif()
# flags to compress the library
if(NOT DISABLE_OFFLOAD_COMPRESS AND NOT WIN32 AND ${hip_VERSION_FLAT} GREATER 600241132)
message(DEBUG "Adding --offload-compress flag for ${INSTANCE_NAME}")