Index: include/llvm/Support/MathExtras.h =================================================================== --- include/llvm/Support/MathExtras.h +++ include/llvm/Support/MathExtras.h @@ -456,8 +456,12 @@ /// Log2 - This function returns the log base 2 of the specified value inline double Log2(double Value) { #if defined(__ANDROID_API__) && __ANDROID_API__ < 18 +#if !defined(HAVE_LOG2) || HAVE_LOG2 return (double)__builtin_log2l(Value); #else + return __builtin_log(Value) / __builtin_log(2.0); +#endif +#else return log2(Value); #endif }