blob: fc45c432756a8c1eddb389067bba2497dba6b82a [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 },
Dan Willemsen21986fb2016-07-14 15:23:56 -070094 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -070095 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070096}
97
Kenny Root30c14792016-07-21 14:33:54 -070098// Target and host library: files that don't compile with clang. This should
99// go away when clang can compile everything with integrated assembler.
100cc_library_static {
101 name: "libcrypto_no_clang",
102 defaults: ["boringssl_defaults", "boringssl_flags"],
103 host_supported: true,
104
105 target: {
106 windows: {
107 enabled: true,
108 },
109 },
110
111 local_include_dirs: ["src/crypto"],
112
113 arch: {
114 arm: {
115 clang_asflags: ["-no-integrated-as"],
116 srcs: libcrypto_sources_no_clang,
117 },
118 },
119}
120
Dan Willemsen21986fb2016-07-14 15:23:56 -0700121// Static library
122// This should only be used for host modules that will be in a JVM, all other
123// modules should use the static variant of libcrypto.
124cc_library_static {
125 name: "libcrypto_static",
126 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
127
128 target: {
129 host: {
David Benjaminc0dedc02017-01-24 17:54:24 -0500130 // TODO: b/26160319. ASAN breaks use of this library in JVM.
Dan Willemsen21986fb2016-07-14 15:23:56 -0700131 // Re-enable sanitization when the issue with making clients of this library
132 // preload ASAN runtime is resolved. Without that, clients are getting runtime
David Benjaminc0dedc02017-01-24 17:54:24 -0500133 // errors due to unresolved ASAN symbols, such as
Dan Willemsen21986fb2016-07-14 15:23:56 -0700134 // __asan_option_detect_stack_use_after_return.
135 sanitize: {
136 never: true,
137 },
138 },
139 },
140}
141
Dan Willemsen21986fb2016-07-14 15:23:56 -0700142//// libssl
143
144// Target static library
145// Deprecated: all users should move to libssl
146cc_library_static {
147 name: "libssl_static",
148 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
149}
150
151// Static and Shared library
152cc_library {
153 name: "libssl",
Justin Yun47949c52017-07-24 15:19:43 +0900154 vendor_available: true,
155 vndk: {
156 enabled: true,
157 },
Dan Willemsen21986fb2016-07-14 15:23:56 -0700158 host_supported: true,
159 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700160 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -0700161
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700162 shared_libs: ["libcrypto"],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700163}
164
Dan Willemsen21986fb2016-07-14 15:23:56 -0700165// Tool
166cc_binary {
167 name: "bssl",
168 host_supported: true,
169 defaults: ["bssl_sources", "boringssl_flags"],
170
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700171 shared_libs: [
172 "libcrypto",
173 "libssl",
174 ],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700175 target: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700176 darwin: {
177 enabled: false,
178 },
179 },
180}
Dan Willemsen2458a412016-07-15 09:28:31 -0700181
Adam Langley7c167932018-02-02 14:44:53 -0800182cc_binary {
183 name: "cavp",
184 host_supported: true,
185 srcs: [
186 "src/fipstools/cavp_aes_gcm_test.cc",
187 "src/fipstools/cavp_aes_test.cc",
188 "src/fipstools/cavp_ctr_drbg_test.cc",
189 "src/fipstools/cavp_ecdsa2_keypair_test.cc",
190 "src/fipstools/cavp_ecdsa2_pkv_test.cc",
191 "src/fipstools/cavp_ecdsa2_siggen_test.cc",
192 "src/fipstools/cavp_ecdsa2_sigver_test.cc",
193 "src/fipstools/cavp_hmac_test.cc",
194 "src/fipstools/cavp_kas_test.cc",
195 "src/fipstools/cavp_keywrap_test.cc",
196 "src/fipstools/cavp_main.cc",
197 "src/fipstools/cavp_rsa2_keygen_test.cc",
198 "src/fipstools/cavp_rsa2_siggen_test.cc",
199 "src/fipstools/cavp_rsa2_sigver_test.cc",
200 "src/fipstools/cavp_sha_monte_test.cc",
201 "src/fipstools/cavp_sha_test.cc",
202 "src/fipstools/cavp_tdes_test.cc",
203 "src/fipstools/cavp_test_util.cc",
204 "src/fipstools/cavp_tlskdf_test.cc",
205 ],
206
207 shared_libs: [
208 "libcrypto",
209 ],
210
211 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
212}
213
Dan Willemsen2458a412016-07-15 09:28:31 -0700214// Test support library
215cc_library_static {
216 name: "boringssl_test_support",
217 host_supported: true,
218 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
219
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700220 shared_libs: [
221 "libcrypto",
222 "libssl",
223 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700224}
225
226// Tests
227cc_test {
David Benjaminf31229b2017-01-25 14:08:15 -0500228 name: "boringssl_crypto_test",
Dan Shi9397df82017-03-29 23:23:34 -0700229 test_suites: ["device-tests"],
David Benjaminf31229b2017-01-25 14:08:15 -0500230 host_supported: true,
231 defaults: ["boringssl_crypto_test_sources", "boringssl_flags"],
232 whole_static_libs: ["boringssl_test_support"],
233
234 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
235 shared_libs: ["libcrypto"],
236}
237
238cc_test {
239 name: "boringssl_ssl_test",
Dan Shi9397df82017-03-29 23:23:34 -0700240 test_suites: ["device-tests"],
David Benjaminf31229b2017-01-25 14:08:15 -0500241 host_supported: true,
242 defaults: ["boringssl_ssl_test_sources", "boringssl_flags"],
243 whole_static_libs: ["boringssl_test_support"],
244
245 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
246 shared_libs: ["libcrypto", "libssl"],
247}