Skip to content

Conversation

@JDevlieghere
Copy link
Member

@JDevlieghere JDevlieghere commented Nov 5, 2025

The VM_MEMORY_SANITIZER constant was added in macOs 10.15 and friends. Support using the constant on older OSes.

Fixes #156144

@llvmbot
Copy link
Member

llvmbot commented Nov 5, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

The VM_MEMORY_SANITIZER constant was added in macOs 10.15 and friends. Support using the constant on older OSes.

Fixes #156144


Full diff: https://github.com/llvm/llvm-project/pull/166599.diff

1 Files Affected:

  • (modified) lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp (+5)
diff --git a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
index 9d0d60fdaaed9..34c5c9a025e5b 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
@@ -15,6 +15,11 @@
 #include <cassert>
 #include <mach/mach_vm.h>
 
+// From <mach/vm_statistics.h>, but not on older OSs.
+#ifndef VM_MEMORY_SANITIZER
+#define VM_MEMORY_SANITIZER 99
+#endif
+
 MachVMRegion::MachVMRegion(task_t task)
     : m_task(task), m_addr(INVALID_NUB_ADDRESS), m_err(),
       m_start(INVALID_NUB_ADDRESS), m_size(0), m_depth(-1),

Copy link
Contributor

@felipepiovezan felipepiovezan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

@JDevlieghere JDevlieghere enabled auto-merge (squash) November 5, 2025 17:50
The VM_MEMORY_SANITIZER was added in macOs 10.15 and friends. Support
using the constant on older OSes.

Fixes llvm#156144
@JDevlieghere JDevlieghere merged commit bc55f4f into llvm:main Nov 5, 2025
7 of 9 checks passed
@JDevlieghere JDevlieghere added this to the LLVM 21.x Release milestone Nov 5, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Nov 5, 2025
@JDevlieghere
Copy link
Member Author

/cherry-pick bc55f4f

@JDevlieghere JDevlieghere deleted the issue-156144 branch November 5, 2025 18:44
@llvmbot
Copy link
Member

llvmbot commented Nov 5, 2025

/pull-request #166614

@llvmbot llvmbot moved this from Needs Triage to Done in LLVM Release Status Nov 5, 2025
dyung pushed a commit that referenced this pull request Nov 11, 2025
The VM_MEMORY_SANITIZER constant was added in macOs 10.15 and friends.
Support using the constant on older OSes.

Fixes #156144

(cherry picked from commit bc55f4f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

error: use of undeclared identifier 'VM_MEMORY_SANITIZER'

3 participants