Thursday, July 31, 2014

A newer kernel is required to run this binary. (__kernel_cmpxchg64 helper)

While porting multithreaded C++ code to Android, I've encountered this error:

A newer kernel is required to run this binary. (__kernel_cmpxchg64 helper)

Origin:
https://github.com/mirrors/gcc/blob/master/libgcc/config/arm/linux-atomic-64bit.c

If you also encounter this issue, its important to understand all the elements involved in this error.

  • It is part of gcc 4.7 and up
  • it will fail below kernel 3.1, only then __kernel_cmpxchg64 was implemented
  • The problem is that 64 bit atomic operation is implemented using the kernel on arm unless armv7 is used.
  • Using arm instead of thumb will not solve your problem.
  • Enabling arm v7 hard-float might solve your problem (it solved mine).
  • Using  -mfpu=vfp and -mfloat-abi=hard might solve your problem (i didn't try as armv7 was desired).
(https://www.mail-archive.com/rust-dev@mozilla.org/msg08627.html)

No comments:

Post a Comment