summaryrefslogtreecommitdiff
path: root/compiler-rt
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-03-10 21:17:46 -0800
committerVitaly Buka <vitalybuka@google.com>2023-03-10 21:18:25 -0800
commit3b4cb1e96c645bb833fe710856479c31383859bb (patch)
treef8dd0d4ff4d5ac3d303973ed385c123b2c96b057 /compiler-rt
parent0458405a6bf030553c10d26f3be2546f21b50d86 (diff)
downloadllvm-3b4cb1e96c645bb833fe710856479c31383859bb.tar.gz
Revert "[hwasan] Provide aliases for c allocation functions for Fuchsia"
Breaks build bots, details in D145718. This reverts commit 7de775159660538449652ca442c34fd91feecef6.
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
index 044a60417871..ad359b12904b 100644
--- a/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp
@@ -18,6 +18,8 @@
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_tls_get_addr.h"
+#if !SANITIZER_FUCHSIA
+
using namespace __hwasan;
struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
@@ -104,7 +106,6 @@ uptr __sanitizer_malloc_usable_size(const void *ptr) {
return __sanitizer_get_allocated_size(ptr);
}
-#if SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO
SANITIZER_INTERFACE_ATTRIBUTE
struct __sanitizer_struct_mallinfo __sanitizer_mallinfo() {
__sanitizer_struct_mallinfo sret;
@@ -114,7 +115,6 @@ struct __sanitizer_struct_mallinfo __sanitizer_mallinfo() {
SANITIZER_INTERFACE_ATTRIBUTE
int __sanitizer_mallopt(int cmd, int value) { return 0; }
-#endif // SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO
SANITIZER_INTERFACE_ATTRIBUTE
void __sanitizer_malloc_stats(void) {
@@ -155,9 +155,12 @@ void *__sanitizer_malloc(uptr size) {
} // extern "C"
-#define INTERCEPTOR_ALIAS(RET, FN, ARGS...) \
- extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
- ARGS) ALIAS("__sanitizer_" #FN)
+#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)
INTERCEPTOR_ALIAS(int, posix_memalign, void **memptr, SIZE_T alignment,
SIZE_T size);
@@ -175,9 +178,10 @@ INTERCEPTOR_ALIAS(void *, malloc, SIZE_T size);
INTERCEPTOR_ALIAS(void *, memalign, SIZE_T alignment, SIZE_T size);
INTERCEPTOR_ALIAS(void *, pvalloc, SIZE_T size);
INTERCEPTOR_ALIAS(void, cfree, void *ptr);
-#if SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO
INTERCEPTOR_ALIAS(__sanitizer_struct_mallinfo, mallinfo);
INTERCEPTOR_ALIAS(int, mallopt, int cmd, int value);
-#endif
INTERCEPTOR_ALIAS(void, malloc_stats, void);
# endif
+#endif // #if HWASAN_WITH_INTERCEPTORS
+
+#endif // SANITIZER_FUCHSIA