Android.mk revision ff00dc8565d36fc5d30c0c8aa3714c66536dbcee
1LOCAL_PATH:= $(call my-dir) 2 3# TODO: this comes from from upstream's libc, not libm, but it's an 4# implementation detail that should have hidden visibility, so it needs 5# to be in whatever library the math code is in. 6libm_common_src_files := \ 7 digittoint.c \ 8 9# TODO: this is not in the BSDs. 10libm_common_src_files += \ 11 significandl.c \ 12 sincos.c \ 13 14libm_common_src_files += \ 15 upstream-freebsd/lib/msun/bsdsrc/b_exp.c \ 16 upstream-freebsd/lib/msun/bsdsrc/b_log.c \ 17 upstream-freebsd/lib/msun/bsdsrc/b_tgamma.c \ 18 upstream-freebsd/lib/msun/src/e_acos.c \ 19 upstream-freebsd/lib/msun/src/e_acosf.c \ 20 upstream-freebsd/lib/msun/src/e_acosh.c \ 21 upstream-freebsd/lib/msun/src/e_acoshf.c \ 22 upstream-freebsd/lib/msun/src/e_asin.c \ 23 upstream-freebsd/lib/msun/src/e_asinf.c \ 24 upstream-freebsd/lib/msun/src/e_atan2.c \ 25 upstream-freebsd/lib/msun/src/e_atan2f.c \ 26 upstream-freebsd/lib/msun/src/e_atanh.c \ 27 upstream-freebsd/lib/msun/src/e_atanhf.c \ 28 upstream-freebsd/lib/msun/src/e_cosh.c \ 29 upstream-freebsd/lib/msun/src/e_coshf.c \ 30 upstream-freebsd/lib/msun/src/e_exp.c \ 31 upstream-freebsd/lib/msun/src/e_expf.c \ 32 upstream-freebsd/lib/msun/src/e_fmod.c \ 33 upstream-freebsd/lib/msun/src/e_fmodf.c \ 34 upstream-freebsd/lib/msun/src/e_gamma.c \ 35 upstream-freebsd/lib/msun/src/e_gammaf.c \ 36 upstream-freebsd/lib/msun/src/e_gammaf_r.c \ 37 upstream-freebsd/lib/msun/src/e_gamma_r.c \ 38 upstream-freebsd/lib/msun/src/e_hypot.c \ 39 upstream-freebsd/lib/msun/src/e_hypotf.c \ 40 upstream-freebsd/lib/msun/src/e_j0.c \ 41 upstream-freebsd/lib/msun/src/e_j0f.c \ 42 upstream-freebsd/lib/msun/src/e_j1.c \ 43 upstream-freebsd/lib/msun/src/e_j1f.c \ 44 upstream-freebsd/lib/msun/src/e_jn.c \ 45 upstream-freebsd/lib/msun/src/e_jnf.c \ 46 upstream-freebsd/lib/msun/src/e_lgamma.c \ 47 upstream-freebsd/lib/msun/src/e_lgammaf.c \ 48 upstream-freebsd/lib/msun/src/e_lgammaf_r.c \ 49 upstream-freebsd/lib/msun/src/e_lgamma_r.c \ 50 upstream-freebsd/lib/msun/src/e_log10.c \ 51 upstream-freebsd/lib/msun/src/e_log10f.c \ 52 upstream-freebsd/lib/msun/src/e_log2.c \ 53 upstream-freebsd/lib/msun/src/e_log2f.c \ 54 upstream-freebsd/lib/msun/src/e_log.c \ 55 upstream-freebsd/lib/msun/src/e_logf.c \ 56 upstream-freebsd/lib/msun/src/e_pow.c \ 57 upstream-freebsd/lib/msun/src/e_powf.c \ 58 upstream-freebsd/lib/msun/src/e_remainder.c \ 59 upstream-freebsd/lib/msun/src/e_remainderf.c \ 60 upstream-freebsd/lib/msun/src/e_rem_pio2.c \ 61 upstream-freebsd/lib/msun/src/e_rem_pio2f.c \ 62 upstream-freebsd/lib/msun/src/e_scalb.c \ 63 upstream-freebsd/lib/msun/src/e_scalbf.c \ 64 upstream-freebsd/lib/msun/src/e_sinh.c \ 65 upstream-freebsd/lib/msun/src/e_sinhf.c \ 66 upstream-freebsd/lib/msun/src/e_sqrt.c \ 67 upstream-freebsd/lib/msun/src/e_sqrtf.c \ 68 upstream-freebsd/lib/msun/src/imprecise.c \ 69 upstream-freebsd/lib/msun/src/k_cos.c \ 70 upstream-freebsd/lib/msun/src/k_cosf.c \ 71 upstream-freebsd/lib/msun/src/k_exp.c \ 72 upstream-freebsd/lib/msun/src/k_expf.c \ 73 upstream-freebsd/lib/msun/src/k_rem_pio2.c \ 74 upstream-freebsd/lib/msun/src/k_sin.c \ 75 upstream-freebsd/lib/msun/src/k_sinf.c \ 76 upstream-freebsd/lib/msun/src/k_tan.c \ 77 upstream-freebsd/lib/msun/src/k_tanf.c \ 78 upstream-freebsd/lib/msun/src/s_asinh.c \ 79 upstream-freebsd/lib/msun/src/s_asinhf.c \ 80 upstream-freebsd/lib/msun/src/s_atan.c \ 81 upstream-freebsd/lib/msun/src/s_atanf.c \ 82 upstream-freebsd/lib/msun/src/s_carg.c \ 83 upstream-freebsd/lib/msun/src/s_cargf.c \ 84 upstream-freebsd/lib/msun/src/s_cbrt.c \ 85 upstream-freebsd/lib/msun/src/s_cbrtf.c \ 86 upstream-freebsd/lib/msun/src/s_ccosh.c \ 87 upstream-freebsd/lib/msun/src/s_ccoshf.c \ 88 upstream-freebsd/lib/msun/src/s_ceil.c \ 89 upstream-freebsd/lib/msun/src/s_ceilf.c \ 90 upstream-freebsd/lib/msun/src/s_cexp.c \ 91 upstream-freebsd/lib/msun/src/s_cexpf.c \ 92 upstream-freebsd/lib/msun/src/s_cimag.c \ 93 upstream-freebsd/lib/msun/src/s_cimagf.c \ 94 upstream-freebsd/lib/msun/src/s_conj.c \ 95 upstream-freebsd/lib/msun/src/s_conjf.c \ 96 upstream-freebsd/lib/msun/src/s_copysign.c \ 97 upstream-freebsd/lib/msun/src/s_copysignf.c \ 98 upstream-freebsd/lib/msun/src/s_cos.c \ 99 upstream-freebsd/lib/msun/src/s_cosf.c \ 100 upstream-freebsd/lib/msun/src/s_cproj.c \ 101 upstream-freebsd/lib/msun/src/s_cprojf.c \ 102 upstream-freebsd/lib/msun/src/s_creal.c \ 103 upstream-freebsd/lib/msun/src/s_crealf.c \ 104 upstream-freebsd/lib/msun/src/s_csinh.c \ 105 upstream-freebsd/lib/msun/src/s_csinhf.c \ 106 upstream-freebsd/lib/msun/src/s_csqrt.c \ 107 upstream-freebsd/lib/msun/src/s_csqrtf.c \ 108 upstream-freebsd/lib/msun/src/s_ctanh.c \ 109 upstream-freebsd/lib/msun/src/s_ctanhf.c \ 110 upstream-freebsd/lib/msun/src/s_erf.c \ 111 upstream-freebsd/lib/msun/src/s_erff.c \ 112 upstream-freebsd/lib/msun/src/s_exp2.c \ 113 upstream-freebsd/lib/msun/src/s_exp2f.c \ 114 upstream-freebsd/lib/msun/src/s_expm1.c \ 115 upstream-freebsd/lib/msun/src/s_expm1f.c \ 116 upstream-freebsd/lib/msun/src/s_fabs.c \ 117 upstream-freebsd/lib/msun/src/s_fabsf.c \ 118 upstream-freebsd/lib/msun/src/s_fdim.c \ 119 upstream-freebsd/lib/msun/src/s_finite.c \ 120 upstream-freebsd/lib/msun/src/s_finitef.c \ 121 upstream-freebsd/lib/msun/src/s_floor.c \ 122 upstream-freebsd/lib/msun/src/s_floorf.c \ 123 upstream-freebsd/lib/msun/src/s_fma.c \ 124 upstream-freebsd/lib/msun/src/s_fmaf.c \ 125 upstream-freebsd/lib/msun/src/s_fmax.c \ 126 upstream-freebsd/lib/msun/src/s_fmaxf.c \ 127 upstream-freebsd/lib/msun/src/s_fmin.c \ 128 upstream-freebsd/lib/msun/src/s_fminf.c \ 129 upstream-freebsd/lib/msun/src/s_frexp.c \ 130 upstream-freebsd/lib/msun/src/s_frexpf.c \ 131 upstream-freebsd/lib/msun/src/s_ilogb.c \ 132 upstream-freebsd/lib/msun/src/s_ilogbf.c \ 133 upstream-freebsd/lib/msun/src/s_llrint.c \ 134 upstream-freebsd/lib/msun/src/s_llrintf.c \ 135 upstream-freebsd/lib/msun/src/s_llround.c \ 136 upstream-freebsd/lib/msun/src/s_llroundf.c \ 137 upstream-freebsd/lib/msun/src/s_log1p.c \ 138 upstream-freebsd/lib/msun/src/s_log1pf.c \ 139 upstream-freebsd/lib/msun/src/s_logb.c \ 140 upstream-freebsd/lib/msun/src/s_logbf.c \ 141 upstream-freebsd/lib/msun/src/s_lrint.c \ 142 upstream-freebsd/lib/msun/src/s_lrintf.c \ 143 upstream-freebsd/lib/msun/src/s_lround.c \ 144 upstream-freebsd/lib/msun/src/s_lroundf.c \ 145 upstream-freebsd/lib/msun/src/s_modf.c \ 146 upstream-freebsd/lib/msun/src/s_modff.c \ 147 upstream-freebsd/lib/msun/src/s_nan.c \ 148 upstream-freebsd/lib/msun/src/s_nearbyint.c \ 149 upstream-freebsd/lib/msun/src/s_nextafter.c \ 150 upstream-freebsd/lib/msun/src/s_nextafterf.c \ 151 upstream-freebsd/lib/msun/src/s_remquo.c \ 152 upstream-freebsd/lib/msun/src/s_remquof.c \ 153 upstream-freebsd/lib/msun/src/s_rint.c \ 154 upstream-freebsd/lib/msun/src/s_rintf.c \ 155 upstream-freebsd/lib/msun/src/s_round.c \ 156 upstream-freebsd/lib/msun/src/s_roundf.c \ 157 upstream-freebsd/lib/msun/src/s_scalbln.c \ 158 upstream-freebsd/lib/msun/src/s_scalbn.c \ 159 upstream-freebsd/lib/msun/src/s_scalbnf.c \ 160 upstream-freebsd/lib/msun/src/s_signgam.c \ 161 upstream-freebsd/lib/msun/src/s_significand.c \ 162 upstream-freebsd/lib/msun/src/s_significandf.c \ 163 upstream-freebsd/lib/msun/src/s_sin.c \ 164 upstream-freebsd/lib/msun/src/s_sinf.c \ 165 upstream-freebsd/lib/msun/src/s_tan.c \ 166 upstream-freebsd/lib/msun/src/s_tanf.c \ 167 upstream-freebsd/lib/msun/src/s_tanh.c \ 168 upstream-freebsd/lib/msun/src/s_tanhf.c \ 169 upstream-freebsd/lib/msun/src/s_tgammaf.c \ 170 upstream-freebsd/lib/msun/src/s_trunc.c \ 171 upstream-freebsd/lib/msun/src/s_truncf.c \ 172 upstream-freebsd/lib/msun/src/w_cabs.c \ 173 upstream-freebsd/lib/msun/src/w_cabsf.c \ 174 upstream-freebsd/lib/msun/src/w_drem.c \ 175 upstream-freebsd/lib/msun/src/w_dremf.c \ 176 177libm_common_src_files += \ 178 fake_long_double.c \ 179 signbit.c \ 180 181libm_ld_src_files = \ 182 upstream-freebsd/lib/msun/src/e_acosl.c \ 183 upstream-freebsd/lib/msun/src/e_acoshl.c \ 184 upstream-freebsd/lib/msun/src/e_asinl.c \ 185 upstream-freebsd/lib/msun/src/e_atan2l.c \ 186 upstream-freebsd/lib/msun/src/e_atanhl.c \ 187 upstream-freebsd/lib/msun/src/e_fmodl.c \ 188 upstream-freebsd/lib/msun/src/e_hypotl.c \ 189 upstream-freebsd/lib/msun/src/e_remainderl.c \ 190 upstream-freebsd/lib/msun/src/e_sqrtl.c \ 191 upstream-freebsd/lib/msun/src/s_asinhl.c \ 192 upstream-freebsd/lib/msun/src/s_atanl.c \ 193 upstream-freebsd/lib/msun/src/s_cbrtl.c \ 194 upstream-freebsd/lib/msun/src/s_ceill.c \ 195 upstream-freebsd/lib/msun/src/s_copysignl.c \ 196 upstream-freebsd/lib/msun/src/s_cosl.c \ 197 upstream-freebsd/lib/msun/src/s_fabsl.c \ 198 upstream-freebsd/lib/msun/src/s_floorl.c \ 199 upstream-freebsd/lib/msun/src/s_fmal.c \ 200 upstream-freebsd/lib/msun/src/s_fmaxl.c \ 201 upstream-freebsd/lib/msun/src/s_fminl.c \ 202 upstream-freebsd/lib/msun/src/s_modfl.c \ 203 upstream-freebsd/lib/msun/src/s_frexpl.c \ 204 upstream-freebsd/lib/msun/src/s_ilogbl.c \ 205 upstream-freebsd/lib/msun/src/s_llrintl.c \ 206 upstream-freebsd/lib/msun/src/s_llroundl.c \ 207 upstream-freebsd/lib/msun/src/s_logbl.c \ 208 upstream-freebsd/lib/msun/src/s_lrintl.c \ 209 upstream-freebsd/lib/msun/src/s_lroundl.c \ 210 upstream-freebsd/lib/msun/src/s_nextafterl.c \ 211 upstream-freebsd/lib/msun/src/s_nexttoward.c \ 212 upstream-freebsd/lib/msun/src/s_nexttowardf.c \ 213 upstream-freebsd/lib/msun/src/s_remquol.c \ 214 upstream-freebsd/lib/msun/src/s_rintl.c \ 215 upstream-freebsd/lib/msun/src/s_roundl.c \ 216 upstream-freebsd/lib/msun/src/s_scalbnl.c \ 217 upstream-freebsd/lib/msun/src/s_sinl.c \ 218 upstream-freebsd/lib/msun/src/s_tanl.c \ 219 upstream-freebsd/lib/msun/src/s_truncl.c \ 220 221libm_ld_src_files += \ 222 upstream-freebsd/lib/msun/ld128/invtrig.c \ 223 upstream-freebsd/lib/msun/ld128/k_cosl.c \ 224 upstream-freebsd/lib/msun/ld128/k_sinl.c \ 225 upstream-freebsd/lib/msun/ld128/k_tanl.c \ 226 upstream-freebsd/lib/msun/ld128/s_exp2l.c \ 227 upstream-freebsd/lib/msun/ld128/s_expl.c \ 228 upstream-freebsd/lib/msun/ld128/s_logl.c \ 229 upstream-freebsd/lib/msun/ld128/s_nanl.c \ 230 231# TODO: re-enable i387/e_sqrtf.S for x86, and maybe others. 232 233libm_common_cflags := \ 234 -DFLT_EVAL_METHOD=0 \ 235 -std=c99 \ 236 -include $(LOCAL_PATH)/freebsd-compat.h \ 237 -Wno-missing-braces \ 238 -Wno-parentheses \ 239 -Wno-sign-compare \ 240 -Wno-uninitialized \ 241 -Wno-unknown-pragmas \ 242 -fvisibility=hidden \ 243 244# Workaround the GCC "(long)fn -> lfn" optimization bug which will result in 245# self recursions for lrint, lrintf, and lrintl. 246# BUG: 14225968 247libm_common_cflags += -fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl 248 249libm_common_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/ 250 251libm_ld_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/ld128/ 252 253# 254# libm.a for target. 255# 256include $(CLEAR_VARS) 257LOCAL_MODULE:= libm 258LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 259LOCAL_ARM_MODE := arm 260LOCAL_CFLAGS := $(libm_common_cflags) 261LOCAL_C_INCLUDES += $(libm_common_includes) 262LOCAL_SRC_FILES := $(libm_common_src_files) 263LOCAL_SYSTEM_SHARED_LIBRARIES := libc 264 265# arch-specific settings 266LOCAL_C_INCLUDES_arm := $(LOCAL_PATH)/arm 267LOCAL_SRC_FILES_arm := arm/fenv.c 268 269LOCAL_C_INCLUDES_arm64 := $(libm_ld_includes) 270LOCAL_SRC_FILES_arm64 := arm64/fenv.c $(libm_ld_src_files) 271 272LOCAL_C_INCLUDES_x86 := $(LOCAL_PATH)/i387 273LOCAL_SRC_FILES_x86 := i387/fenv.c 274 275LOCAL_C_INCLUDES_x86_64 := $(libm_ld_includes) 276LOCAL_SRC_FILES_x86_64 := amd64/fenv.c $(libm_ld_src_files) 277 278LOCAL_SRC_FILES_mips := mips/fenv.c 279 280LOCAL_C_INCLUDES_mips64 := $(libm_ld_includes) 281LOCAL_SRC_FILES_mips64 := mips/fenv.c $(libm_ld_src_files) 282 283include $(BUILD_STATIC_LIBRARY) 284 285# 286# libm.so for target. 287# 288include $(CLEAR_VARS) 289LOCAL_MODULE:= libm 290LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 291LOCAL_SYSTEM_SHARED_LIBRARIES := libc 292LOCAL_WHOLE_STATIC_LIBRARIES := libm 293include $(BUILD_SHARED_LIBRARY) 294