blob: 0f59e1b0a837fe2f85e2fecffb0f79d022258bd7 [file] [log] [blame]
Dan Willemsen21986fb2016-07-14 15:23:56 -07001// Note that some host libraries have the same module name as the target
2// libraries. This is currently needed to build, for example, adb. But it's
3// probably something that should be changed.
4
5// Pull in the autogenerated sources modules
6build = ["sources.bp"]
7
8// Used by libcrypto, libssl, bssl tool, and native tests
9cc_defaults {
10 name: "boringssl_flags",
Steven Morelandf593be82017-04-14 04:51:23 -070011 vendor_available: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070012
13 cflags: [
14 "-fvisibility=hidden",
15 "-DBORINGSSL_SHARED_LIBRARY",
David Benjaminfc8a7862018-06-25 19:02:46 -040016 "-DBORINGSSL_ANDROID_SYSTEM",
Dan Willemsen21986fb2016-07-14 15:23:56 -070017 "-DOPENSSL_SMALL",
18 "-D_XOPEN_SOURCE=700",
Chih-Hung Hsieh9146d992017-09-27 10:26:03 -070019 "-Werror",
Dan Willemsen21986fb2016-07-14 15:23:56 -070020 "-Wno-unused-parameter",
21 ],
22
23 cppflags: [
24 "-Wall",
25 "-Werror",
26 ],
27
28 conlyflags: ["-std=c99"],
David Benjaminfc8a7862018-06-25 19:02:46 -040029
30 // Build BoringSSL and its tests against the same STL.
31 sdk_version: "9",
32 target: {
33 android: {
34 stl: "libc++_static",
35 },
36 },
Dan Willemsen21986fb2016-07-14 15:23:56 -070037}
38
39// Used by libcrypto + libssl
40cc_defaults {
41 name: "boringssl_defaults",
42
43 local_include_dirs: ["src/include"],
44 export_include_dirs: ["src/include"],
David Benjaminfc8a7862018-06-25 19:02:46 -040045 cflags: ["-DBORINGSSL_IMPLEMENTATION"],
Dan Willemsen21986fb2016-07-14 15:23:56 -070046}
47
48//// libcrypto
49
Kenny Root30c14792016-07-21 14:33:54 -070050// This should be removed when clang can compile everything.
51libcrypto_sources_no_clang = [
Robert Sloan572a4e22017-04-17 10:52:19 -070052 "linux-arm/crypto/fipsmodule/aes-armv4.S",
53 "linux-arm/crypto/fipsmodule/bsaes-armv7.S",
Kenny Root30c14792016-07-21 14:33:54 -070054]
55
Dan Willemsen21986fb2016-07-14 15:23:56 -070056cc_defaults {
57 name: "libcrypto_defaults",
58 host_supported: true,
59
60 // Windows and Macs both have problems with assembly files
61 target: {
62 windows: {
63 enabled: true,
64 cflags: ["-DOPENSSL_NO_ASM"],
65 host_ldlibs: ["-lws2_32"],
66 },
67 darwin: {
68 cflags: ["-DOPENSSL_NO_ASM"],
69 },
Kenny Root7b550be2016-09-20 15:25:24 -070070 host: {
Dan Willemsen21986fb2016-07-14 15:23:56 -070071 host_ldlibs: ["-lpthread"],
72 },
73 },
74
75 local_include_dirs: ["src/crypto"],
76
Dan Willemsen21986fb2016-07-14 15:23:56 -070077 arch: {
Dan Willemsen21986fb2016-07-14 15:23:56 -070078 arm64: {
79 clang_asflags: ["-march=armv8-a+crypto"],
80 },
81 },
Kenny Root30c14792016-07-21 14:33:54 -070082
83 // This should be removed when clang can compile everything.
84 exclude_srcs: libcrypto_sources_no_clang,
85 whole_static_libs: ["libcrypto_no_clang"],
Dan Willemsen21986fb2016-07-14 15:23:56 -070086}
87
88// Target and host library
89cc_library {
90 name: "libcrypto",
Vijay Venkatraman3caad952017-05-16 12:00:57 -070091 vendor_available: true,
Justin Yun47949c52017-07-24 15:19:43 +090092 vndk: {
93 enabled: true,
94 },
Jiyong Parkc3463952018-04-27 21:44:32 +090095 recovery_available: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070096 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -070097 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070098}
99
Kenny Root30c14792016-07-21 14:33:54 -0700100// Target and host library: files that don't compile with clang. This should
101// go away when clang can compile everything with integrated assembler.
102cc_library_static {
103 name: "libcrypto_no_clang",
104 defaults: ["boringssl_defaults", "boringssl_flags"],
105 host_supported: true,
Jiyong Parkc3463952018-04-27 21:44:32 +0900106 recovery_available: true,
Kenny Root30c14792016-07-21 14:33:54 -0700107
108 target: {
109 windows: {
110 enabled: true,
111 },
112 },
113
114 local_include_dirs: ["src/crypto"],
115
116 arch: {
117 arm: {
118 clang_asflags: ["-no-integrated-as"],
119 srcs: libcrypto_sources_no_clang,
120 },
121 },
122}
123
Dan Willemsen21986fb2016-07-14 15:23:56 -0700124// Static library
125// This should only be used for host modules that will be in a JVM, all other
126// modules should use the static variant of libcrypto.
127cc_library_static {
128 name: "libcrypto_static",
129 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
130
131 target: {
132 host: {
David Benjaminc0dedc02017-01-24 17:54:24 -0500133 // TODO: b/26160319. ASAN breaks use of this library in JVM.
Dan Willemsen21986fb2016-07-14 15:23:56 -0700134 // Re-enable sanitization when the issue with making clients of this library
135 // preload ASAN runtime is resolved. Without that, clients are getting runtime
David Benjaminc0dedc02017-01-24 17:54:24 -0500136 // errors due to unresolved ASAN symbols, such as
Dan Willemsen21986fb2016-07-14 15:23:56 -0700137 // __asan_option_detect_stack_use_after_return.
138 sanitize: {
139 never: true,
140 },
141 },
142 },
143}
144
Dan Willemsen21986fb2016-07-14 15:23:56 -0700145//// libssl
146
147// Target static library
148// Deprecated: all users should move to libssl
149cc_library_static {
150 name: "libssl_static",
151 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
152}
153
154// Static and Shared library
155cc_library {
156 name: "libssl",
Dan Willemsenea55e182018-10-23 13:41:19 -0700157 recovery_available: true,
Justin Yun47949c52017-07-24 15:19:43 +0900158 vendor_available: true,
159 vndk: {
160 enabled: true,
161 },
Dan Willemsen21986fb2016-07-14 15:23:56 -0700162 host_supported: true,
163 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700164 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -0700165
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700166 shared_libs: ["libcrypto"],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700167}
168
Dan Willemsen21986fb2016-07-14 15:23:56 -0700169// Tool
170cc_binary {
171 name: "bssl",
172 host_supported: true,
173 defaults: ["bssl_sources", "boringssl_flags"],
174
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700175 shared_libs: [
176 "libcrypto",
177 "libssl",
178 ],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700179 target: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700180 darwin: {
181 enabled: false,
182 },
183 },
184}
Dan Willemsen2458a412016-07-15 09:28:31 -0700185
Adam Langley7c167932018-02-02 14:44:53 -0800186cc_binary {
187 name: "cavp",
188 host_supported: true,
189 srcs: [
190 "src/fipstools/cavp_aes_gcm_test.cc",
191 "src/fipstools/cavp_aes_test.cc",
192 "src/fipstools/cavp_ctr_drbg_test.cc",
193 "src/fipstools/cavp_ecdsa2_keypair_test.cc",
194 "src/fipstools/cavp_ecdsa2_pkv_test.cc",
195 "src/fipstools/cavp_ecdsa2_siggen_test.cc",
196 "src/fipstools/cavp_ecdsa2_sigver_test.cc",
197 "src/fipstools/cavp_hmac_test.cc",
198 "src/fipstools/cavp_kas_test.cc",
199 "src/fipstools/cavp_keywrap_test.cc",
200 "src/fipstools/cavp_main.cc",
201 "src/fipstools/cavp_rsa2_keygen_test.cc",
202 "src/fipstools/cavp_rsa2_siggen_test.cc",
203 "src/fipstools/cavp_rsa2_sigver_test.cc",
204 "src/fipstools/cavp_sha_monte_test.cc",
205 "src/fipstools/cavp_sha_test.cc",
206 "src/fipstools/cavp_tdes_test.cc",
207 "src/fipstools/cavp_test_util.cc",
208 "src/fipstools/cavp_tlskdf_test.cc",
209 ],
210
211 shared_libs: [
212 "libcrypto",
213 ],
214
215 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
216}
217
Dan Willemsen2458a412016-07-15 09:28:31 -0700218// Test support library
219cc_library_static {
220 name: "boringssl_test_support",
221 host_supported: true,
222 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
223
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700224 shared_libs: [
225 "libcrypto",
226 "libssl",
227 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700228}
229
230// Tests
231cc_test {
David Benjaminf31229b2017-01-25 14:08:15 -0500232 name: "boringssl_crypto_test",
Dan Shi9397df82017-03-29 23:23:34 -0700233 test_suites: ["device-tests"],
David Benjaminf31229b2017-01-25 14:08:15 -0500234 host_supported: true,
235 defaults: ["boringssl_crypto_test_sources", "boringssl_flags"],
236 whole_static_libs: ["boringssl_test_support"],
237
David Benjaminf31229b2017-01-25 14:08:15 -0500238 shared_libs: ["libcrypto"],
239}
240
241cc_test {
242 name: "boringssl_ssl_test",
Dan Shi9397df82017-03-29 23:23:34 -0700243 test_suites: ["device-tests"],
David Benjaminf31229b2017-01-25 14:08:15 -0500244 host_supported: true,
245 defaults: ["boringssl_ssl_test_sources", "boringssl_flags"],
246 whole_static_libs: ["boringssl_test_support"],
247
David Benjaminf31229b2017-01-25 14:08:15 -0500248 shared_libs: ["libcrypto", "libssl"],
249}