[PATCH] D145718: [hwasan] Provide aliases for c allocation functions for Fuchsia

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 10:36:27 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5bb826d569cc: Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia (authored by leonardchan).

Changed prior to commit:
  https://reviews.llvm.org/D145718?vs=504302&id=509413#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145718/new/

https://reviews.llvm.org/D145718

Files:
  compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp


Index: compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
===================================================================
--- compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
+++ compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
@@ -16,10 +16,9 @@
 #include "interception/interception.h"
 #include "sanitizer_common/sanitizer_allocator_dlsym.h"
 #include "sanitizer_common/sanitizer_allocator_interface.h"
+#include "sanitizer_common/sanitizer_mallinfo.h"
 #include "sanitizer_common/sanitizer_tls_get_addr.h"
 
-#if !SANITIZER_FUCHSIA
-
 using namespace __hwasan;
 
 struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
@@ -155,12 +154,9 @@
 
 }  // extern "C"
 
-#if HWASAN_WITH_INTERCEPTORS
-#  define INTERCEPTOR_ALIAS(RET, FN, ARGS...)                                 \
-    extern "C" SANITIZER_INTERFACE_ATTRIBUTE RET WRAP(FN)(ARGS)               \
-        ALIAS("__sanitizer_" #FN);                                            \
-    extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
-        ARGS) ALIAS("__sanitizer_" #FN)
+#define INTERCEPTOR_ALIAS(RET, FN, ARGS...)                                 \
+  extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
+      ARGS) ALIAS("__sanitizer_" #FN)
 
 INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
                   SIZE_T size);
@@ -182,6 +178,3 @@
 INTERCEPTOR_ALIAS(int, mallopt, int cmd, int value);
 INTERCEPTOR_ALIAS(void, malloc_stats, void);
 #  endif
-#endif  // #if HWASAN_WITH_INTERCEPTORS
-
-#endif  // SANITIZER_FUCHSIA


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145718.509413.patch
Type: text/x-patch
Size: 1589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230329/cbf01b99/attachment.bin>


More information about the llvm-commits mailing list