Android issues

Jason Evans jasone at
Thu Mar 15 17:13:58 PDT 2012

On Mar 15, 2012, at 12:58 PM, Mike Hommey wrote:
> I'm trying to get jemalloc built for Android, and here is a short list
> of things that go wrong:
> - pthread_create is not defined in libpthread, but in libc, which makes
>  the test fail.

Interesting.  A workaround for this should be pretty straightforward (on my todo list now).

> - The AC_RUN_IFELSE test for STATIC_PAGE_SHIFT fails because it requires
>  not to be cross-compiling, which makes hard-fail.

Andreas Vinsander cross-compiled for SH4 by providing sh4.cache to configure:

Perhaps something similar will work for Android.

> - Android system headers don't provide sys/sysctl.h. But it seems it's
>  not used anyways, so removing the include worked for me (and worked on
>  plain Linux too)

I think this was a holdover from using sysctl to get the number of CPUs.  I just removed it on the dev branch.

> - There are no atomic ops for arm, but the __sync_* ones work. Sadly,
>  the compiler doesn't define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4.

Ouch.  Maybe "CPPFLAGS=-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 configure …" will be an adequate workaround.


More information about the jemalloc-discuss mailing list