diff --git a/libm/Android.mk b/libm/Android.mk index 4dfb21658..b67395f8b 100644 --- a/libm/Android.mk +++ b/libm/Android.mk @@ -241,6 +241,11 @@ libm_common_cflags := \ -Wno-unknown-pragmas \ -fvisibility=hidden \ +# Workaround the GCC "(long)fn -> lfn" optimization bug which will result in +# self recursions for lrint, lrintf, and lrintl. +# BUG: 14225968 +libm_common_cflags += -fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl + libm_common_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/ libm_ld_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/ld128/ @@ -270,10 +275,8 @@ LOCAL_SRC_FILES_x86 := i387/fenv.c LOCAL_C_INCLUDES_x86_64 := $(libm_ld_includes) LOCAL_SRC_FILES_x86_64 := amd64/fenv.c $(libm_ld_src_files) -LOCAL_CFLAGS_mips := -fno-builtin-rintf -fno-builtin-rint LOCAL_SRC_FILES_mips := mips/fenv.c -LOCAL_CFLAGS_mips64 := -fno-builtin-rintf -fno-builtin-rint LOCAL_C_INCLUDES_mips64 := $(libm_ld_includes) LOCAL_SRC_FILES_mips64 := mips/fenv.c $(libm_ld_src_files)