From 371c535de1dc77f46cb18ed12ccac20a2c2e0684 Mon Sep 17 00:00:00 2001 From: rahjain-amd Date: Mon, 4 Aug 2025 23:58:09 +0530 Subject: [PATCH] Fix Debug Build for ckProfiler (#2609) Problem ======= relocation R_X86_64_32 out of range: 5405348154 is not in [0, 4294967295] Solution ======== The problem was caused due the limitation comes from the 32 bit offsets used in original DWARF standard. We have the option to switch to 64bit offset for your libs which free us from 4G size boundary. add -gdwarf64 and -Og to avoid this limit. [ROCm/composable_kernel commit: 59245df46d1090bfb1cd438d867c15a300989d63] --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f49376d139..19c036e1a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,12 @@ add_compile_options(-Wno-pass-failed) add_compile_options(-Wno-switch-default) add_compile_options(-Wno-unique-object-duplication) +# add -Og -gdwarf64 for debug builds +add_compile_options( + "$<$:-Og>" + "$<$:-gdwarf64>" +) + # Recent change in compiler makes this warning ON by default, which led to compile errors. add_compile_options(-Wno-nrvo)