[compiler-rt] 9f42b04 - scudo: Don't define mallinfo2 on Android.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 14:48:19 PDT 2023


Author: Peter Collingbourne
Date: 2023-03-17T14:47:41-07:00
New Revision: 9f42b04128bc5d3b9c8701ab83f8f7ba4e9b93b2

URL: https://github.com/llvm/llvm-project/commit/9f42b04128bc5d3b9c8701ab83f8f7ba4e9b93b2
DIFF: https://github.com/llvm/llvm-project/commit/9f42b04128bc5d3b9c8701ab83f8f7ba4e9b93b2.diff

LOG: scudo: Don't define mallinfo2 on Android.

On Android, mallinfo2 is an alias of mallinfo, which results
in errors if we try to define both.

Differential Revision: https://reviews.llvm.org/D146324

Added: 
    

Modified: 
    compiler-rt/lib/scudo/standalone/wrappers_c.inc

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/wrappers_c.inc b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
index 106a2875a1fe..3e495eaa4a39 100644
--- a/compiler-rt/lib/scudo/standalone/wrappers_c.inc
+++ b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
@@ -54,6 +54,8 @@ INTERFACE WEAK struct SCUDO_MALLINFO SCUDO_PREFIX(mallinfo)(void) {
   return Info;
 }
 
+// On Android, mallinfo2 is an alias of mallinfo, so don't define both.
+#if !SCUDO_ANDROID
 INTERFACE WEAK struct __scudo_mallinfo2 SCUDO_PREFIX(mallinfo2)(void) {
   struct __scudo_mallinfo2 Info = {};
   scudo::StatCounters Stats;
@@ -70,6 +72,7 @@ INTERFACE WEAK struct __scudo_mallinfo2 SCUDO_PREFIX(mallinfo2)(void) {
   Info.fordblks = Info.fsmblks;
   return Info;
 }
+#endif
 
 INTERFACE WEAK void *SCUDO_PREFIX(malloc)(size_t size) {
   return scudo::setErrnoOnNull(SCUDO_ALLOCATOR.allocate(


        


More information about the llvm-commits mailing list