blob: b851b0acba5fa1e02d8dfb2de5711f5957390438 [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",
19 "-Wno-unused-parameter",
20 ],
21
22 cppflags: [
23 "-Wall",
24 "-Werror",
25 ],
26
27 conlyflags: ["-std=c99"],
28}
29
30// Used by libcrypto + libssl
31cc_defaults {
32 name: "boringssl_defaults",
33
34 local_include_dirs: ["src/include"],
35 export_include_dirs: ["src/include"],
David Benjaminf31229b2017-01-25 14:08:15 -050036 stl: "libc++_static",
Dan Willemsen21986fb2016-07-14 15:23:56 -070037 sdk_version: "9",
38
39 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
40}
41
42//// libcrypto
43
Kenny Root30c14792016-07-21 14:33:54 -070044// This should be removed when clang can compile everything.
45libcrypto_sources_no_clang = [
46 "linux-arm/crypto/aes/aes-armv4.S",
47 "linux-arm/crypto/aes/bsaes-armv7.S",
Kenny Root30c14792016-07-21 14:33:54 -070048]
49
Dan Willemsen21986fb2016-07-14 15:23:56 -070050cc_defaults {
51 name: "libcrypto_defaults",
52 host_supported: true,
53
54 // Windows and Macs both have problems with assembly files
55 target: {
56 windows: {
57 enabled: true,
58 cflags: ["-DOPENSSL_NO_ASM"],
59 host_ldlibs: ["-lws2_32"],
60 },
61 darwin: {
62 cflags: ["-DOPENSSL_NO_ASM"],
63 },
Kenny Root7b550be2016-09-20 15:25:24 -070064 host: {
Dan Willemsen21986fb2016-07-14 15:23:56 -070065 host_ldlibs: ["-lpthread"],
66 },
67 },
68
69 local_include_dirs: ["src/crypto"],
70
Dan Willemsen21986fb2016-07-14 15:23:56 -070071 arch: {
Dan Willemsen21986fb2016-07-14 15:23:56 -070072 arm64: {
73 clang_asflags: ["-march=armv8-a+crypto"],
74 },
75 },
Kenny Root30c14792016-07-21 14:33:54 -070076
77 // This should be removed when clang can compile everything.
78 exclude_srcs: libcrypto_sources_no_clang,
79 whole_static_libs: ["libcrypto_no_clang"],
Dan Willemsen21986fb2016-07-14 15:23:56 -070080}
81
82// Target and host library
83cc_library {
84 name: "libcrypto",
Vijay Venkatraman3caad952017-05-16 12:00:57 -070085 vendor_available: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070086 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -070087 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070088}
89
Kenny Root30c14792016-07-21 14:33:54 -070090// Target and host library: files that don't compile with clang. This should
91// go away when clang can compile everything with integrated assembler.
92cc_library_static {
93 name: "libcrypto_no_clang",
94 defaults: ["boringssl_defaults", "boringssl_flags"],
95 host_supported: true,
96
97 target: {
98 windows: {
99 enabled: true,
100 },
101 },
102
103 local_include_dirs: ["src/crypto"],
104
105 arch: {
106 arm: {
107 clang_asflags: ["-no-integrated-as"],
108 srcs: libcrypto_sources_no_clang,
109 },
110 },
111}
112
Dan Willemsen21986fb2016-07-14 15:23:56 -0700113// Static library
114// This should only be used for host modules that will be in a JVM, all other
115// modules should use the static variant of libcrypto.
116cc_library_static {
117 name: "libcrypto_static",
118 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
119
120 target: {
121 host: {
David Benjaminc0dedc02017-01-24 17:54:24 -0500122 // TODO: b/26160319. ASAN breaks use of this library in JVM.
Dan Willemsen21986fb2016-07-14 15:23:56 -0700123 // Re-enable sanitization when the issue with making clients of this library
124 // preload ASAN runtime is resolved. Without that, clients are getting runtime
David Benjaminc0dedc02017-01-24 17:54:24 -0500125 // errors due to unresolved ASAN symbols, such as
Dan Willemsen21986fb2016-07-14 15:23:56 -0700126 // __asan_option_detect_stack_use_after_return.
127 sanitize: {
128 never: true,
129 },
130 },
131 },
132}
133
Dan Willemsen21986fb2016-07-14 15:23:56 -0700134//// libssl
135
136// Target static library
137// Deprecated: all users should move to libssl
138cc_library_static {
139 name: "libssl_static",
140 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
141}
142
143// Static and Shared library
144cc_library {
145 name: "libssl",
146 host_supported: true,
147 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700148 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -0700149
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700150 shared_libs: ["libcrypto"],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700151}
152
153// Host static library
154cc_library_host_static {
155 name: "libssl_static-host",
156 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
157
David Benjaminc0dedc02017-01-24 17:54:24 -0500158 // TODO: b/26160319. ASAN breaks use of this library in JVM.
Dan Willemsen21986fb2016-07-14 15:23:56 -0700159 // Re-enable sanitization when the issue with making clients of this library
160 // preload ASAN runtime is resolved. Without that, clients are getting runtime
David Benjaminc0dedc02017-01-24 17:54:24 -0500161 // errors due to unresolved ASAN symbols, such as
Dan Willemsen21986fb2016-07-14 15:23:56 -0700162 // __asan_option_detect_stack_use_after_return.
163 sanitize: {
164 never: true,
165 },
166}
167
Dan Willemsen21986fb2016-07-14 15:23:56 -0700168// Tool
169cc_binary {
170 name: "bssl",
171 host_supported: true,
172 defaults: ["bssl_sources", "boringssl_flags"],
173
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700174 shared_libs: [
175 "libcrypto",
176 "libssl",
177 ],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700178 target: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700179 host: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700180 // Needed for clock_gettime.
181 host_ldlibs: ["-lrt"],
182 },
183 darwin: {
184 enabled: false,
185 },
186 },
187}
Dan Willemsen2458a412016-07-15 09:28:31 -0700188
189// Test support library
190cc_library_static {
191 name: "boringssl_test_support",
192 host_supported: true,
193 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
194
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700195 shared_libs: [
196 "libcrypto",
197 "libssl",
198 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700199}
200
201// Tests
202cc_test {
203 name: "boringssl_tests",
204 host_supported: true,
205 test_per_src: true,
206 defaults: ["boringssl_tests_sources", "boringssl_flags"],
207 whole_static_libs: ["boringssl_test_support"],
208
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700209 shared_libs: [
210 "libcrypto",
211 "libssl",
212 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700213}
David Benjaminf31229b2017-01-25 14:08:15 -0500214
215cc_test {
216 name: "boringssl_crypto_test",
217 host_supported: true,
218 defaults: ["boringssl_crypto_test_sources", "boringssl_flags"],
219 whole_static_libs: ["boringssl_test_support"],
220
221 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
222 shared_libs: ["libcrypto"],
223}
224
225cc_test {
226 name: "boringssl_ssl_test",
227 host_supported: true,
228 defaults: ["boringssl_ssl_test_sources", "boringssl_flags"],
229 whole_static_libs: ["boringssl_test_support"],
230
231 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
232 shared_libs: ["libcrypto", "libssl"],
233}