[PATCH] D146324: scudo: Don't define mallinfo2 on Android.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 12:19:22 PDT 2023


pcc created this revision.
pcc added a reviewer: Chia-hungDuan.
Herald added subscribers: yaneury, supersymetrie, Enna1, danielkiss, cryptoad.
Herald added a project: All.
pcc requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146324

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


Index: compiler-rt/lib/scudo/standalone/wrappers_c.inc
===================================================================
--- compiler-rt/lib/scudo/standalone/wrappers_c.inc
+++ compiler-rt/lib/scudo/standalone/wrappers_c.inc
@@ -54,6 +54,8 @@
   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 @@
   Info.fordblks = Info.fsmblks;
   return Info;
 }
+#endif
 
 INTERFACE WEAK void *SCUDO_PREFIX(malloc)(size_t size) {
   return scudo::setErrnoOnNull(SCUDO_ALLOCATOR.allocate(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146324.506172.patch
Type: text/x-patch
Size: 697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/961a7bf5/attachment.bin>


More information about the llvm-commits mailing list