[llvm] [BOLT] Ensure runtime is built with uncompressed debug symbols (PR #218126)

Joey Riches via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 22 05:25:25 PDT 2026


https://github.com/joebonrichie created https://github.com/llvm/llvm-project/pull/218126

Currently, if the runtime is built with compressed debug symbols it causes an out-of-bounds read and segfault when instrumenting a binary.

This is due to JITLink currently not supporting SHF_COMPRESSED symbols as it would need to decompress the symbols first to update the reloc symbols

As some distributions are starting to enable compressed debug sections in their toolchains by default, ensure the runtime is built without them until JITLink supports updating  SHF_COMPRESSED relocs.

>From 08199df3fa83d24c60b94507727a9cead41fcc26 Mon Sep 17 00:00:00 2001
From: Joey Riches <josephriches at gmail.com>
Date: Sat, 22 Aug 2026 12:10:32 +0100
Subject: [PATCH] [BOLT] Ensure runtime is built with uncompressed debug
 symbols

Currently, if the runtime is built with compressed debug symbols it
causes an out-of-bounds read and segfault when instrumenting a binary.

This is due to JITLink currently not supporting SHF_COMPRESSED symbols
as it would need to decompress the symbols first to update the
reloc symbols

As some distributions are starting to enable compressed debug sections
in their toolchains by default, ensure the runtime is built without them
until JITLink supports updating  SHF_COMPRESSED relocs.
---
 bolt/runtime/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bolt/runtime/CMakeLists.txt b/bolt/runtime/CMakeLists.txt
index 63f178bd263c2..9f7b6b1baffa0 100644
--- a/bolt/runtime/CMakeLists.txt
+++ b/bolt/runtime/CMakeLists.txt
@@ -40,6 +40,9 @@ set(BOLT_RT_FLAGS
   # Protect against distros adding -fno-omit-frame-pointer and compiling with GCC.
   # Refs: llvm/llvm-project#148595 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77882
   -fomit-frame-pointer
+  # JITLink currently does not support SHF_COMPRESSED sections with relocations, ensure
+  # debug sections are uncompressed to avoid out-of-bounds read and segfault.
+  -gz=none
 )
 if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
   set(BOLT_RT_FLAGS ${BOLT_RT_FLAGS} 



More information about the llvm-commits mailing list