blob: 98b2eee7887ecfd3b60e39a59e4ee2b5eece669e [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",
11
12 cflags: [
13 "-fvisibility=hidden",
14 "-DBORINGSSL_SHARED_LIBRARY",
15 "-DBORINGSSL_IMPLEMENTATION",
16 "-DOPENSSL_SMALL",
17 "-D_XOPEN_SOURCE=700",
18 "-Wno-unused-parameter",
19 ],
20
21 cppflags: [
22 "-Wall",
23 "-Werror",
24 ],
25
26 conlyflags: ["-std=c99"],
27}
28
29// Used by libcrypto + libssl
30cc_defaults {
31 name: "boringssl_defaults",
32
33 local_include_dirs: ["src/include"],
34 export_include_dirs: ["src/include"],
35 stl: "none",
36 sdk_version: "9",
37
38 cflags: ["-DBORINGSSL_ANDROID_SYSTEM"],
39}
40
41//// libcrypto
42
Kenny Root30c14792016-07-21 14:33:54 -070043// This should be removed when clang can compile everything.
44libcrypto_sources_no_clang = [
45 "linux-arm/crypto/aes/aes-armv4.S",
46 "linux-arm/crypto/aes/bsaes-armv7.S",
47 "linux-arm/crypto/sha/sha256-armv4.S",
48]
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 },
64 not_windows: {
65 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",
85 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -070086 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070087}
88
Kenny Root30c14792016-07-21 14:33:54 -070089// Target and host library: files that don't compile with clang. This should
90// go away when clang can compile everything with integrated assembler.
91cc_library_static {
92 name: "libcrypto_no_clang",
93 defaults: ["boringssl_defaults", "boringssl_flags"],
94 host_supported: true,
95
96 target: {
97 windows: {
98 enabled: true,
99 },
100 },
101
102 local_include_dirs: ["src/crypto"],
103
104 arch: {
105 arm: {
106 clang_asflags: ["-no-integrated-as"],
107 srcs: libcrypto_sources_no_clang,
108 },
109 },
110}
111
Dan Willemsen21986fb2016-07-14 15:23:56 -0700112// Static library
113// This should only be used for host modules that will be in a JVM, all other
114// modules should use the static variant of libcrypto.
115cc_library_static {
116 name: "libcrypto_static",
117 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
118
119 target: {
120 host: {
121 // TODO: b/26097626. ASAN breaks use of this library in JVM.
122 // Re-enable sanitization when the issue with making clients of this library
123 // preload ASAN runtime is resolved. Without that, clients are getting runtime
124 // errors due to unresoled ASAN symbols, such as
125 // __asan_option_detect_stack_use_after_return.
126 sanitize: {
127 never: true,
128 },
129 },
130 },
131}
132
Dan Willemsen21986fb2016-07-14 15:23:56 -0700133//// libssl
134
135// Target static library
136// Deprecated: all users should move to libssl
137cc_library_static {
138 name: "libssl_static",
139 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
140}
141
142// Static and Shared library
143cc_library {
144 name: "libssl",
145 host_supported: true,
146 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700147 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -0700148
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700149 shared_libs: ["libcrypto"],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700150}
151
152// Host static library
153cc_library_host_static {
154 name: "libssl_static-host",
155 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
156
157 // TODO: b/26097626. ASAN breaks use of this library in JVM.
158 // Re-enable sanitization when the issue with making clients of this library
159 // preload ASAN runtime is resolved. Without that, clients are getting runtime
160 // errors due to unresoled ASAN symbols, such as
161 // __asan_option_detect_stack_use_after_return.
162 sanitize: {
163 never: true,
164 },
165}
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 host: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700179 // Needed for clock_gettime.
180 host_ldlibs: ["-lrt"],
181 },
182 darwin: {
183 enabled: false,
184 },
185 },
186}
Dan Willemsen2458a412016-07-15 09:28:31 -0700187
188// Test support library
189cc_library_static {
190 name: "boringssl_test_support",
191 host_supported: true,
192 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
193
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700194 shared_libs: [
195 "libcrypto",
196 "libssl",
197 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700198}
199
200// Tests
201cc_test {
202 name: "boringssl_tests",
203 host_supported: true,
204 test_per_src: true,
205 defaults: ["boringssl_tests_sources", "boringssl_flags"],
206 whole_static_libs: ["boringssl_test_support"],
207
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700208 shared_libs: [
209 "libcrypto",
210 "libssl",
211 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700212}