blob: 1ca701172370dcffda15b49da4e8eb59285949c7 [file] [log] [blame]
David Sehr67bf42e2018-02-26 16:43:04 -08001//
2// Copyright (C) 2011 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
David Sehrc431b9d2018-03-02 12:01:51 -080017cc_defaults {
18 name: "libartbase_defaults",
19 defaults: ["art_defaults"],
20 host_supported: true,
21 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -070022 "arch/instruction_set.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080023 "base/allocator.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070024 "base/arena_allocator.cc",
25 "base/arena_bit_vector.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080026 "base/bit_vector.cc",
Andreas Gampe8764dc32019-01-07 15:20:12 -080027 "base/enums.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080028 "base/file_magic.cc",
David Sehrc3e18952018-05-11 16:59:31 -070029 "base/file_utils.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080030 "base/hex_dump.cc",
David Brazdildcfa89b2018-10-31 11:04:10 +000031 "base/hiddenapi_flags.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080032 "base/logging.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070033 "base/malloc_arena_pool.cc",
Orion Hodson563ada22018-09-04 11:28:31 +010034 "base/membarrier.cc",
35 "base/memfd.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070036 "base/memory_region.cc",
David Sehr79e26072018-04-06 17:58:50 -070037 "base/mem_map.cc",
Steve Austin882ed6b2018-06-08 11:40:38 -070038 // "base/mem_map_fuchsia.cc", put in target when fuchsia supported by soong
David Sehrc431b9d2018-03-02 12:01:51 -080039 "base/os_linux.cc",
40 "base/runtime_debug.cc",
41 "base/safe_copy.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -070042 "base/scoped_arena_allocator.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080043 "base/scoped_flock.cc",
Elliott Hughesc2efd4d2018-10-25 13:14:55 -070044 "base/socket_peer_is_trusted.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080045 "base/time_utils.cc",
46 "base/unix_file/fd_file.cc",
47 "base/unix_file/random_access_file_utils.cc",
48 "base/utils.cc",
David Sehr79e26072018-04-06 17:58:50 -070049 "base/zip_archive.cc",
David Sehrc431b9d2018-03-02 12:01:51 -080050 ],
David Sehr79e26072018-04-06 17:58:50 -070051 target: {
52 android: {
David Sehr10db8fe2018-07-18 11:01:20 -070053 srcs: [
54 "base/mem_map_unix.cc",
55 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000056 static_libs: [
57 // ZipArchive support, the order matters here to get all symbols.
58 "libziparchive",
59 "libz",
60 ],
David Sehr10db8fe2018-07-18 11:01:20 -070061 shared_libs: [
62 "liblog",
63 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000064 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070065 // For common macros.
66 "libbase",
67 ],
David Sehr9d9227a2018-12-19 12:32:50 -080068 export_shared_lib_headers: ["libbase"],
Martin Stjernholm43551622018-11-09 15:14:54 +000069 // Exclude the version script from Darwin host since it's not
70 // supported by the linker there. That means ASan checks on Darwin
71 // might trigger ODR violations.
72 version_script: "libartbase.map",
David Sehr79e26072018-04-06 17:58:50 -070073 },
David Sehr10db8fe2018-07-18 11:01:20 -070074 not_windows: {
75 srcs: [
76 "base/mem_map_unix.cc",
77 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +000078 shared_libs: [
79 "libziparchive",
80 "libz",
David Sehr10db8fe2018-07-18 11:01:20 -070081 "liblog",
82 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +000083 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -070084 // For common macros.
85 "libbase",
David Sehr79e26072018-04-06 17:58:50 -070086 ],
David Sehr9d9227a2018-12-19 12:32:50 -080087 export_shared_lib_headers: ["libbase"],
David Sehr79e26072018-04-06 17:58:50 -070088 },
Martin Stjernholm43551622018-11-09 15:14:54 +000089 linux_glibc: {
90 version_script: "libartbase.map",
91 },
92 windows: {
93 version_script: "libartbase.map",
David Sehr9d9227a2018-12-19 12:32:50 -080094 srcs: [
95 "base/mem_map_windows.cc",
96 ],
David Sehr10db8fe2018-07-18 11:01:20 -070097 static_libs: [
98 "libziparchive",
99 "libz",
100 "liblog",
101 // For ashmem.
Orion Hodson119733d2019-01-30 15:14:41 +0000102 "libartpalette",
David Sehr10db8fe2018-07-18 11:01:20 -0700103 // For common macros.
104 "libbase",
105 ],
David Sehr9d9227a2018-12-19 12:32:50 -0800106 export_static_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700107 cflags: ["-Wno-thread-safety"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000108 },
David Sehr79e26072018-04-06 17:58:50 -0700109 },
David Sehrc431b9d2018-03-02 12:01:51 -0800110 generated_sources: ["art_libartbase_operator_srcs"],
111 cflags: ["-DBUILDING_LIBART=1"],
Martin Stjernholm43551622018-11-09 15:14:54 +0000112
113 // Utilities used by various ART libs and tools are linked in statically
114 // here to avoid shared lib dependencies outside the ART APEX. No target
115 // there should depend on these separately.
116 whole_static_libs: [
117 "liblz4",
118 "liblzma",
119 ],
120
David Sehrc431b9d2018-03-02 12:01:51 -0800121 export_include_dirs: ["."],
122 // ART's macros.h depends on libbase's macros.h.
123 // Note: runtime_options.h depends on cmdline. But we don't really want to export this
124 // generically. dex2oat takes care of it itself.
David Sehrc431b9d2018-03-02 12:01:51 -0800125}
126
Andreas Gampeec5ed062018-01-26 16:20:02 -0800127cc_defaults {
128 name: "libartbase_static_base_defaults",
129 static_libs: [
130 "libbase",
Orion Hodson119733d2019-01-30 15:14:41 +0000131 "libartpalette",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800132 "liblog",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000133 "libz",
134 "libziparchive",
Andreas Gampeec5ed062018-01-26 16:20:02 -0800135 ],
136}
137
138cc_defaults {
139 name: "libartbase_static_defaults",
140 defaults: ["libartbase_static_base_defaults"],
141 static_libs: ["libartbase"],
142}
143
144cc_defaults {
145 name: "libartbased_static_defaults",
146 defaults: ["libartbase_static_base_defaults"],
147 static_libs: ["libartbased"],
148}
149
David Sehrc431b9d2018-03-02 12:01:51 -0800150gensrcs {
151 name: "art_libartbase_operator_srcs",
152 cmd: "$(location generate_operator_out) art/libartbase $(in) > $(out)",
153 tools: ["generate_operator_out"],
154 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700155 "arch/instruction_set.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800156 "base/allocator.h",
David Sehrc431b9d2018-03-02 12:01:51 -0800157 "base/unix_file/fd_file.h",
158 ],
159 output_extension: "operator_out.cc",
160}
161
162art_cc_library {
163 name: "libartbase",
164 defaults: ["libartbase_defaults"],
165 // Leave the symbols in the shared library so that stack unwinders can
166 // produce meaningful name resolution.
167 strip: {
168 keep_symbols: true,
169 },
David Sehr79e26072018-04-06 17:58:50 -0700170 shared_libs: [
171 "libbase",
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000172 "libziparchive",
David Sehr79e26072018-04-06 17:58:50 -0700173 ],
David Sehrc431b9d2018-03-02 12:01:51 -0800174 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700175 target: {
176 windows: {
177 enabled: true,
178 shared: {
179 enabled: false,
180 },
181 },
182 },
David Sehrc431b9d2018-03-02 12:01:51 -0800183}
184
185art_cc_library {
186 name: "libartbased",
187 defaults: [
188 "art_debug_defaults",
189 "libartbase_defaults",
190 ],
Nicolas Geoffray65ed42a2018-10-30 12:33:04 +0000191 shared_libs: [
192 "libbase",
193 "libziparchive",
194 ],
195 export_shared_lib_headers: ["libbase"],
David Sehr10db8fe2018-07-18 11:01:20 -0700196 target: {
197 windows: {
198 enabled: true,
199 shared: {
200 enabled: false,
201 },
202 },
203 },
David Sehrc431b9d2018-03-02 12:01:51 -0800204}
205
David Sehrd5f8de82018-04-27 14:12:03 -0700206art_cc_library {
207 name: "libartbase-art-gtest",
208 defaults: ["libart-gtest-defaults"],
209 srcs: [
210 "base/common_art_test.cc",
211 ],
212 shared_libs: [
213 "libartbased",
214 "libdexfiled",
215 "libbase",
216 "libbacktrace",
217 ],
218 header_libs: [
219 "libnativehelper_header_only",
220 ],
David Sehrd5f8de82018-04-27 14:12:03 -0700221}
222
David Sehr67bf42e2018-02-26 16:43:04 -0800223art_cc_test {
224 name: "art_libartbase_tests",
225 defaults: [
226 "art_gtest_defaults",
227 ],
228 srcs: [
David Sehrc3e18952018-05-11 16:59:31 -0700229 "arch/instruction_set_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700230 "base/arena_allocator_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800231 "base/bit_field_test.cc",
David Srbecky68fefac2018-05-10 17:49:33 +0100232 "base/bit_memory_region_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800233 "base/bit_string_test.cc",
234 "base/bit_struct_test.cc",
David Srbecky052f8ca2018-04-26 15:42:54 +0100235 "base/bit_table_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800236 "base/bit_utils_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800237 "base/bit_vector_test.cc",
David Sehrc3e18952018-05-11 16:59:31 -0700238 "base/file_utils_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800239 "base/hash_set_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800240 "base/hex_dump_test.cc",
241 "base/histogram_test.cc",
David Sehr9c4a0152018-04-05 12:23:54 -0700242 "base/indenter_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800243 "base/leb128_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800244 "base/logging_test.cc",
Orion Hodson563ada22018-09-04 11:28:31 +0100245 "base/memfd_test.cc",
246 "base/membarrier_test.cc",
David Sehr1ce2b3b2018-04-05 11:02:03 -0700247 "base/memory_region_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700248 "base/mem_map_test.cc",
David Sehrc431b9d2018-03-02 12:01:51 -0800249 "base/safe_copy_test.cc",
250 "base/scoped_flock_test.cc",
251 "base/time_utils_test.cc",
252 "base/transform_array_ref_test.cc",
253 "base/transform_iterator_test.cc",
254 "base/unix_file/fd_file_test.cc",
255 "base/utils_test.cc",
256 "base/variant_map_test.cc",
David Sehr79e26072018-04-06 17:58:50 -0700257 "base/zip_archive_test.cc",
David Sehr67bf42e2018-02-26 16:43:04 -0800258 ],
259 shared_libs: [
260 "libbase",
261 ],
262}
263
264cc_library_headers {
265 name: "art_libartbase_headers",
266 host_supported: true,
267 export_include_dirs: ["."],
268 shared_libs: ["libbase"],
269 export_shared_lib_headers: ["libbase"],
270}