blob: 2ea5585f29834b15f71f97f0f48dc90a0bef42d4 [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",
16 "-DBORINGSSL_IMPLEMENTATION",
17 "-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"],
29}
30
31// Used by libcrypto + libssl
32cc_defaults {
33 name: "boringssl_defaults",
34
35 local_include_dirs: ["src/include"],
36 export_include_dirs: ["src/include"],
Dan Willemsen21986fb2016-07-14 15:23:56 -070037 sdk_version: "9",
Colin Crosscaa34162017-08-11 22:36:38 -070038 target: {
39 android: {
40 stl: "libc++_static",
41 },
42 },
Dan Willemsen21986fb2016-07-14 15:23:56 -070043
44 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
45}
46
47//// libcrypto
48
Kenny Root30c14792016-07-21 14:33:54 -070049// This should be removed when clang can compile everything.
50libcrypto_sources_no_clang = [
Robert Sloan572a4e22017-04-17 10:52:19 -070051 "linux-arm/crypto/fipsmodule/aes-armv4.S",
52 "linux-arm/crypto/fipsmodule/bsaes-armv7.S",
Kenny Root30c14792016-07-21 14:33:54 -070053]
54
Dan Willemsen21986fb2016-07-14 15:23:56 -070055cc_defaults {
56 name: "libcrypto_defaults",
57 host_supported: true,
58
59 // Windows and Macs both have problems with assembly files
60 target: {
61 windows: {
62 enabled: true,
63 cflags: ["-DOPENSSL_NO_ASM"],
64 host_ldlibs: ["-lws2_32"],
65 },
66 darwin: {
67 cflags: ["-DOPENSSL_NO_ASM"],
68 },
Kenny Root7b550be2016-09-20 15:25:24 -070069 host: {
Dan Willemsen21986fb2016-07-14 15:23:56 -070070 host_ldlibs: ["-lpthread"],
71 },
72 },
73
74 local_include_dirs: ["src/crypto"],
75
Dan Willemsen21986fb2016-07-14 15:23:56 -070076 arch: {
Dan Willemsen21986fb2016-07-14 15:23:56 -070077 arm64: {
78 clang_asflags: ["-march=armv8-a+crypto"],
79 },
80 },
Kenny Root30c14792016-07-21 14:33:54 -070081
82 // This should be removed when clang can compile everything.
83 exclude_srcs: libcrypto_sources_no_clang,
84 whole_static_libs: ["libcrypto_no_clang"],
Dan Willemsen21986fb2016-07-14 15:23:56 -070085}
86
87// Target and host library
88cc_library {
89 name: "libcrypto",
Vijay Venkatraman3caad952017-05-16 12:00:57 -070090 vendor_available: true,
Justin Yun47949c52017-07-24 15:19:43 +090091 vndk: {
92 enabled: true,
93 },
Jiyong Parkc3463952018-04-27 21:44:32 +090094 recovery_available: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070095 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -070096 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070097}
98
Kenny Root30c14792016-07-21 14:33:54 -070099// Target and host library: files that don't compile with clang. This should
100// go away when clang can compile everything with integrated assembler.
101cc_library_static {
102 name: "libcrypto_no_clang",
103 defaults: ["boringssl_defaults", "boringssl_flags"],
104 host_supported: true,
Jiyong Parkc3463952018-04-27 21:44:32 +0900105 recovery_available: true,
Kenny Root30c14792016-07-21 14:33:54 -0700106
107 target: {
108 windows: {
109 enabled: true,
110 },
111 },
112
113 local_include_dirs: ["src/crypto"],
114
115 arch: {
116 arm: {
117 clang_asflags: ["-no-integrated-as"],
118 srcs: libcrypto_sources_no_clang,
119 },
120 },
121}
122
Dan Willemsen21986fb2016-07-14 15:23:56 -0700123// Static library
124// This should only be used for host modules that will be in a JVM, all other
125// modules should use the static variant of libcrypto.
126cc_library_static {
127 name: "libcrypto_static",
128 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
129
130 target: {
131 host: {
David Benjaminc0dedc02017-01-24 17:54:24 -0500132 // TODO: b/26160319. ASAN breaks use of this library in JVM.
Dan Willemsen21986fb2016-07-14 15:23:56 -0700133 // Re-enable sanitization when the issue with making clients of this library
134 // preload ASAN runtime is resolved. Without that, clients are getting runtime
David Benjaminc0dedc02017-01-24 17:54:24 -0500135 // errors due to unresolved ASAN symbols, such as
Dan Willemsen21986fb2016-07-14 15:23:56 -0700136 // __asan_option_detect_stack_use_after_return.
137 sanitize: {
138 never: true,
139 },
140 },
141 },
142}
143
Dan Willemsen21986fb2016-07-14 15:23:56 -0700144//// libssl
145
146// Target static library
147// Deprecated: all users should move to libssl
148cc_library_static {
149 name: "libssl_static",
150 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
151}
152
153// Static and Shared library
154cc_library {
155 name: "libssl",
Justin Yun47949c52017-07-24 15:19:43 +0900156 vendor_available: true,
157 vndk: {
158 enabled: true,
159 },
Dan Willemsen21986fb2016-07-14 15:23:56 -0700160 host_supported: true,
161 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700162 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -0700163
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700164 shared_libs: ["libcrypto"],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700165}
166
Dan Willemsen21986fb2016-07-14 15:23:56 -0700167// Tool
168cc_binary {
169 name: "bssl",
170 host_supported: true,
171 defaults: ["bssl_sources", "boringssl_flags"],
172
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700173 shared_libs: [
174 "libcrypto",
175 "libssl",
176 ],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700177 target: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700178 darwin: {
179 enabled: false,
180 },
181 },
182}
Dan Willemsen2458a412016-07-15 09:28:31 -0700183
Adam Langley7c167932018-02-02 14:44:53 -0800184cc_binary {
185 name: "cavp",
186 host_supported: true,
187 srcs: [
188 "src/fipstools/cavp_aes_gcm_test.cc",
189 "src/fipstools/cavp_aes_test.cc",
190 "src/fipstools/cavp_ctr_drbg_test.cc",
191 "src/fipstools/cavp_ecdsa2_keypair_test.cc",
192 "src/fipstools/cavp_ecdsa2_pkv_test.cc",
193 "src/fipstools/cavp_ecdsa2_siggen_test.cc",
194 "src/fipstools/cavp_ecdsa2_sigver_test.cc",
195 "src/fipstools/cavp_hmac_test.cc",
196 "src/fipstools/cavp_kas_test.cc",
197 "src/fipstools/cavp_keywrap_test.cc",
198 "src/fipstools/cavp_main.cc",
199 "src/fipstools/cavp_rsa2_keygen_test.cc",
200 "src/fipstools/cavp_rsa2_siggen_test.cc",
201 "src/fipstools/cavp_rsa2_sigver_test.cc",
202 "src/fipstools/cavp_sha_monte_test.cc",
203 "src/fipstools/cavp_sha_test.cc",
204 "src/fipstools/cavp_tdes_test.cc",
205 "src/fipstools/cavp_test_util.cc",
206 "src/fipstools/cavp_tlskdf_test.cc",
207 ],
208
209 shared_libs: [
210 "libcrypto",
211 ],
212
213 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
214}
215
Dan Willemsen2458a412016-07-15 09:28:31 -0700216// Test support library
217cc_library_static {
218 name: "boringssl_test_support",
219 host_supported: true,
220 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
221
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700222 shared_libs: [
223 "libcrypto",
224 "libssl",
225 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700226}
227
228// Tests
229cc_test {
David Benjaminf31229b2017-01-25 14:08:15 -0500230 name: "boringssl_crypto_test",
Dan Shi9397df82017-03-29 23:23:34 -0700231 test_suites: ["device-tests"],
David Benjaminf31229b2017-01-25 14:08:15 -0500232 host_supported: true,
233 defaults: ["boringssl_crypto_test_sources", "boringssl_flags"],
234 whole_static_libs: ["boringssl_test_support"],
235
236 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
237 shared_libs: ["libcrypto"],
238}
239
240cc_test {
241 name: "boringssl_ssl_test",
Dan Shi9397df82017-03-29 23:23:34 -0700242 test_suites: ["device-tests"],
David Benjaminf31229b2017-01-25 14:08:15 -0500243 host_supported: true,
244 defaults: ["boringssl_ssl_test_sources", "boringssl_flags"],
245 whole_static_libs: ["boringssl_test_support"],
246
247 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
248 shared_libs: ["libcrypto", "libssl"],
249}