xref: /aosp_15_r20/external/fdlibm/Android.bp (revision 1e651e1ef2b613db2c4b29ae59c1de74cf0222ae)
1// Copyright (C) 2007 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["external_fdlibm_license"],
17}
18
19// Added automatically by a large-scale-change
20license {
21    name: "external_fdlibm_license",
22    visibility: [":__subpackages__"],
23    license_kinds: [
24        "SPDX-license-identifier-BSD",
25    ],
26    license_text: [
27        "NOTICE",
28    ],
29}
30
31cc_library_static {
32    name: "libfdlibm",
33    host_supported: true,
34
35    srcs: [
36        "k_standard.c",
37        "k_rem_pio2.c",
38        "k_cos.c",
39        "k_sin.c",
40        "k_tan.c",
41        "e_acos.c",
42        "e_acosh.c",
43        "e_asin.c",
44        "e_atan2.c",
45        "e_atanh.c",
46        "e_cosh.c",
47        "e_exp.c",
48        "e_fmod.c",
49        "e_gamma.c",
50        "e_gamma_r.c",
51        "e_hypot.c",
52        "e_j0.c",
53        "e_j1.c",
54        "e_jn.c",
55        "e_lgamma.c",
56        "e_lgamma_r.c",
57        "e_log.c",
58        "e_log10.c",
59        "e_pow.c",
60        "e_rem_pio2.c",
61        "e_remainder.c",
62        "e_scalb.c",
63        "e_sinh.c",
64        "e_sqrt.c",
65        "w_acos.c",
66        "w_acosh.c",
67        "w_asin.c",
68        "w_atan2.c",
69        "w_atanh.c",
70        "w_cosh.c",
71        "w_exp.c",
72        "w_fmod.c",
73        "w_gamma.c",
74        "w_gamma_r.c",
75        "w_hypot.c",
76        "w_j0.c",
77        "w_j1.c",
78        "w_jn.c",
79        "w_lgamma.c",
80        "w_lgamma_r.c",
81        "w_log.c",
82        "w_log10.c",
83        "w_pow.c",
84        "w_remainder.c",
85        "w_scalb.c",
86        "w_sinh.c",
87        "w_sqrt.c",
88        "s_asinh.c",
89        "s_atan.c",
90        "s_cbrt.c",
91        "s_ceil.c",
92        "s_copysign.c",
93        "s_cos.c",
94        "s_erf.c",
95        "s_expm1.c",
96        "s_fabs.c",
97        "s_finite.c",
98        "s_floor.c",
99        "s_frexp.c",
100        "s_ilogb.c",
101        "s_isnan.c",
102        "s_ldexp.c",
103        "s_lib_version.c",
104        "s_log1p.c",
105        "s_logb.c",
106        "s_matherr.c",
107        "s_modf.c",
108        "s_nextafter.c",
109        "s_rint.c",
110        "s_scalbn.c",
111        "s_signgam.c",
112        "s_significand.c",
113        "s_sin.c",
114        "s_tan.c",
115        "s_tanh.c",
116    ],
117
118    // c99 specifies a less relaxed floating point model that does not
119    // enable floating point expession contraction (e.g: fused multiply-add
120    // operations).
121    c_std: "c99",
122
123    cflags: [
124        // This is necessary to guarantee that the FDLIBM functions are in
125        // "IEEE spirit", i.e. to guarantee that the IEEE 754 core functions
126        // are used.
127        "-D_IEEE_LIBM",
128
129        // Android only supports little-endian.
130        "-D__LITTLE_ENDIAN",
131
132        // Disable compiler optimizations that interact badly with this crufty
133        // library (see their own admission in 'readme'). Without this, we
134        // fail StrictMath tests on x86.
135        "-fno-strict-aliasing",
136
137        // Disable warnings. We need a specific version of fdlibm and can't fix this upstream.
138        "-Werror",
139        "-Wno-sign-compare",
140        "-Wno-dangling-else",
141        "-Wno-unknown-pragmas",
142
143        "-Wno-dangling-else",
144        "-Wno-logical-op-parentheses",
145        "-Wno-sometimes-uninitialized",
146    ],
147
148    apex_available: [
149        "com.android.art",
150        "com.android.art.debug",
151    ],
152    min_sdk_version: "S",
153}
154