[compiler-rt] [compiler-rt] Add CMake flag for AArch64 Linux with 39-bit VA. (PR #167028)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 7 14:20:38 PST 2025


https://github.com/efriedma-quic created https://github.com/llvm/llvm-project/pull/167028

Sanitizers currently assume AArch64 Linux has 48-bit VA.  Followup patches will add checks for this flag to asan and hwasan.

>From 3ceb837eaa102894dcafe107a0306a0346d14524 Mon Sep 17 00:00:00 2001
From: Eli Friedman <efriedma at qti.qualcomm.com>
Date: Fri, 7 Nov 2025 14:09:42 -0800
Subject: [PATCH] [compiler-rt] Add CMake flag for AArch64 Linux with 39-bit
 VA.

Sanitizers currently assume AArch64 Linux has 48-bit VA.  Followup
patches will add checks for this flag to asan and hwasan.
---
 compiler-rt/CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index a9e8899f8ae0c..1f0f21afbbd6d 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -290,6 +290,9 @@ option(SANITIZER_USE_STATIC_TEST_CXX
   "Use static libc++ for tests." ${DEFAULT_SANITIZER_USE_STATIC_TEST_CXX})
 pythonize_bool(SANITIZER_USE_STATIC_TEST_CXX)
 
+option(SANITIZER_AARCH64_39BIT_VA
+  "Configure sanitizer allocator for 39-bit VA kernel." OFF)
+
 set(COMPILER_RT_SUPPORTED_CXX_LIBRARIES none default libcxx)
 set(COMPILER_RT_CXX_LIBRARY "default" CACHE STRING "Specify C++ library to use. Supported values are ${COMPILER_RT_SUPPORTED_CXX_LIBRARIES}.")
 if (NOT "${COMPILER_RT_CXX_LIBRARY}" IN_LIST COMPILER_RT_SUPPORTED_CXX_LIBRARIES)
@@ -843,6 +846,10 @@ if (SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH)
   add_compile_definitions(SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH)
 endif()
 
+if (SANITIZER_AARCH64_39BIT_VA)
+  add_compile_definitions(SANITIZER_AARCH64_39BIT_VA)
+endif()
+
 add_subdirectory(lib)
 
 if(COMPILER_RT_INCLUDE_TESTS)



More information about the llvm-commits mailing list