On Android, mallinfo2 is an alias of mallinfo, which results
in errors if we try to define both.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Just curious, why we didn't have issue before? I thought it may be fine because it's defined as WEAK ?!
How do you usually build Scudo? When I run the unit tests I cross compile it for Android using llvm's gn build system. If you're building it as part of the Android platform, SCUDO_PREFIX will be defined to add a prefix of scudo_, so the alias in malloc.h wouldn't affect the definitions.
Is it worth examining how we do this on Android? For example, should we remove the mallinfo2 alias for mallinfo, so that we don't have to make this change?
If you removed the mallinfo2 alias and added a definition of mallinfo2 to Bionic, then it would mean that newer NDK versions will increase the API level requirement for mallinfo2 from baseline to whichever version of Android you added it in. So from an NDK user perspective, that doesn't seem like a good idea.
I see, thanks!
That prefix is only added when #if SCUDO_ANDROID && _BIONIC (code), do you think we need to do #if !SCUDO_ANDROID || !_BIONIC?