Drop clang version check for __builtin_isinf and __builtin_isnan
This CL unconditionally removes the existance of __builtin_isinf and __builtin_isnan from math.h for clang, because (unlike other math functions) clang doesn't like those to be declared. See LLVM bugzilla entry: http://llvm.org/bugs/show_bug.cgi?id=20958 The reason for decorating all math functions with __attribute__((pcs("aapcs"))) is to offer developers the ability to compile their code with hardfp and still link Android's libm.so which follows softfp calling convention. Before issue 20958 is fixed, those who want clang to compile their code with hardfp in NDK has to go all the way hard, ie. 1) LOCAL_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1 Note that _NDK_MATH_NO_SOFTFP=1 remove __attribute__((pcs("aapcs"))) for all math functions 2) LOCAL_LDLIBS += -lm_hard # link libm_hard.a recompiled with -mhard-float instead of bionic libm.so Change-Id: Ie2f95e73e58e1574e8cadbcab92a5209d94448e1
This commit is contained in:
@@ -533,10 +533,9 @@ double __builtin_fma(double, double, double) __NDK_FPABI_MATH__;
|
||||
double __builtin_hypot(double, double) __NDK_FPABI_MATH__;
|
||||
int __builtin_ilogb(double) __NDK_FPABI_MATH__ __pure2;
|
||||
/* int __builtin_isinf(double) __NDK_FPABI_MATH__ __pure2; */
|
||||
#if !defined(__clang__) || __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 7)
|
||||
#if !defined(__clang__)
|
||||
/* See upstream bug http://llvm.org/bugs/show_bug.cgi?id=20958 */
|
||||
int __builtin_isnan(double) __NDK_FPABI_MATH__ __pure2;
|
||||
#else
|
||||
/* clang < 3.5 has faulty prototype for __builtin_isnan */
|
||||
#endif
|
||||
double __builtin_lgamma(double) __NDK_FPABI_MATH__;
|
||||
long long __builtin_llrint(double) __NDK_FPABI_MATH__;
|
||||
|
||||
Reference in New Issue
Block a user