From 4e1562642a813ef5910f19549a06d1a40cb34c56 Mon Sep 17 00:00:00 2001
From: klzgrad <kizdiv@gmail.com>
Date: Sat, 5 Aug 2023 23:35:21 +0800
Subject: [PATCH] allocator: Disable PartitionAlloc memory tagging on non-glibc

Memory tagging depends on ifunc which is glibc-specific.
---
 .../partition_allocator/partition_alloc_config.h         | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/base/allocator/partition_allocator/partition_alloc_config.h b/src/base/allocator/partition_allocator/partition_alloc_config.h
index bb6195f590..6db7c24651 100644
--- a/src/base/allocator/partition_allocator/partition_alloc_config.h
+++ b/src/base/allocator/partition_allocator/partition_alloc_config.h
@@ -152,10 +152,11 @@ static_assert(sizeof(void*) != 8, "");
   (!BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \
    defined(ARCH_CPU_LITTLE_ENDIAN))
 
-#define PA_CONFIG_HAS_MEMORY_TAGGING()              \
-  (defined(ARCH_CPU_ARM64) && defined(__clang__) && \
-   !defined(ADDRESS_SANITIZER) &&                   \
-   (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)))
+#define PA_CONFIG_HAS_MEMORY_TAGGING()                \
+  (defined(ARCH_CPU_ARM64) && defined(__clang__) &&   \
+   !defined(ADDRESS_SANITIZER) &&                     \
+   (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID))) && \
+      defined(LIBC_GLIBC)
 
 #if PA_CONFIG(HAS_MEMORY_TAGGING)
 static_assert(sizeof(void*) == 8);