Workaround the GCC "(long)fn -> lfn" optimization bug.

Pass "-fno-builtin-rint -fno-builtin-rintl -fno-builtin-rintf" to avoid
generating self recursions in lrint, lrintl, and lrintf.

BUG: 14225968
Change-Id: Iffc4d8f0692580d636a529f4c8aa9a7a10d7acd8
This commit is contained in:
Ben Cheng 2014-05-29 16:02:09 -07:00
parent d4fbb1a861
commit ff00dc8565

View File

@ -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)