From 17623e96b5b84c0868fe6b4a1456e3d7da275c95 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Thu, 15 Jun 2023 23:14:05 +0000 Subject: [PATCH] [compiler-rt] Go back to using the 32-bit allocator for Fuchsia+RISCV64 Due to logic in the 64-bit allocator, the smallest allocation we can zx_vmar_allocate is 2^37 bytes, but this is too large to allocate for the standalone lsan allocator on a 39-bit VMA. This leads to the zx_vmar_allocate call when initially setting up the allocator to fail. This is similar to what android experiences on a 64-bit system with a small vma. (See sanitizer_allocator_test.cpp). This effectively reverts f6c4808d95221a5838e14474d95c6fe85bb1488a and has Fuchsia use the 32-bit allocator for RISCV. --- compiler-rt/lib/sanitizer_common/sanitizer_platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h index ea703b7..764996e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h @@ -284,7 +284,7 @@ // For such platforms build this code with -DSANITIZER_CAN_USE_ALLOCATOR64=0 or // change the definition of SANITIZER_CAN_USE_ALLOCATOR64 here. #ifndef SANITIZER_CAN_USE_ALLOCATOR64 -# if (SANITIZER_RISCV64 && !SANITIZER_FUCHSIA) || SANITIZER_IOS +# if SANITIZER_RISCV64 || SANITIZER_IOS # define SANITIZER_CAN_USE_ALLOCATOR64 0 # elif defined(__mips64) || defined(__hexagon__) # define SANITIZER_CAN_USE_ALLOCATOR64 0 -- 2.7.4