blob: ab434843d47ba96b982b94e64660ee707e14332d [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
43cc_defaults {
44 name: "libcrypto_defaults",
45 host_supported: true,
46
47 // Windows and Macs both have problems with assembly files
48 target: {
49 windows: {
50 enabled: true,
51 cflags: ["-DOPENSSL_NO_ASM"],
52 host_ldlibs: ["-lws2_32"],
53 },
54 darwin: {
55 cflags: ["-DOPENSSL_NO_ASM"],
56 },
57 not_windows: {
58 host_ldlibs: ["-lpthread"],
59 },
60 },
61
62 local_include_dirs: ["src/crypto"],
63
64 // sha256-armv4.S does not compile with clang.
65 arch: {
66 arm: {
67 clang_asflags: ["-no-integrated-as"],
68 },
69 arm64: {
70 clang_asflags: ["-march=armv8-a+crypto"],
71 },
72 },
73}
74
75// Target and host library
76cc_library {
77 name: "libcrypto",
78 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -070079 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -070080}
81
82// Static library
83// This should only be used for host modules that will be in a JVM, all other
84// modules should use the static variant of libcrypto.
85cc_library_static {
86 name: "libcrypto_static",
87 defaults: ["libcrypto_sources", "libcrypto_defaults", "boringssl_defaults", "boringssl_flags"],
88
89 target: {
90 host: {
91 // TODO: b/26097626. ASAN breaks use of this library in JVM.
92 // Re-enable sanitization when the issue with making clients of this library
93 // preload ASAN runtime is resolved. Without that, clients are getting runtime
94 // errors due to unresoled ASAN symbols, such as
95 // __asan_option_detect_stack_use_after_return.
96 sanitize: {
97 never: true,
98 },
99 },
100 },
101}
102
Dan Willemsen21986fb2016-07-14 15:23:56 -0700103//// libssl
104
105// Target static library
106// Deprecated: all users should move to libssl
107cc_library_static {
108 name: "libssl_static",
109 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
110}
111
112// Static and Shared library
113cc_library {
114 name: "libssl",
115 host_supported: true,
116 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700117 unique_host_soname: true,
Dan Willemsen21986fb2016-07-14 15:23:56 -0700118
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700119 shared_libs: ["libcrypto"],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700120}
121
122// Host static library
123cc_library_host_static {
124 name: "libssl_static-host",
125 defaults: ["libssl_sources", "boringssl_defaults", "boringssl_flags"],
126
127 // TODO: b/26097626. ASAN breaks use of this library in JVM.
128 // Re-enable sanitization when the issue with making clients of this library
129 // preload ASAN runtime is resolved. Without that, clients are getting runtime
130 // errors due to unresoled ASAN symbols, such as
131 // __asan_option_detect_stack_use_after_return.
132 sanitize: {
133 never: true,
134 },
135}
136
Dan Willemsen21986fb2016-07-14 15:23:56 -0700137// Tool
138cc_binary {
139 name: "bssl",
140 host_supported: true,
141 defaults: ["bssl_sources", "boringssl_flags"],
142
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700143 shared_libs: [
144 "libcrypto",
145 "libssl",
146 ],
Dan Willemsen21986fb2016-07-14 15:23:56 -0700147 target: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700148 host: {
Dan Willemsen21986fb2016-07-14 15:23:56 -0700149 // Needed for clock_gettime.
150 host_ldlibs: ["-lrt"],
151 },
152 darwin: {
153 enabled: false,
154 },
155 },
156}
Dan Willemsen2458a412016-07-15 09:28:31 -0700157
158// Test support library
159cc_library_static {
160 name: "boringssl_test_support",
161 host_supported: true,
162 defaults: ["boringssl_test_support_sources", "boringssl_flags"],
163
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700164 shared_libs: [
165 "libcrypto",
166 "libssl",
167 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700168}
169
170// Tests
171cc_test {
172 name: "boringssl_tests",
173 host_supported: true,
174 test_per_src: true,
175 defaults: ["boringssl_tests_sources", "boringssl_flags"],
176 whole_static_libs: ["boringssl_test_support"],
177
Dan Willemsen2b2c24b2016-07-21 11:03:36 -0700178 shared_libs: [
179 "libcrypto",
180 "libssl",
181 ],
Dan Willemsen2458a412016-07-15 09:28:31 -0700182}