[Lldb-commits] [lldb] [lldb] Build debugserver fat for arm64 and arm64e (PR #186038)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 11 21:56:23 PDT 2026


https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/186038

Change the default of `LLDB_ENABLE_ARM64E_DEBUGSERVER` so we build debugserver fat for arm64 and arm64e when running on ptrauth-capable hardware. On older versions on macOS (before macOS 26 Tahoe) you need to set the `arm64e_preview_abi` boot arg to run the arm64e slice. However, building for it should be harmless.

>From 57961546204fce3ea9187a6a8fb3901d7b9bbb44 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Wed, 11 Mar 2026 21:53:17 -0700
Subject: [PATCH] [lldb] Build debugserver fat for arm64 and arm64e

Build debugserver fat for arm64 and arm64e when running on
ptrauth-capable hardware. On older versions on macOS (before macOS 26
Tahoe) you need to set the `arm64e_preview_abi` boot arg to run the
arm64e slice. However, building for it should be harmless.
---
 lldb/tools/debugserver/source/CMakeLists.txt | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt
index a81fe5505cc35..8ae38ccf7cc0f 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -101,9 +101,27 @@ check_c_source_compiles(
     BUILDING_FOR_ARM64_OSX
 )
 
+set(default_arm64e_debugserver OFF)
+if (BUILDING_FOR_ARM64_OSX )
+  execute_process(
+      COMMAND sysctl -n hw.optional.ptrauth
+      OUTPUT_VARIABLE SYSCTL_OUTPUT
+      ERROR_QUIET
+      RESULT_VARIABLE SYSCTL_RESULT
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+  if(SYSCTL_RESULT EQUAL 0)
+    set(default_arm64e_debugserver ON)
+  endif()
+endif()
+option(LLDB_ENABLE_ARM64E_DEBUGSERVER "Build debugserver for arm64 and arm64e" ${default_arm64e_debugserver})
+
 # You can only debug arm64e processes using an arm64e debugserver.
-option(LLDB_ENABLE_ARM64E_DEBUGSERVER "Build debugserver for arm64 and arm64e" OFF)
+# While on older versions of macOS, you may not be able to run arm64e binaries
+# without arm64e_preview_abi, building it should be harmless which is why we
+# default to ON on capable hardware.
 if (BUILDING_FOR_ARM64_OSX AND LLDB_ENABLE_ARM64E_DEBUGSERVER)
+  message(STATUS "Building debugserver for arm64 and arm64e")
   set(CMAKE_OSX_ARCHITECTURES "arm64;arm64e")
 endif ()
 



More information about the lldb-commits mailing list