Skip to content

[asan] Define mallopt and mallinfo for Fuchsia asan runtime #129105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

PiJoules
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (PiJoules)

Changes

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

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h (+4-1)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index febd233bb1e3c..85cd95c30de2a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -129,8 +129,10 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
 
 #if SANITIZER_FUCHSIA
 #define SI_NOT_FUCHSIA 0
+#  define SI_FUCHSIA 1
 #else
 #define SI_NOT_FUCHSIA 1
+#  define SI_FUCHSIA 0
 #endif
 
 #if SANITIZER_SOLARIS
@@ -521,7 +523,8 @@ SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment,
 
 #define SANITIZER_INTERCEPT_MMAP SI_POSIX
 #define SANITIZER_INTERCEPT_MMAP64 SI_GLIBC || SI_SOLARIS
-#define SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO (SI_GLIBC || SI_ANDROID)
+#define SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO \
+  (SI_GLIBC || SI_ANDROID || SI_FUCHSIA)
 #define SANITIZER_INTERCEPT_MEMALIGN (!SI_FREEBSD && !SI_MAC && !SI_NETBSD)
 #define SANITIZER_INTERCEPT___LIBC_MEMALIGN SI_GLIBC
 #define SANITIZER_INTERCEPT_PVALLOC (SI_GLIBC || SI_ANDROID)

Copy link
Contributor

@frobtech frobtech left a comment

Choose a reason for hiding this comment

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

lgtm

@PiJoules PiJoules force-pushed the mallopt-asan-fuchsia branch from ff6c945 to fabac8f Compare February 28, 2025 19:14
@PiJoules PiJoules merged commit fcc571e into llvm:main Feb 28, 2025
5 of 9 checks passed
@PiJoules PiJoules deleted the mallopt-asan-fuchsia branch February 28, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants