blob: 3a7e5748e65d8c1723ce85f8ffdf671d71332295 [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001// Define the common source files for all the libc instances
2// =========================================================
3libc_common_src_files = [
Christopher Ferris7a3681e2017-04-24 17:48:32 -07004 "async_safe/async_safe_log.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07005 "bionic/ether_aton.c",
6 "bionic/ether_ntoa.c",
7 "bionic/fts.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07008 "bionic/initgroups.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07009 "bionic/isatty.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070010 "bionic/pututline.c",
11 "bionic/sched_cpualloc.c",
12 "bionic/sched_cpucount.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070013 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070014 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070015 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080016 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070017 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080018 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070019 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070021]
22
23// Various kinds of cruft.
24// ========================================================
25libc_common_src_files += [
26 "bionic/ndk_cruft.cpp",
Elliott Hughes1c8a2a92019-09-27 14:42:39 -070027 "bionic/ndk_cruft_data.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070028]
29
30libc_common_src_files_32 = [
31 "bionic/legacy_32_bit_support.cpp",
32 "bionic/time64.c",
33]
34
Elliott Hughes53cf3482016-08-09 13:06:41 -070035libc_common_flags = [
36 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080037 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070038 "-Wall",
39 "-Wextra",
40 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080041 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070042 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070043 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070044 "-Wframe-larger-than=2048",
George Burgess IVfa5410f2018-08-13 17:44:06 -070045 "-Wimplicit-fallthrough",
Elliott Hughes53cf3482016-08-09 13:06:41 -070046
47 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
48 "-Werror=pointer-to-int-cast",
49 "-Werror=int-to-pointer-cast",
50 "-Werror=type-limits",
51 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080052
53 // Clang's exit-time destructor registration hides __dso_handle, but
54 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
55 "-Wexit-time-destructors",
Elliott Hughes53cf3482016-08-09 13:06:41 -070056]
57
Dan Willemsen208ae172015-09-16 16:33:27 -070058// Define some common cflags
59// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070060cc_defaults {
61 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080062 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070063 cflags: libc_common_flags,
64 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070065 conlyflags: ["-std=gnu99"],
66 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070067 include_dirs: [
68 "bionic/libc/async_safe/include",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070069 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070070
Colin Cross50c21ab2015-10-31 23:03:05 -070071 stl: "none",
72 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070073 sanitize: {
Evgenii Stepanovbe551f52018-08-13 16:46:15 -070074 address: false,
75 integer_overflow: false,
Mitch Phillipsdfde0ee2019-05-01 14:26:13 -070076 // TODO(b/132640749): Fix broken fuzzer support.
77 fuzzer: false,
Colin Cross27c43c52016-04-07 13:27:24 -070078 },
Colin Cross50c21ab2015-10-31 23:03:05 -070079 native_coverage: false,
Jiyong Park5603c6e2018-04-27 21:53:11 +090080 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020081 native_bridge_supported: true,
Ivan Lozanof17fd1d2018-11-27 07:56:17 -080082
Yi Konge3d90de2019-02-20 14:28:56 -080083 // lld complains about duplicate symbols in libcrt and libgcc. Suppress the
84 // warning since this is intended right now.
85 ldflags: ["-Wl,-z,muldefs"],
Dan Willemsen208ae172015-09-16 16:33:27 -070086}
87
Christopher Ferrise55e5ee2019-10-01 17:54:42 -070088// Defaults for native allocator libs/includes to make it
89// easier to change.
90// To enable scudo, change the below to libc_scudo_defaults
91// and comment out the defaults line in libc_scudo shared
92// library.
93// ========================================================
94cc_defaults {
95 name: "libc_native_allocator_defaults",
96
97 defaults: ["libc_jemalloc5_defaults"],
98}
99
100cc_defaults {
101 name: "libc_jemalloc5_defaults",
102
103 include_dirs: [
104 "external/jemalloc_new/include",
105 ],
106
107 whole_static_libs: [
108 "libjemalloc5",
109 "libc_jemalloc_wrapper",
110 ],
111}
112
113// Functions not implemented by jemalloc directly, or that need to
114// be modified for Android.
115cc_library_static {
116 name: "libc_jemalloc_wrapper",
117 defaults: ["libc_defaults"],
118 srcs: ["bionic/jemalloc_wrapper.cpp"],
119 cflags: ["-fvisibility=hidden"],
120
121 include_dirs: [
122 "external/jemalloc_new/include",
123 ],
124}
125
126cc_defaults {
127 name: "libc_scudo_defaults",
128
129 cflags: [
130 "-DUSE_SCUDO",
131 ],
132
133 whole_static_libs: [
134 "libscudo",
135 ],
136}
137
Dan Willemsen208ae172015-09-16 16:33:27 -0700138// ========================================================
139// libc_stack_protector.a - stack protector code
140// ========================================================
141//
Colin Crossa3f9fca2016-01-11 13:20:55 -0800142// Code that implements the stack protector (or that runs
143// before TLS has been set up) needs to be compiled with
144// -fno-stack-protector, since it accesses the stack canary
145// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -0700146
147cc_library_static {
148
Colin Crossa3f9fca2016-01-11 13:20:55 -0800149 srcs: [
150 "bionic/__libc_init_main_thread.cpp",
151 "bionic/__stack_chk_fail.cpp",
152 ],
153 arch: {
154 arm64: {
155 srcs: ["arch-arm64/bionic/__set_tls.c"],
156 },
157 x86: {
Ryan Prichard27475b52018-05-17 17:14:18 -0700158 srcs: [
159 "arch-x86/bionic/__libc_init_sysinfo.cpp",
160 "arch-x86/bionic/__set_tls.cpp",
161 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800162 },
163 x86_64: {
164 srcs: ["arch-x86_64/bionic/__set_tls.c"],
165 },
166 },
167
Colin Cross50c21ab2015-10-31 23:03:05 -0700168 defaults: ["libc_defaults"],
169 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700170 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700171}
172
Colin Crossa3f9fca2016-01-11 13:20:55 -0800173// libc_init_static.cpp also needs to be built without stack protector,
174// because it's responsible for setting up TLS for static executables.
175// This isn't the case for dynamic executables because the dynamic linker
176// has already set up the main thread's TLS.
177
178cc_library_static {
179 name: "libc_init_static",
180 defaults: ["libc_defaults"],
181 srcs: ["bionic/libc_init_static.cpp"],
182 cflags: ["-fno-stack-protector"],
183}
184
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700185cc_library_static {
186 name: "libc_init_dynamic",
187 defaults: ["libc_defaults"],
188 srcs: ["bionic/libc_init_dynamic.cpp"],
189 cflags: ["-fno-stack-protector"],
190}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800191
Dan Willemsen208ae172015-09-16 16:33:27 -0700192// ========================================================
193// libc_tzcode.a - upstream 'tzcode' code
194// ========================================================
195
196cc_library_static {
197
Colin Cross50c21ab2015-10-31 23:03:05 -0700198 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700199 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800200 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700201 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700202 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
203 ],
204
Colin Cross50c21ab2015-10-31 23:03:05 -0700205 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700206 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700207 // Don't use ridiculous amounts of stack.
208 "-DALL_STATE",
209 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
210 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800211 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700212 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700213 // The name of the tm_gmtoff field in our struct tm.
214 "-DTM_GMTOFF=tm_gmtoff",
215 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700216 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700217 // Include `tzname`, `timezone`, and `daylight` globals.
218 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700219 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800220 // Use the empty string (instead of " ") as the timezone abbreviation
221 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700222 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700223 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
224 "-Dlint",
225 ],
226
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 local_include_dirs: ["tzcode/"],
228 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700229}
230
231// ========================================================
232// libc_dns.a - modified NetBSD DNS code
233// ========================================================
234
235cc_library_static {
236
Colin Cross50c21ab2015-10-31 23:03:05 -0700237 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800239 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700240
241 "upstream-netbsd/lib/libc/isc/ev_streams.c",
242 "upstream-netbsd/lib/libc/isc/ev_timers.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700243 ],
244
Colin Cross50c21ab2015-10-31 23:03:05 -0700245 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700246 "-DANDROID_CHANGES",
247 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700248 "-Wno-unused-parameter",
249 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700250 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 ],
252
Dan Willemsen208ae172015-09-16 16:33:27 -0700253 local_include_dirs: [
254 "dns/include",
255 "private",
256 "upstream-netbsd/lib/libc/include",
257 "upstream-netbsd/android/include",
258 ],
259
260 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700261}
262
263// ========================================================
264// libc_freebsd.a - upstream FreeBSD C library code
265// ========================================================
266//
267// These files are built with the freebsd-compat.h header file
268// automatically included.
269
270cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700271 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700272 srcs: [
273 "upstream-freebsd/lib/libc/gen/ldexp.c",
274 "upstream-freebsd/lib/libc/gen/sleep.c",
275 "upstream-freebsd/lib/libc/gen/usleep.c",
276 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700277 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
278 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
279 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
280 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700281 "upstream-freebsd/lib/libc/stdlib/qsort.c",
282 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 "upstream-freebsd/lib/libc/string/wcpcpy.c",
284 "upstream-freebsd/lib/libc/string/wcpncpy.c",
285 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700286 "upstream-freebsd/lib/libc/string/wcscat.c",
287 "upstream-freebsd/lib/libc/string/wcschr.c",
288 "upstream-freebsd/lib/libc/string/wcscmp.c",
289 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700290 "upstream-freebsd/lib/libc/string/wcscspn.c",
291 "upstream-freebsd/lib/libc/string/wcsdup.c",
292 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700293 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700294 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
295 "upstream-freebsd/lib/libc/string/wcsncat.c",
296 "upstream-freebsd/lib/libc/string/wcsncmp.c",
297 "upstream-freebsd/lib/libc/string/wcsncpy.c",
298 "upstream-freebsd/lib/libc/string/wcsnlen.c",
299 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700300 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700301 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700302 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700303 "upstream-freebsd/lib/libc/string/wcstok.c",
304 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700305 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700306 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700307 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800308 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700309 ],
310 arch: {
311 arm64: {
312 exclude_srcs: [
313 "upstream-freebsd/lib/libc/string/wmemmove.c",
314 ],
315 },
316 x86: {
317 exclude_srcs: [
318 "upstream-freebsd/lib/libc/string/wcschr.c",
319 "upstream-freebsd/lib/libc/string/wcscmp.c",
320 "upstream-freebsd/lib/libc/string/wcslen.c",
321 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700322 "upstream-freebsd/lib/libc/string/wmemcmp.c",
323 "upstream-freebsd/lib/libc/string/wcscat.c",
324 "upstream-freebsd/lib/libc/string/wcscpy.c",
325 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530326 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700327 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700328 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700329 },
330
Colin Cross50c21ab2015-10-31 23:03:05 -0700331 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700332 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700333 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700334 "-include freebsd-compat.h",
335 ],
336
Dan Willemsen208ae172015-09-16 16:33:27 -0700337 local_include_dirs: [
338 "upstream-freebsd/android/include",
339 ],
340
341 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700342}
343
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700344cc_library_static {
345 defaults: ["libc_defaults"],
346 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700347 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700348 "upstream-freebsd/lib/libc/stdlib/realpath.c",
349 ],
350
351 cflags: [
352 "-Wno-sign-compare",
353 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700354 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700355 ],
356
357 local_include_dirs: [
358 "upstream-freebsd/android/include",
359 ],
360
361 name: "libc_freebsd_large_stack",
362}
363
Dan Willemsen208ae172015-09-16 16:33:27 -0700364// ========================================================
365// libc_netbsd.a - upstream NetBSD C library code
366// ========================================================
367//
368// These files are built with the netbsd-compat.h header file
369// automatically included.
370
371cc_library_static {
372
Colin Cross50c21ab2015-10-31 23:03:05 -0700373 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700374 srcs: [
375 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700376 "upstream-netbsd/lib/libc/gen/nice.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700377 "upstream-netbsd/lib/libc/gen/psignal.c",
378 "upstream-netbsd/lib/libc/gen/utime.c",
379 "upstream-netbsd/lib/libc/gen/utmp.c",
380 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
381 "upstream-netbsd/lib/libc/regex/regcomp.c",
382 "upstream-netbsd/lib/libc/regex/regerror.c",
383 "upstream-netbsd/lib/libc/regex/regexec.c",
384 "upstream-netbsd/lib/libc/regex/regfree.c",
385 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700386 "upstream-netbsd/lib/libc/stdlib/drand48.c",
387 "upstream-netbsd/lib/libc/stdlib/erand48.c",
388 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
389 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700390 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
391 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
392 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
393 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
394 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
395 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
396 "upstream-netbsd/lib/libc/stdlib/seed48.c",
397 "upstream-netbsd/lib/libc/stdlib/srand48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700398 ],
399 multilib: {
400 lib32: {
401 // LP32 cruft
402 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
403 },
404 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700405 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700406 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800407 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700408 "-DPOSIX_MISTAKE",
409 "-include netbsd-compat.h",
410 ],
411
Dan Willemsen208ae172015-09-16 16:33:27 -0700412 local_include_dirs: [
413 "upstream-netbsd/android/include",
414 "upstream-netbsd/lib/libc/include",
415 ],
416
417 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700418}
419
420// ========================================================
421// libc_openbsd_ndk.a - upstream OpenBSD C library code
422// that can be safely included in the libc_ndk.a (doesn't
423// contain any troublesome global data or constructors).
424// ========================================================
425//
426// These files are built with the openbsd-compat.h header file
427// automatically included.
428
429cc_library_static {
430 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700431 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700432 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700433 "upstream-openbsd/lib/libc/gen/alarm.c",
434 "upstream-openbsd/lib/libc/gen/ctype_.c",
435 "upstream-openbsd/lib/libc/gen/daemon.c",
436 "upstream-openbsd/lib/libc/gen/err.c",
437 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700438 "upstream-openbsd/lib/libc/gen/fnmatch.c",
439 "upstream-openbsd/lib/libc/gen/ftok.c",
440 "upstream-openbsd/lib/libc/gen/getprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700441 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/gen/verr.c",
443 "upstream-openbsd/lib/libc/gen/verrx.c",
444 "upstream-openbsd/lib/libc/gen/vwarn.c",
445 "upstream-openbsd/lib/libc/gen/vwarnx.c",
446 "upstream-openbsd/lib/libc/gen/warn.c",
447 "upstream-openbsd/lib/libc/gen/warnx.c",
448 "upstream-openbsd/lib/libc/locale/btowc.c",
449 "upstream-openbsd/lib/libc/locale/mbrlen.c",
450 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
451 "upstream-openbsd/lib/libc/locale/mbtowc.c",
452 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
454 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-openbsd/lib/libc/locale/wcstoll.c",
456 "upstream-openbsd/lib/libc/locale/wcstombs.c",
457 "upstream-openbsd/lib/libc/locale/wcstoul.c",
458 "upstream-openbsd/lib/libc/locale/wcstoull.c",
459 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
460 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
461 "upstream-openbsd/lib/libc/locale/wctob.c",
462 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700463 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700464 "upstream-openbsd/lib/libc/net/htonl.c",
465 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700466 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
467 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
468 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700469 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
470 "upstream-openbsd/lib/libc/net/inet_ntop.c",
471 "upstream-openbsd/lib/libc/net/inet_pton.c",
472 "upstream-openbsd/lib/libc/net/ntohl.c",
473 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800474 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700475 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700476 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
477 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700478 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700479 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700480 "upstream-openbsd/lib/libc/stdio/fputwc.c",
481 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700482 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700483 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700484 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700485 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700486 "upstream-openbsd/lib/libc/stdio/makebuf.c",
487 "upstream-openbsd/lib/libc/stdio/mktemp.c",
488 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
489 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700490 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700491 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700492 "upstream-openbsd/lib/libc/stdio/tempnam.c",
493 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
494 "upstream-openbsd/lib/libc/stdio/ungetc.c",
495 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
496 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
497 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700498 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
499 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
500 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700501 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700502 "upstream-openbsd/lib/libc/stdio/wsetup.c",
503 "upstream-openbsd/lib/libc/stdlib/abs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800504 "upstream-openbsd/lib/libc/stdlib/div.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700505 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700506 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700507 "upstream-openbsd/lib/libc/stdlib/insque.c",
508 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
509 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
510 "upstream-openbsd/lib/libc/stdlib/labs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800511 "upstream-openbsd/lib/libc/stdlib/ldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700512 "upstream-openbsd/lib/libc/stdlib/llabs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800513 "upstream-openbsd/lib/libc/stdlib/lldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700514 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700515 "upstream-openbsd/lib/libc/stdlib/remque.c",
516 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700517 "upstream-openbsd/lib/libc/stdlib/tfind.c",
518 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800519 "upstream-openbsd/lib/libc/string/memccpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700520 "upstream-openbsd/lib/libc/string/strcasecmp.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800521 "upstream-openbsd/lib/libc/string/strcasestr.c",
522 "upstream-openbsd/lib/libc/string/strcoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700523 "upstream-openbsd/lib/libc/string/strcspn.c",
524 "upstream-openbsd/lib/libc/string/strdup.c",
525 "upstream-openbsd/lib/libc/string/strndup.c",
526 "upstream-openbsd/lib/libc/string/strpbrk.c",
527 "upstream-openbsd/lib/libc/string/strsep.c",
528 "upstream-openbsd/lib/libc/string/strspn.c",
529 "upstream-openbsd/lib/libc/string/strstr.c",
530 "upstream-openbsd/lib/libc/string/strtok.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800531 "upstream-openbsd/lib/libc/string/strxfrm.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700532 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700533 "upstream-openbsd/lib/libc/string/wcswidth.c",
534 ],
535
Colin Cross50c21ab2015-10-31 23:03:05 -0700536 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700537 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700538 "-Wno-unused-parameter",
539 "-include openbsd-compat.h",
540 ],
541
Dan Willemsen208ae172015-09-16 16:33:27 -0700542 local_include_dirs: [
543 "private",
544 "stdio",
545 "upstream-openbsd/android/include",
546 "upstream-openbsd/lib/libc/include",
547 "upstream-openbsd/lib/libc/gdtoa/",
548 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700549}
550
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700551cc_library_static {
552 name: "libc_openbsd_large_stack",
553 defaults: ["libc_defaults"],
554 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700555 "stdio/vfprintf.cpp",
556 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700557 ],
558 cflags: [
559 "-include openbsd-compat.h",
560 "-Wno-sign-compare",
561 "-Wframe-larger-than=5000",
562 ],
563
564 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700565 "upstream-openbsd/android/include/",
566 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700567 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700568 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700569 ],
570}
571
Dan Willemsen208ae172015-09-16 16:33:27 -0700572// ========================================================
573// libc_openbsd.a - upstream OpenBSD C library code
574// ========================================================
575//
576// These files are built with the openbsd-compat.h header file
577// automatically included.
578cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700579 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700580 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800581 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700582 "upstream-openbsd/lib/libc/crypt/arc4random.c",
583 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
584
585 // May be overriden by per-arch optimized versions
586 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700587 "upstream-openbsd/lib/libc/string/memrchr.c",
588 "upstream-openbsd/lib/libc/string/stpcpy.c",
589 "upstream-openbsd/lib/libc/string/stpncpy.c",
590 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700591 "upstream-openbsd/lib/libc/string/strcpy.c",
592 "upstream-openbsd/lib/libc/string/strlcat.c",
593 "upstream-openbsd/lib/libc/string/strlcpy.c",
594 "upstream-openbsd/lib/libc/string/strncat.c",
595 "upstream-openbsd/lib/libc/string/strncmp.c",
596 "upstream-openbsd/lib/libc/string/strncpy.c",
597 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700598
599 arch: {
600 arm: {
601 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700602 "upstream-openbsd/lib/libc/string/strcpy.c",
Haibo Huangea9957a2018-11-19 11:00:32 -0800603 "upstream-openbsd/lib/libc/string/stpcpy.c",
604 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700605 ],
606 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700607 arm64: {
608 exclude_srcs: [
609 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700610 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700611 "upstream-openbsd/lib/libc/string/strcpy.c",
612 "upstream-openbsd/lib/libc/string/strncmp.c",
613 ],
614 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530615 mips: {
616 exclude_srcs: [
617 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530618 "upstream-openbsd/lib/libc/string/strcpy.c",
619 "upstream-openbsd/lib/libc/string/strncmp.c",
620 ],
621 },
622 mips64: {
623 exclude_srcs: [
624 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530625 "upstream-openbsd/lib/libc/string/strcpy.c",
626 "upstream-openbsd/lib/libc/string/strncmp.c",
627 ],
628 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700629 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800630 exclude_srcs: [
631 "upstream-openbsd/lib/libc/string/memchr.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800632 "upstream-openbsd/lib/libc/string/memrchr.c",
633 "upstream-openbsd/lib/libc/string/stpcpy.c",
634 "upstream-openbsd/lib/libc/string/stpncpy.c",
635 "upstream-openbsd/lib/libc/string/strcat.c",
636 "upstream-openbsd/lib/libc/string/strcpy.c",
637 "upstream-openbsd/lib/libc/string/strncmp.c",
638 "upstream-openbsd/lib/libc/string/strncpy.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700639 "upstream-openbsd/lib/libc/string/strlcat.c",
640 "upstream-openbsd/lib/libc/string/strlcpy.c",
641 "upstream-openbsd/lib/libc/string/strncat.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800642 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700643 },
644
645 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800646 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800647 "upstream-openbsd/lib/libc/string/stpcpy.c",
648 "upstream-openbsd/lib/libc/string/stpncpy.c",
649 "upstream-openbsd/lib/libc/string/strcat.c",
650 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800651 "upstream-openbsd/lib/libc/string/strncat.c",
652 "upstream-openbsd/lib/libc/string/strncmp.c",
653 "upstream-openbsd/lib/libc/string/strncpy.c",
654 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700655 },
656 },
657
Colin Cross50c21ab2015-10-31 23:03:05 -0700658 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700659 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700660 "-Wno-unused-parameter",
661 "-include openbsd-compat.h",
662 ],
663
Dan Willemsen208ae172015-09-16 16:33:27 -0700664 local_include_dirs: [
665 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700666 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700667 ],
668
669 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700670}
671
672// ========================================================
673// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
674// ========================================================
675//
676// These files are built with the openbsd-compat.h header file
677// automatically included.
678
679cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700680 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700681 srcs: [
682 "upstream-openbsd/android/gdtoa_support.cpp",
683 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
684 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
685 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
686 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
687 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
688 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
689 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
690 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
691 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
692 "upstream-openbsd/lib/libc/gdtoa/misc.c",
693 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
694 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
695 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
696 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
697 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
698 "upstream-openbsd/lib/libc/gdtoa/sum.c",
699 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
700 ],
701 multilib: {
702 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800703 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700704 },
705 },
706
Colin Cross50c21ab2015-10-31 23:03:05 -0700707 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700708 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700709 "-include openbsd-compat.h",
710 ],
711
Dan Willemsen208ae172015-09-16 16:33:27 -0700712 local_include_dirs: [
713 "private",
714 "upstream-openbsd/android/include",
715 "upstream-openbsd/lib/libc/include",
716 ],
717
718 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700719}
720
721// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700722// libc_fortify.a - container for our FORITFY
723// implementation details
724// ========================================================
725cc_library_static {
726 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700727 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700728
729 name: "libc_fortify",
730
731 // Disable FORTIFY for the compilation of these, so we don't end up having
732 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800733 cflags: [
734 "-U_FORTIFY_SOURCE",
735 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
736 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700737
738 arch: {
739 arm: {
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800740 cflags: [
741 "-DNO___MEMCPY_CHK",
742 "-DRENAME___STRCAT_CHK",
743 "-DRENAME___STRCPY_CHK",
744 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700745 srcs: [
746 "arch-arm/generic/bionic/__memcpy_chk.S",
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800747
748 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
749 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
750
751 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
752 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
753
754 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
755 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
756
757 "arch-arm/krait/bionic/__strcat_chk.S",
758 "arch-arm/krait/bionic/__strcpy_chk.S",
759
760 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
761 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
762
Haibo Huang01bfd892018-12-03 15:05:16 -0800763 "arch-arm/cortex-a55/bionic/__strcat_chk.S",
764 "arch-arm/cortex-a55/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700765 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700766 },
767 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700768 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700769 srcs: [
770 "arch-arm64/generic/bionic/__memcpy_chk.S",
771 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700772 },
773 },
774}
775
776// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700777// libc_bionic.a - home-grown C library code
778// ========================================================
779
780cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700781 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700782 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700783 // The data that backs getauxval is initialized in the libc init
784 // functions which are invoked by the linker. If this file is included
785 // in libc_ndk.a, only one of the copies of the global data will be
786 // initialized, resulting in nullptr dereferences.
787 "bionic/getauxval.cpp",
788
Elliott Hughes211c4d32018-02-02 15:10:32 -0800789 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700790 "bionic/sysconf.cpp",
791 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700792 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700793
Josh Gao10ec9282017-04-03 15:13:29 -0700794 // The following must not be statically linked into libc_ndk.a, because
795 // debuggerd will look for the abort message in libc.so's copy.
796 "bionic/android_set_abort_message.cpp",
797
Dan Willemsen208ae172015-09-16 16:33:27 -0700798 "bionic/strchr.cpp",
799 "bionic/strnlen.c",
800 "bionic/strrchr.cpp",
801 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700802
803 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700804 arm: {
Elliott Hughes1b61d782019-06-04 10:38:34 -0700805 asflags: libc_common_flags + ["-mno-restrict-it"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700806 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800807 "arch-arm/generic/bionic/memcmp.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700808 "arch-arm/generic/bionic/memmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800809 "arch-arm/generic/bionic/memset.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800810 "arch-arm/generic/bionic/stpcpy.c",
811 "arch-arm/generic/bionic/strcat.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800812 "arch-arm/generic/bionic/strcmp.S",
813 "arch-arm/generic/bionic/strcpy.S",
814 "arch-arm/generic/bionic/strlen.c",
815
Ryan Prichard45024fe2018-12-30 21:10:26 -0800816 "arch-arm/bionic/__aeabi_read_tp.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700817 "arch-arm/bionic/__bionic_clone.S",
Yi Kongb410d0e2019-04-22 16:00:46 -0700818 "arch-arm/bionic/__restore.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700819 "arch-arm/bionic/_exit_with_stack_teardown.S",
Yi Kongb410d0e2019-04-22 16:00:46 -0700820 "arch-arm/bionic/atomics_arm.c",
821 "arch-arm/bionic/bpabi.c",
Yi Kong165b1cf2019-02-13 14:10:10 -0800822 "arch-arm/bionic/libcrt_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700823 "arch-arm/bionic/popcount_tab.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700824 "arch-arm/bionic/setjmp.S",
825 "arch-arm/bionic/syscall.S",
826 "arch-arm/bionic/vfork.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800827
828 "arch-arm/cortex-a15/bionic/memcpy.S",
829 "arch-arm/cortex-a15/bionic/memmove.S",
830 "arch-arm/cortex-a15/bionic/memset.S",
831 "arch-arm/cortex-a15/bionic/stpcpy.S",
832 "arch-arm/cortex-a15/bionic/strcat.S",
833 "arch-arm/cortex-a15/bionic/strcmp.S",
834 "arch-arm/cortex-a15/bionic/strcpy.S",
835 "arch-arm/cortex-a15/bionic/strlen.S",
836
837 "arch-arm/cortex-a7/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800838 "arch-arm/cortex-a7/bionic/memset.S",
839
840 "arch-arm/cortex-a9/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800841 "arch-arm/cortex-a9/bionic/memset.S",
842 "arch-arm/cortex-a9/bionic/stpcpy.S",
843 "arch-arm/cortex-a9/bionic/strcat.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800844 "arch-arm/cortex-a9/bionic/strcpy.S",
845 "arch-arm/cortex-a9/bionic/strlen.S",
846
847 "arch-arm/krait/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800848 "arch-arm/krait/bionic/memset.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800849
850 "arch-arm/cortex-a53/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800851
Haibo Huang01bfd892018-12-03 15:05:16 -0800852 "arch-arm/cortex-a55/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800853
854 "arch-arm/kryo/bionic/memcpy.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700855 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700856 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700857 arm64: {
858 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700859 "arch-arm64/generic/bionic/memchr.S",
860 "arch-arm64/generic/bionic/memcmp.S",
861 "arch-arm64/generic/bionic/memcpy.S",
862 "arch-arm64/generic/bionic/memmove.S",
863 "arch-arm64/generic/bionic/memset.S",
864 "arch-arm64/generic/bionic/stpcpy.S",
865 "arch-arm64/generic/bionic/strchr.S",
866 "arch-arm64/generic/bionic/strcmp.S",
867 "arch-arm64/generic/bionic/strcpy.S",
868 "arch-arm64/generic/bionic/strlen.S",
869 "arch-arm64/generic/bionic/strncmp.S",
870 "arch-arm64/generic/bionic/strnlen.S",
871 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800872
873 "arch-arm64/bionic/__bionic_clone.S",
874 "arch-arm64/bionic/_exit_with_stack_teardown.S",
875 "arch-arm64/bionic/setjmp.S",
876 "arch-arm64/bionic/syscall.S",
877 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700878 ],
879 exclude_srcs: [
880 "bionic/__memcpy_chk.cpp",
881 "bionic/strchr.cpp",
882 "bionic/strnlen.c",
883 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700884 },
885
886 mips: {
887 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800888 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530889 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800890 "arch-mips/string/memset.S",
891 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530892 "arch-mips/string/strncmp.S",
893 "arch-mips/string/strlen.c",
894 "arch-mips/string/strnlen.c",
895 "arch-mips/string/strchr.c",
896 "arch-mips/string/strcpy.c",
897 "arch-mips/string/memchr.c",
898 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800899
Dan Willemsen208ae172015-09-16 16:33:27 -0700900 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700901 "arch-mips/bionic/cacheflush.cpp",
902 "arch-mips/bionic/_exit_with_stack_teardown.S",
Yi Kong165b1cf2019-02-13 14:10:10 -0800903 "arch-mips/bionic/libcrt_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700904 "arch-mips/bionic/setjmp.S",
905 "arch-mips/bionic/syscall.S",
906 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700907 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +0530908 exclude_srcs: [
909 "bionic/strchr.cpp",
910 "bionic/strnlen.c",
911 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700912 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700913 mips64: {
914 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800915 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530916 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800917 "arch-mips/string/memset.S",
918 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530919 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800920 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530921 "arch-mips/string/strnlen.c",
922 "arch-mips/string/strchr.c",
923 "arch-mips/string/strcpy.c",
924 "arch-mips/string/memchr.c",
925 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800926
Dan Willemsen208ae172015-09-16 16:33:27 -0700927 "arch-mips64/bionic/__bionic_clone.S",
928 "arch-mips64/bionic/_exit_with_stack_teardown.S",
929 "arch-mips64/bionic/setjmp.S",
930 "arch-mips64/bionic/syscall.S",
931 "arch-mips64/bionic/vfork.S",
932 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700933 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +0530934 exclude_srcs: [
935 "bionic/strchr.cpp",
936 "bionic/strnlen.c",
937 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700938 },
939
940 x86: {
941 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700942 "arch-x86/generic/string/memcmp.S",
943 "arch-x86/generic/string/strcmp.S",
944 "arch-x86/generic/string/strncmp.S",
945 "arch-x86/generic/string/strcat.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700946
947 "arch-x86/generic/string/strlcat.c",
948 "arch-x86/generic/string/strlcpy.c",
949 "arch-x86/generic/string/strncat.c",
950 "arch-x86/generic/string/wcscat.c",
951 "arch-x86/generic/string/wcscpy.c",
952 "arch-x86/generic/string/wmemcmp.c",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530953 "arch-x86/generic/string/wmemset.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700954
Dan Willemsen208ae172015-09-16 16:33:27 -0700955 "arch-x86/atom/string/sse2-memchr-atom.S",
956 "arch-x86/atom/string/sse2-memrchr-atom.S",
957 "arch-x86/atom/string/sse2-strchr-atom.S",
958 "arch-x86/atom/string/sse2-strnlen-atom.S",
959 "arch-x86/atom/string/sse2-strrchr-atom.S",
960 "arch-x86/atom/string/sse2-wcschr-atom.S",
961 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
962 "arch-x86/atom/string/sse2-wcslen-atom.S",
963 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700964 "arch-x86/silvermont/string/sse2-memmove-slm.S",
965 "arch-x86/silvermont/string/sse2-memset-slm.S",
966 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
967 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
968 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
969 "arch-x86/silvermont/string/sse2-strlen-slm.S",
970 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800971
972 "arch-x86/bionic/__bionic_clone.S",
973 "arch-x86/bionic/_exit_with_stack_teardown.S",
Yi Kong165b1cf2019-02-13 14:10:10 -0800974 "arch-x86/bionic/libcrt_compat.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800975 "arch-x86/bionic/__restore.S",
976 "arch-x86/bionic/setjmp.S",
977 "arch-x86/bionic/syscall.S",
978 "arch-x86/bionic/vfork.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700979
980 // ssse3 functions
981 "arch-x86/atom/string/ssse3-strcat-atom.S",
982 "arch-x86/atom/string/ssse3-strcmp-atom.S",
983 "arch-x86/atom/string/ssse3-strlcat-atom.S",
984 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
985 "arch-x86/atom/string/ssse3-strncat-atom.S",
986 "arch-x86/atom/string/ssse3-strncmp-atom.S",
987 "arch-x86/atom/string/ssse3-wcscat-atom.S",
988 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
989
990 // sse4 functions
991 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
992 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
993
994 // atom functions
995 "arch-x86/atom/string/sse2-memset-atom.S",
996 "arch-x86/atom/string/sse2-strlen-atom.S",
997 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Haibo Huange1413622018-11-13 14:20:43 -0800998 "arch-x86/atom/string/ssse3-memmove-atom.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700999 "arch-x86/atom/string/ssse3-strcpy-atom.S",
1000 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1001 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +05301002
1003 // avx2 functions
1004 "arch-x86/kabylake/string/avx2-wmemset-kbl.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001005 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001006
1007 exclude_srcs: [
1008 "bionic/strchr.cpp",
1009 "bionic/strnlen.c",
1010 "bionic/strrchr.cpp",
1011 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001012 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001013 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001014 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001015 "arch-x86_64/string/sse2-memmove-slm.S",
1016 "arch-x86_64/string/sse2-memset-slm.S",
1017 "arch-x86_64/string/sse2-stpcpy-slm.S",
1018 "arch-x86_64/string/sse2-stpncpy-slm.S",
1019 "arch-x86_64/string/sse2-strcat-slm.S",
1020 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001021 "arch-x86_64/string/sse2-strlen-slm.S",
1022 "arch-x86_64/string/sse2-strncat-slm.S",
1023 "arch-x86_64/string/sse2-strncpy-slm.S",
1024 "arch-x86_64/string/sse4-memcmp-slm.S",
1025 "arch-x86_64/string/ssse3-strcmp-slm.S",
1026 "arch-x86_64/string/ssse3-strncmp-slm.S",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +05301027 "arch-x86_64/string/avx2-wmemset-kbl.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001028
1029 "arch-x86_64/bionic/__bionic_clone.S",
1030 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1031 "arch-x86_64/bionic/__restore_rt.S",
1032 "arch-x86_64/bionic/setjmp.S",
1033 "arch-x86_64/bionic/syscall.S",
1034 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001035 ],
1036 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001037 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001038
Colin Cross50c21ab2015-10-31 23:03:05 -07001039 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001040 include_dirs: ["bionic/libstdc++/include"],
1041 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001042}
1043
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001044genrule {
1045 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001046 out: ["generated_android_ids.h"],
1047 srcs: [":android_filesystem_config_header"],
1048 tool_files: ["fs_config_generator.py"],
1049 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001050}
1051
Dan Willemsen268a6732015-10-15 14:49:45 -07001052// ========================================================
1053// libc_bionic_ndk.a- The portions of libc_bionic that can
1054// be safely used in libc_ndk.a (no troublesome global data
1055// or constructors).
1056// ========================================================
1057cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001058 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001059 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001060 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001061 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001062 "bionic/__cmsg_nxthdr.cpp",
1063 "bionic/__errno.cpp",
1064 "bionic/__gnu_basename.cpp",
1065 "bionic/__libc_current_sigrtmax.cpp",
1066 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001067 "bionic/abort.cpp",
1068 "bionic/accept.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001069 "bionic/access.cpp",
1070 "bionic/arpa_inet.cpp",
1071 "bionic/assert.cpp",
1072 "bionic/atof.cpp",
Ryan Prichard083d8502019-01-24 13:47:13 -08001073 "bionic/bionic_allocator.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001074 "bionic/bionic_arc4random.cpp",
Peter Collingbournee9491952019-10-28 10:57:26 -07001075 "bionic/bionic_call_ifunc_resolver.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001076 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001077 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001078 "bionic/bionic_systrace.cpp",
1079 "bionic/bionic_time_conversions.cpp",
1080 "bionic/brk.cpp",
1081 "bionic/c16rtomb.cpp",
1082 "bionic/c32rtomb.cpp",
1083 "bionic/chmod.cpp",
1084 "bionic/chown.cpp",
1085 "bionic/clearenv.cpp",
1086 "bionic/clock.cpp",
1087 "bionic/clock_getcpuclockid.cpp",
1088 "bionic/clock_nanosleep.cpp",
1089 "bionic/clone.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001090 "bionic/ctype.cpp",
1091 "bionic/dirent.cpp",
1092 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001093 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001094 "bionic/error.cpp",
1095 "bionic/eventfd_read.cpp",
1096 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001097 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001098 "bionic/faccessat.cpp",
1099 "bionic/fchmod.cpp",
1100 "bionic/fchmodat.cpp",
Josh Gaof6e5b582018-06-01 15:30:54 -07001101 "bionic/fdsan.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001102 "bionic/ffs.cpp",
1103 "bionic/fgetxattr.cpp",
1104 "bionic/flistxattr.cpp",
1105 "bionic/flockfile.cpp",
1106 "bionic/fpclassify.cpp",
1107 "bionic/fsetxattr.cpp",
1108 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001109 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001110 "bionic/futimens.cpp",
1111 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001112 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001113 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001114 "bionic/gethostname.cpp",
Elliott Hughes2d0b28b2018-10-23 11:23:00 -07001115 "bionic/getloadavg.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001116 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001117 "bionic/getpgrp.cpp",
1118 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001119 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001120 "bionic/gettid.cpp",
Elliott Hughesce934e32018-09-06 13:26:08 -07001121 "bionic/get_device_api_level.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001122 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001123 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001124 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001125 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001126 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001127 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001128 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001129 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001130 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001131 "bionic/lchown.cpp",
1132 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001133 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001134 "bionic/libgen.cpp",
1135 "bionic/link.cpp",
1136 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001137 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001138 "bionic/lstat.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001139 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001140 "bionic/mbrtoc16.cpp",
1141 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001142 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001143 "bionic/mempcpy.cpp",
1144 "bionic/mkdir.cpp",
1145 "bionic/mkfifo.cpp",
1146 "bionic/mknod.cpp",
1147 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001148 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001149 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001150 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001151 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001152 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001153 "bionic/open.cpp",
1154 "bionic/pathconf.cpp",
1155 "bionic/pause.cpp",
1156 "bionic/pipe.cpp",
1157 "bionic/poll.cpp",
1158 "bionic/posix_fadvise.cpp",
1159 "bionic/posix_fallocate.cpp",
1160 "bionic/posix_madvise.cpp",
1161 "bionic/posix_timers.cpp",
1162 "bionic/ptrace.cpp",
1163 "bionic/pty.cpp",
1164 "bionic/raise.cpp",
1165 "bionic/rand.cpp",
1166 "bionic/readlink.cpp",
1167 "bionic/reboot.cpp",
1168 "bionic/recv.cpp",
1169 "bionic/rename.cpp",
1170 "bionic/rmdir.cpp",
1171 "bionic/scandir.cpp",
1172 "bionic/sched_getaffinity.cpp",
1173 "bionic/sched_getcpu.cpp",
1174 "bionic/semaphore.cpp",
1175 "bionic/send.cpp",
1176 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001177 "bionic/seteuid.cpp",
1178 "bionic/setpgrp.cpp",
1179 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001180 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001181 "bionic/sigprocmask.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001182 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001183 "bionic/stat.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001184 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001185 "bionic/strchrnul.cpp",
1186 "bionic/strerror.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001187 "bionic/string_l.cpp",
1188 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001189 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001190 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001191 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001192 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001193 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001194 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001195 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001196 "bionic/sys_msg.cpp",
1197 "bionic/sys_sem.cpp",
1198 "bionic/sys_shm.cpp",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001199 "bionic/sys_signalfd.cpp",
Elliott Hughes261bd742019-08-29 20:45:14 -07001200 "bionic/sys_statfs.cpp",
1201 "bionic/sys_statvfs.cpp",
Elliott Hughes449eff02016-06-08 19:51:20 -07001202 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001203 "bionic/sysinfo.cpp",
1204 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001205 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001206 "bionic/system_property_api.cpp",
1207 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001208 "bionic/tdestroy.cpp",
1209 "bionic/termios.cpp",
1210 "bionic/thread_private.cpp",
Elliott Hughes42067112019-04-18 14:27:24 -07001211 "bionic/threads.cpp",
Elliott Hughesf98d87b2018-07-17 13:21:05 -07001212 "bionic/timespec_get.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001213 "bionic/tmpfile.cpp",
1214 "bionic/umount.cpp",
1215 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001216 "bionic/wait.cpp",
1217 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001218 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001219 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001220 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001221 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001222 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001223
1224 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1225 // which will be overridden by the actual one in libc.so.
1226 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001227 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001228
Dan Willemsen208ae172015-09-16 16:33:27 -07001229 multilib: {
1230 lib32: {
1231 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001232 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001233 },
1234 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001235 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001236 treble_linker_namespaces: {
1237 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001238 },
1239 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001240 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001241 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001242 local_include_dirs: ["stdio"],
1243 include_dirs: ["bionic/libstdc++/include"],
1244 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001245 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001246}
1247
Dan Willemsen208ae172015-09-16 16:33:27 -07001248// ========================================================
1249// libc_pthread.a - pthreads parts that previously lived in
1250// libc_bionic.a. Relocated to their own library because
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001251// they can't be included in libc_ndk.a (as the layout of
Dan Willemsen208ae172015-09-16 16:33:27 -07001252// pthread_t has changed over the years and has ABI
1253// compatibility issues).
1254// ========================================================
1255
1256cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001257 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001258 srcs: [
Ryan Prichard45d13492019-01-03 02:51:30 -08001259 "bionic/bionic_elf_tls.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001260 "bionic/pthread_atfork.cpp",
1261 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001262 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001263 "bionic/pthread_cond.cpp",
1264 "bionic/pthread_create.cpp",
1265 "bionic/pthread_detach.cpp",
1266 "bionic/pthread_equal.cpp",
1267 "bionic/pthread_exit.cpp",
1268 "bionic/pthread_getcpuclockid.cpp",
1269 "bionic/pthread_getschedparam.cpp",
1270 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001271 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001272 "bionic/pthread_join.cpp",
1273 "bionic/pthread_key.cpp",
1274 "bionic/pthread_kill.cpp",
1275 "bionic/pthread_mutex.cpp",
1276 "bionic/pthread_once.cpp",
1277 "bionic/pthread_rwlock.cpp",
Josh Gao726b63f2018-08-27 16:00:58 -07001278 "bionic/pthread_sigqueue.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001279 "bionic/pthread_self.cpp",
1280 "bionic/pthread_setname_np.cpp",
1281 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001282 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001283
1284 // The following implementations depend on pthread data or implementation,
1285 // so we can't include them in libc_ndk.a.
1286 "bionic/__cxa_thread_atexit_impl.cpp",
1287 "stdlib/atexit.c",
1288 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001289 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001290
Colin Cross50c21ab2015-10-31 23:03:05 -07001291 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001292 include_dirs: ["bionic/libstdc++/include"],
1293 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001294}
1295
1296// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001297// libc_syscalls.a
1298// ========================================================
1299
Elliott Hughes782c4852019-04-16 12:31:00 -07001300genrule {
1301 name: "syscalls-arm.S",
1302 out: ["syscalls-arm.S"],
1303 srcs: ["SYSCALLS.TXT"],
1304 tool_files: [":bionic-gensyscalls"],
1305 cmd: "$(location :bionic-gensyscalls) arm $(in) > $(out)",
1306}
1307
1308genrule {
1309 name: "syscalls-arm64.S",
1310 out: ["syscalls-arm64.S"],
1311 srcs: ["SYSCALLS.TXT"],
1312 tool_files: [":bionic-gensyscalls"],
1313 cmd: "$(location :bionic-gensyscalls) arm64 $(in) > $(out)",
1314}
1315
1316genrule {
1317 name: "syscalls-x86.S",
1318 out: ["syscalls-x86.S"],
1319 srcs: ["SYSCALLS.TXT"],
1320 tool_files: [":bionic-gensyscalls"],
1321 cmd: "$(location :bionic-gensyscalls) x86 $(in) > $(out)",
1322}
1323
1324genrule {
1325 name: "syscalls-x86_64.S",
1326 out: ["syscalls-x86_64.S"],
1327 srcs: ["SYSCALLS.TXT"],
1328 tool_files: [":bionic-gensyscalls"],
1329 cmd: "$(location :bionic-gensyscalls) x86_64 $(in) > $(out)",
1330}
1331
Dan Willemsen208ae172015-09-16 16:33:27 -07001332cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001333 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001334 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001335 arch: {
1336 arm: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001337 srcs: [":syscalls-arm.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001338 },
1339 arm64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001340 srcs: [":syscalls-arm64.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001341 },
1342 x86: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001343 srcs: [":syscalls-x86.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001344 },
1345 x86_64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001346 srcs: [":syscalls-x86_64.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001347 },
1348 },
1349 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001350}
1351
1352// ========================================================
1353// libc_aeabi.a
1354// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1355// to avoid infinite recursion. For the other architectures we just build an
1356// empty library to keep this makefile simple.
1357// ========================================================
1358
1359cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001360 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001361 arch: {
1362 arm: {
1363 srcs: ["arch-arm/bionic/__aeabi.c"],
1364 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001365 },
1366 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001367 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001368}
1369
1370// ========================================================
1371// libc_ndk.a
1372// Compatibility library for the NDK. This library contains
1373// all the parts of libc that are safe to statically link.
1374// We can't safely statically link things that can only run
1375// on a certain version of the OS. Examples include
1376// anything that talks to netd (a large portion of the DNS
1377// code) and anything that is dependent on the layout of a
1378// data structure that has changed across releases (such as
1379// pthread_t).
1380// ========================================================
1381
1382cc_library_static {
1383 name: "libc_ndk",
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001384 defaults: [
1385 "libc_defaults",
1386 "libc_native_allocator_defaults",
1387 ],
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001388 srcs: libc_common_src_files + [
1389 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001390 "bionic/malloc_limit.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001391 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001392 multilib: {
1393 lib32: {
1394 srcs: libc_common_src_files_32,
1395 },
1396 },
1397 arch: {
1398 arm: {
1399 srcs: [
1400 "arch-arm/bionic/exidx_dynamic.c",
1401 "arch-common/bionic/crtbegin_so.c",
1402 "arch-arm/bionic/atexit_legacy.c",
1403 "arch-common/bionic/crtend_so.S",
1404 ],
1405 whole_static_libs: ["libc_aeabi"],
1406 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001407 },
1408
Colin Cross50c21ab2015-10-31 23:03:05 -07001409 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001410 "-fvisibility=hidden",
1411 "-DLIBC_STATIC",
1412 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001413
1414 whole_static_libs: [
1415 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001416 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001417 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001418 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001419 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001420 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001421 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001422 "libc_openbsd_ndk",
1423 "libc_stack_protector",
1424 "libc_syscalls",
1425 "libc_tzcode",
1426 "libm",
Elliott Hughes816fab92016-05-27 17:57:46 -07001427 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001428 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001429}
1430
1431// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001432// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001433// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001434cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001435 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001436 srcs: libc_common_src_files,
1437 multilib: {
1438 lib32: {
1439 srcs: libc_common_src_files_32,
1440 },
1441 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001442 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001443
1444 whole_static_libs: [
1445 "libc_bionic",
1446 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001447 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001448 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001449 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001450 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001451 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001452 "libc_netbsd",
1453 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001454 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001455 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001456 "libc_stack_protector",
1457 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001458 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001459 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001460 ],
1461
1462 arch: {
1463 arm: {
1464 whole_static_libs: ["libc_aeabi"],
1465 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001466 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001467}
1468
1469// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001470// libc_common.a
1471// ========================================================
1472
1473cc_library_static {
1474 defaults: ["libc_defaults"],
1475 name: "libc_common",
1476
1477 whole_static_libs: [
1478 "libc_nopthread",
1479 "libc_pthread",
1480 ],
1481}
1482
1483// ========================================================
Haibo Huangf71edfa2018-11-12 10:06:56 -08001484// libc_common_static.a For static binaries.
1485// ========================================================
1486cc_library_static {
1487 defaults: ["libc_defaults"],
1488 name: "libc_common_static",
1489
Haibo Huangb9244ff2018-08-11 10:12:13 -07001490 arch: {
1491 x86: {
1492 srcs: ["arch-x86/static_function_dispatch.S"],
1493 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001494 arm: {
1495 srcs: ["arch-arm/static_function_dispatch.S"],
1496 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001497 },
1498
Haibo Huangf71edfa2018-11-12 10:06:56 -08001499 whole_static_libs: [
1500 "libc_common",
1501 ],
1502}
1503
1504// ========================================================
1505// libc_common_shared.a For shared libraries.
1506// ========================================================
1507cc_library_static {
1508 defaults: ["libc_defaults"],
1509 name: "libc_common_shared",
1510
Haibo Huangb9244ff2018-08-11 10:12:13 -07001511 cflags: [
1512 "-fno-stack-protector",
1513 "-fno-jump-tables",
1514 ],
1515 arch: {
1516 x86: {
1517 srcs: ["arch-x86/dynamic_function_dispatch.cpp"],
1518 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001519 arm: {
Elliott Hughes927fe992019-01-31 22:29:22 +00001520 srcs: ["arch-arm/dynamic_function_dispatch.cpp"],
Haibo Huangea9957a2018-11-19 11:00:32 -08001521 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001522 },
1523
Haibo Huangf71edfa2018-11-12 10:06:56 -08001524 whole_static_libs: [
1525 "libc_common",
1526 ],
1527}
1528
Ryan Prichard22a6a052019-10-10 23:59:30 -07001529// Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static
1530// executable.
1531cc_library_static {
1532 name: "libc_unwind_static",
1533 defaults: ["libc_defaults"],
1534 cflags: ["-DLIBC_STATIC"],
1535
1536 srcs: ["bionic/dl_iterate_phdr_static.cpp"],
1537 arch: {
1538 // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs
1539 arm: {
1540 srcs: ["arch-arm/bionic/exidx_static.c"],
1541 },
1542 },
1543}
1544
Haibo Huangf71edfa2018-11-12 10:06:56 -08001545// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001546// libc_nomalloc.a
1547// ========================================================
1548//
1549// This is a version of the static C library that does not
1550// include malloc. It's useful in situations when the user wants
1551// to provide their own malloc implementation, or wants to
1552// explicitly disallow the use of malloc, such as in the
1553// dynamic linker.
1554
1555cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001556 name: "libc_nomalloc",
Colin Cross50c21ab2015-10-31 23:03:05 -07001557 defaults: ["libc_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001558 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001559
Colin Crossa3f9fca2016-01-11 13:20:55 -08001560 whole_static_libs: [
Haibo Huangf71edfa2018-11-12 10:06:56 -08001561 "libc_common_static",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001562 "libc_init_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001563 "libc_unwind_static",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001564 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001565}
1566
dimitryc0c0ef62018-12-05 16:33:52 +01001567filegroup {
1568 name: "libc_sources_shared",
1569 srcs: [
1570 "arch-common/bionic/crtbegin_so.c",
1571 "arch-common/bionic/crtbrand.S",
1572 "bionic/icu.cpp",
1573 "bionic/malloc_common.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001574 "bionic/malloc_common_dynamic.cpp",
1575 "bionic/malloc_heapprofd.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001576 "bionic/malloc_limit.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001577 "bionic/NetdClient.cpp",
1578 "arch-common/bionic/crtend_so.S",
1579 ],
1580}
1581
1582filegroup {
1583 name: "libc_sources_static",
1584 srcs: [
dimitryc0c0ef62018-12-05 16:33:52 +01001585 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001586 "bionic/malloc_limit.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001587 ],
1588}
1589
1590filegroup {
1591 name: "libc_sources_shared_arm",
1592 srcs: [
1593 "arch-arm/bionic/exidx_dynamic.c",
1594 "arch-arm/bionic/atexit_legacy.c",
1595 ],
1596}
1597
Dan Willemsen208ae172015-09-16 16:33:27 -07001598// ========================================================
1599// libc.a + libc.so
1600// ========================================================
1601cc_library {
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001602 defaults: [
1603 "libc_defaults",
1604 "libc_native_allocator_defaults",
1605 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001606 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001607 static_ndk_lib: true,
Logan Chien833cbe42018-10-19 17:57:54 +08001608 export_include_dirs: ["include"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001609 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001610 platform_sdk_version: {
1611 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1612 },
1613 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001614 static: {
dimitryc0c0ef62018-12-05 16:33:52 +01001615 srcs: [ ":libc_sources_static" ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001616 cflags: ["-DLIBC_STATIC"],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001617 whole_static_libs: [
1618 "libc_init_static",
1619 "libc_common_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001620 "libc_unwind_static",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001621 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001622 },
1623 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001624 srcs: [ ":libc_sources_shared" ],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001625 whole_static_libs: [
1626 "libc_init_dynamic",
1627 "libc_common_shared",
1628 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001629 },
1630
Neil Fullera7db90f2019-04-25 09:28:27 +01001631 required: [
1632 "tzdata",
1633 "tz_version", // Version metadata for tzdata to help debugging.
1634 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001635
Colin Cross4ce94d22016-11-15 13:15:43 -08001636 // Do not pack libc.so relocations; see http://b/20645321 for details.
1637 pack_relocations: false,
1638
dimitry06016f22018-01-05 11:39:28 +01001639 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1640 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1641 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1642 // those new libraries from libgcc.a are not declared external; if that were the case,
1643 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1644 // on the external symbols from the dependent libraries. That would create a "cloaked"
1645 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001646
dimitry06016f22018-01-05 11:39:28 +01001647 shared_libs: [
1648 "ld-android",
1649 "libdl",
1650 ],
Jiyong Park3ff116a2019-04-02 23:04:52 +09001651 static_libs: [
1652 "libdl_android",
1653 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001654
1655 nocrt: true,
1656
Dan Willemsen208ae172015-09-16 16:33:27 -07001657 arch: {
1658 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001659 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001660 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001661 ldflags: ["-Wl,--hash-style=both"],
1662
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001663 version_script: ":libc.arm.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001664
Dan Willemsen208ae172015-09-16 16:33:27 -07001665 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001666 srcs: [":libc_sources_shared_arm"],
Dan Willemsen0c657082016-05-12 01:43:07 -07001667 // special for arm
1668 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001669 },
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001670
1671 // Arm 32 bit does not produce complete exidx unwind information
1672 // so keep the .debug_frame which is relatively small and does
1673 // include needed unwind information.
1674 // See b/132992102 for details.
1675 strip: {
1676 keep_symbols_and_debug_frame: true,
1677 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001678 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001679 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001680 version_script: ":libc.arm64.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001681
1682 // Leave the symbols in the shared library so that stack unwinders can produce
1683 // meaningful name resolution.
1684 strip: {
1685 keep_symbols: true,
1686 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001687 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001688 x86: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001689 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001690 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001691 ldflags: ["-Wl,--hash-style=both"],
1692
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001693 version_script: ":libc.x86.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001694
1695 // Leave the symbols in the shared library so that stack unwinders can produce
1696 // meaningful name resolution.
1697 strip: {
1698 keep_symbols: true,
1699 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001700 },
1701 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001702 version_script: ":libc.x86_64.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001703
1704 // Leave the symbols in the shared library so that stack unwinders can produce
1705 // meaningful name resolution.
1706 strip: {
1707 keep_symbols: true,
1708 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001709 },
1710 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +09001711
1712 stubs: {
1713 symbol_file: "libc.map.txt",
1714 versions: ["10000"],
1715 },
Vic Yang6903fb82019-01-14 11:34:39 -08001716
Jiyong Parke87e0dc2019-10-02 17:09:33 +09001717 apex_available: [
1718 "//apex_available:platform",
1719 "com.android.runtime",
1720 ],
1721
Vic Yang03ff4362019-06-24 16:11:37 -07001722 // Sorting bss symbols by size usually results in less dirty pages at run
1723 // time, because small symbols are grouped together.
1724 sort_bss_symbols_by_size: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001725}
1726
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001727genrule {
1728 name: "libc.arm.map",
1729 out: ["libc.arm.map"],
1730 srcs: ["libc.map.txt"],
1731 tool_files: [":bionic-generate-version-script"],
1732 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
1733}
1734
1735genrule {
1736 name: "libc.arm64.map",
1737 out: ["libc.arm64.map"],
1738 srcs: ["libc.map.txt"],
1739 tool_files: [":bionic-generate-version-script"],
1740 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
1741}
1742
1743genrule {
1744 name: "libc.x86.map",
1745 out: ["libc.x86.map"],
1746 srcs: ["libc.map.txt"],
1747 tool_files: [":bionic-generate-version-script"],
1748 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
1749}
1750
1751genrule {
1752 name: "libc.x86_64.map",
1753 out: ["libc.x86_64.map"],
1754 srcs: ["libc.map.txt"],
1755 tool_files: [":bionic-generate-version-script"],
1756 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
1757}
1758
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001759// Headers that only other parts of the platform can include.
1760cc_library_headers {
1761 name: "bionic_libc_platform_headers",
1762 visibility: [
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001763 "//art:__subpackages__",
1764 "//bionic/libc:__subpackages__",
1765 "//frameworks:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001766 "//external/perfetto:__subpackages__",
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001767 "//external/scudo:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001768 ],
1769 host_supported: true,
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001770 recovery_available: true,
1771 native_bridge_supported: true,
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001772 export_include_dirs: [
1773 "platform",
1774 ],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001775 system_shared_libs: [],
1776 stl: "none",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001777 sdk_version: "current",
1778}
1779
Logan Chien17af91b2019-01-15 21:19:56 +08001780// libc_headers for libasync_safe and libpropertyinfoparser
1781cc_library_headers {
1782 name: "libc_headers",
1783
1784 host_supported: true,
1785 vendor_available: true,
1786 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001787 native_bridge_supported: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001788
1789 no_libcrt: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001790 stl: "none",
1791 system_shared_libs: [],
1792
1793 export_include_dirs: [
1794 "include",
1795 "kernel/uapi",
1796 "kernel/android/uapi",
1797 ],
1798
1799 arch: {
1800 arm: {
1801 export_include_dirs: [
1802 "kernel/uapi/asm-arm",
1803 ],
1804 },
1805 arm64: {
1806 export_include_dirs: [
1807 "kernel/uapi/asm-arm64",
1808 ],
1809 },
1810 mips: {
1811 export_include_dirs: [
1812 "kernel/uapi/asm-mips",
1813 ],
1814 },
1815 mips64: {
1816 export_include_dirs: [
1817 "kernel/uapi/asm-mips",
1818 ],
1819 },
1820 x86: {
1821 export_include_dirs: [
1822 "kernel/uapi/asm-x86",
1823 ],
1824 },
1825 x86_64: {
1826 export_include_dirs: [
1827 "kernel/uapi/asm-x86",
1828 ],
1829 },
1830 },
1831}
1832
Dan Willemsen208ae172015-09-16 16:33:27 -07001833// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001834// libstdc++.so and libstdc++.a.
Dan Willemsen208ae172015-09-16 16:33:27 -07001835// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001836
Dan Willemsen208ae172015-09-16 16:33:27 -07001837cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001838 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001839 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001840 srcs: [
1841 "bionic/__cxa_guard.cpp",
1842 "bionic/__cxa_pure_virtual.cpp",
1843 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001844 ],
1845 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001846 static_ndk_lib: true,
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001847 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001848
Dan Willemsen6b3be172018-12-03 13:57:20 -08001849 static: {
1850 system_shared_libs: [],
1851 },
1852 shared: {
1853 system_shared_libs: ["libc"],
1854 },
1855
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001856 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001857 arch: {
1858 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001859 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001860 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001861 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001862 version_script: ":libstdc++.arm.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001863 },
1864 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001865 version_script: ":libstdc++.arm64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001866 },
1867 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001868 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001869 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001870 version_script: ":libstdc++.x86.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001871 },
1872 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001873 version_script: ":libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001874 },
1875 },
1876}
1877
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001878genrule {
1879 name: "libstdc++.arm.map",
1880 out: ["libstdc++.arm.map"],
1881 srcs: ["libstdc++.map.txt"],
1882 tool_files: [":bionic-generate-version-script"],
1883 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
1884}
1885
1886genrule {
1887 name: "libstdc++.arm64.map",
1888 out: ["libstdc++.arm64.map"],
1889 srcs: ["libstdc++.map.txt"],
1890 tool_files: [":bionic-generate-version-script"],
1891 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
1892}
1893
1894genrule {
1895 name: "libstdc++.x86.map",
1896 out: ["libstdc++.x86.map"],
1897 srcs: ["libstdc++.map.txt"],
1898 tool_files: [":bionic-generate-version-script"],
1899 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
1900}
1901
1902genrule {
1903 name: "libstdc++.x86_64.map",
1904 out: ["libstdc++.x86_64.map"],
1905 srcs: ["libstdc++.map.txt"],
1906 tool_files: [":bionic-generate-version-script"],
1907 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
1908}
1909
1910// ========================================================
1911// crt object files.
1912// ========================================================
1913
Colin Cross50c21ab2015-10-31 23:03:05 -07001914cc_defaults {
1915 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001916 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001917 vendor_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001918 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001919 native_bridge_supported: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001920
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001921 cflags: [
1922 "-Wno-gcc-compat",
1923 "-Wall",
1924 "-Werror",
1925 ],
Peter Collingbourne7eb851c2019-09-26 12:16:06 -07001926 sanitize: {
1927 never: true,
1928 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001929}
1930
Colin Cross50c21ab2015-10-31 23:03:05 -07001931cc_defaults {
1932 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001933 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001934
1935 arch: {
1936 mips: {
1937 cflags: ["-fPIC"],
1938 },
1939 mips64: {
1940 cflags: ["-fPIC"],
1941 },
1942 x86: {
1943 cflags: ["-fPIC"],
1944 },
1945 x86_64: {
1946 cflags: ["-fPIC"],
1947 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001948 },
Colin Crossab179442018-09-27 11:03:22 -07001949 stl: "none",
Dan Willemsen208ae172015-09-16 16:33:27 -07001950}
1951
Dan Willemsen208ae172015-09-16 16:33:27 -07001952cc_object {
1953 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001954 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001955 local_include_dirs: ["include"],
1956 product_variables: {
1957 platform_sdk_version: {
1958 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1959 },
1960 },
1961 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001962
Colin Cross7d7b3682017-11-03 13:38:40 -07001963 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001964}
1965
Dan Willemsen208ae172015-09-16 16:33:27 -07001966cc_object {
1967 name: "crtbegin_so1",
1968 local_include_dirs: ["include"],
1969 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001970
Colin Cross7d7b3682017-11-03 13:38:40 -07001971 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001972}
1973
Dan Willemsen208ae172015-09-16 16:33:27 -07001974cc_object {
1975 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001976
Colin Cross7d7b3682017-11-03 13:38:40 -07001977 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001978 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001979 "crtbegin_so1",
1980 "crtbrand",
1981 ],
1982}
1983
Dan Willemsen208ae172015-09-16 16:33:27 -07001984cc_object {
1985 name: "crtend_so",
1986 local_include_dirs: ["include"],
1987 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001988
Colin Cross7d7b3682017-11-03 13:38:40 -07001989 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001990}
1991
Dan Willemsen208ae172015-09-16 16:33:27 -07001992cc_object {
1993 name: "crtbegin_static1",
1994 local_include_dirs: ["include"],
1995 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001996
Colin Cross50c21ab2015-10-31 23:03:05 -07001997 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001998 mips: {
1999 srcs: [
2000 "arch-mips/bionic/crtbegin.c",
2001 ],
2002 exclude_srcs: [
2003 "arch-common/bionic/crtbegin.c",
2004 ],
2005 },
2006 mips64: {
2007 srcs: [
2008 "arch-mips64/bionic/crtbegin.c",
2009 ],
2010 exclude_srcs: [
2011 "arch-common/bionic/crtbegin.c",
2012 ],
2013 },
2014 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002015
2016 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002017}
2018
Dan Willemsen208ae172015-09-16 16:33:27 -07002019cc_object {
2020 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07002021
Colin Cross77d57bf2016-04-11 14:34:18 -07002022 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002023 "crtbegin_static1",
2024 "crtbrand",
2025 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07002026 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002027}
2028
Dan Willemsen208ae172015-09-16 16:33:27 -07002029cc_object {
2030 name: "crtbegin_dynamic1",
2031 local_include_dirs: ["include"],
2032 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002033
Colin Cross50c21ab2015-10-31 23:03:05 -07002034 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07002035 mips: {
2036 srcs: [
2037 "arch-mips/bionic/crtbegin.c",
2038 ],
2039 exclude_srcs: [
2040 "arch-common/bionic/crtbegin.c",
2041 ],
2042 },
2043 mips64: {
2044 srcs: [
2045 "arch-mips64/bionic/crtbegin.c",
2046 ],
2047 exclude_srcs: [
2048 "arch-common/bionic/crtbegin.c",
2049 ],
2050 },
2051 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002052 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002053}
2054
Dan Willemsen208ae172015-09-16 16:33:27 -07002055cc_object {
2056 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07002057
Colin Cross77d57bf2016-04-11 14:34:18 -07002058 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002059 "crtbegin_dynamic1",
2060 "crtbrand",
2061 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002062 target: {
2063 linux_bionic: {
2064 generated_sources: ["host_bionic_linker_asm"],
2065 objs: [
2066 "linker_wrapper",
2067 ],
2068 },
2069 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002070 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002071}
2072
Dan Willemsen208ae172015-09-16 16:33:27 -07002073cc_object {
2074 // We rename crtend.o to crtend_android.o to avoid a
2075 // name clash between gcc and bionic.
2076 name: "crtend_android",
2077 local_include_dirs: ["include"],
2078 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002079
Colin Cross50c21ab2015-10-31 23:03:05 -07002080 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002081}
Colin Crossbaa48992016-07-13 11:15:21 -07002082
Elliott Hughesd19b3c52018-09-06 16:04:08 -07002083// ========================================================
2084// NDK headers.
2085// ========================================================
2086
Dan Albert26e1c412018-05-24 14:56:46 -07002087versioned_ndk_headers {
Dan Albert22805ea2017-03-22 15:28:05 -07002088 name: "common_libc",
2089 from: "include",
2090 to: "",
2091 license: "NOTICE",
2092}
Dan Albert4238a352016-06-28 11:18:05 -07002093
2094ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002095 name: "libc_uapi",
2096 from: "kernel/uapi",
2097 to: "",
2098 srcs: [
2099 "kernel/uapi/asm-generic/**/*.h",
2100 "kernel/uapi/drm/**/*.h",
2101 "kernel/uapi/linux/**/*.h",
2102 "kernel/uapi/misc/**/*.h",
2103 "kernel/uapi/mtd/**/*.h",
2104 "kernel/uapi/rdma/**/*.h",
2105 "kernel/uapi/scsi/**/*.h",
2106 "kernel/uapi/sound/**/*.h",
2107 "kernel/uapi/video/**/*.h",
2108 "kernel/uapi/xen/**/*.h",
2109 ],
Dan Albert92592652016-10-20 01:42:54 -07002110 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002111}
2112
2113ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002114 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002115 from: "kernel/android/uapi/linux",
2116 to: "linux",
2117 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002118 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002119}
2120
2121ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002122 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002123 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002124 to: "scsi",
2125 srcs: ["kernel/android/scsi/**/*.h"],
2126 license: "NOTICE",
2127}
2128
2129ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002130 name: "libc_asm_arm",
2131 from: "kernel/uapi/asm-arm",
2132 to: "arm-linux-androideabi",
2133 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002134 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002135}
2136
2137ndk_headers {
2138 name: "libc_asm_arm64",
2139 from: "kernel/uapi/asm-arm64",
2140 to: "aarch64-linux-android",
2141 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002142 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002143}
2144
Elliott Hughesee291c02017-12-11 11:32:34 -08002145// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002146ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002147 name: "libc_asm_mips",
2148 from: "kernel/uapi/asm-mips",
2149 to: "mipsel-linux-android",
2150 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2151 license: "NOTICE",
2152}
2153
Elliott Hughesee291c02017-12-11 11:32:34 -08002154// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002155ndk_headers {
2156 name: "libc_asm_mips64",
2157 from: "kernel/uapi/asm-mips",
2158 to: "mips64el-linux-android",
2159 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2160 license: "NOTICE",
2161}
2162
2163ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002164 name: "libc_asm_x86",
2165 from: "kernel/uapi/asm-x86",
2166 to: "i686-linux-android",
2167 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002168 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002169}
2170
2171ndk_headers {
2172 name: "libc_asm_x86_64",
2173 from: "kernel/uapi/asm-x86",
2174 to: "x86_64-linux-android",
2175 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002176 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002177}
2178
Dan Albert4238a352016-06-28 11:18:05 -07002179ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002180 name: "libc",
dimitry7f048802019-05-03 15:57:34 +02002181 native_bridge_supported: true,
Dan Albert4238a352016-06-28 11:18:05 -07002182 symbol_file: "libc.map.txt",
2183 first_version: "9",
2184}
2185
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002186llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002187 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002188 symbol_file: "libc.map.txt",
2189 export_headers_as_system: true,
2190 export_preprocessed_headers: ["include"],
dimitry7f048802019-05-03 15:57:34 +02002191 native_bridge_supported: true,
Logan Chien17af91b2019-01-15 21:19:56 +08002192 export_include_dirs: [
2193 "kernel/android/uapi",
2194 "kernel/uapi",
2195 ],
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002196 arch: {
2197 arm: {
2198 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002199 "kernel/uapi/asm-arm",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002200 ],
2201 },
2202 arm64: {
2203 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002204 "kernel/uapi/asm-arm64",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002205 ],
2206 },
2207 mips: {
2208 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002209 "kernel/uapi/asm-mips",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002210 ],
2211 },
2212 mips64: {
2213 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002214 "kernel/uapi/asm-mips",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002215 ],
2216 },
2217 x86: {
2218 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002219 "kernel/uapi/asm-x86",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002220 ],
2221 },
2222 x86_64: {
2223 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002224 "kernel/uapi/asm-x86",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002225 ],
2226 },
2227 },
2228}
2229
Dan Albertdf31aff2016-10-06 15:50:41 -07002230ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002231 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002232 symbol_file: "libstdc++.map.txt",
2233 first_version: "9",
2234}
2235
Dan Willemsenca056d72018-01-08 14:00:24 -08002236// Export these headers for toolbox to process
2237filegroup {
2238 name: "kernel_input_headers",
2239 srcs: [
2240 "kernel/uapi/linux/input.h",
2241 "kernel/uapi/linux/input-event-codes.h",
2242 ],
2243}
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002244
2245// Generate a syscall name / number mapping. These objects are text files
2246// (thanks to the -dD -E flags) and not binary files. They will then be
2247// consumed by the genseccomp.py script and converted into C++ code.
2248cc_defaults {
2249 name: "libseccomp_gen_syscall_nrs_defaults",
2250 recovery_available: true,
2251 srcs: ["seccomp/gen_syscall_nrs.cpp"],
2252 cflags: [
2253 "-dD",
2254 "-E",
2255 "-Wall",
2256 "-Werror",
2257 "-nostdinc",
2258 ],
2259}
2260
2261cc_object {
2262 name: "libseccomp_gen_syscall_nrs_arm",
2263 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2264 local_include_dirs: [
2265 "kernel/uapi/asm-arm",
2266 "kernel/uapi",
2267 ],
2268}
2269
2270cc_object {
2271 name: "libseccomp_gen_syscall_nrs_arm64",
2272 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2273 local_include_dirs: [
2274 "kernel/uapi/asm-arm64",
2275 "kernel/uapi",
2276 ],
2277}
2278
2279cc_object {
2280 name: "libseccomp_gen_syscall_nrs_x86",
2281 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2282 srcs: ["seccomp/gen_syscall_nrs_x86.cpp"],
2283 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2284 local_include_dirs: [
2285 "kernel/uapi/asm-x86",
2286 "kernel/uapi",
2287 ],
2288}
2289
2290cc_object {
2291 name: "libseccomp_gen_syscall_nrs_x86_64",
2292 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2293 srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"],
2294 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2295 local_include_dirs: [
2296 "kernel/uapi/asm-x86",
2297 "kernel/uapi",
2298 ],
2299}
2300
2301cc_object {
2302 name: "libseccomp_gen_syscall_nrs_mips",
2303 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2304 cflags: [
2305 "-D_MIPS_SIM=_MIPS_SIM_ABI32",
2306 ],
2307 local_include_dirs: [
2308 "kernel/uapi/asm-mips",
2309 "kernel/uapi",
2310 ],
2311}
2312
2313cc_object {
2314 name: "libseccomp_gen_syscall_nrs_mips64",
2315 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2316 cflags: [
2317 "-D_MIPS_SIM=_MIPS_SIM_ABI64",
2318 ],
2319 local_include_dirs: [
2320 "kernel/uapi/asm-mips",
2321 "kernel/uapi",
2322 ],
2323}
2324
Elliott Hughesae03b122019-09-17 16:37:05 -07002325// Generate the C++ policy sources for app and system seccomp-bpf filters.
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002326python_binary_host {
2327 name: "genseccomp",
2328 main: "tools/genseccomp.py",
2329
2330 srcs: [
2331 "tools/genseccomp.py",
2332 "tools/gensyscalls.py",
2333 ],
2334
2335 data: [
2336 "kernel/uapi/**/*.h",
2337 ],
2338
2339 version: {
2340 py2: {
2341 enabled: true,
2342 },
2343 py3: {
2344 enabled: false,
2345 },
2346 },
2347}
2348
Martijn Coenen0c6de752019-01-02 12:52:51 +01002349python_binary_host {
2350 name: "genfunctosyscallnrs",
2351 main: "tools/genfunctosyscallnrs.py",
2352
2353 srcs: [
2354 "tools/genseccomp.py",
2355 "tools/genfunctosyscallnrs.py",
2356 "tools/gensyscalls.py",
2357 ],
2358
2359 data: [
2360 "kernel/uapi/**/*.h",
2361 ],
2362
2363 version: {
2364 py2: {
2365 enabled: true,
2366 },
2367 py3: {
2368 enabled: false,
2369 },
2370 },
2371}
2372
2373cc_genrule {
2374 name: "func_to_syscall_nrs",
2375 recovery_available: true,
2376 cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)",
2377
2378 tools: [ "genfunctosyscallnrs" ],
2379
2380 srcs: [
2381 "SYSCALLS.TXT",
2382 ":libseccomp_gen_syscall_nrs_arm",
2383 ":libseccomp_gen_syscall_nrs_arm64",
2384 ":libseccomp_gen_syscall_nrs_mips",
2385 ":libseccomp_gen_syscall_nrs_mips64",
2386 ":libseccomp_gen_syscall_nrs_x86",
2387 ":libseccomp_gen_syscall_nrs_x86_64",
2388 ],
2389
2390 out: [
2391 "func_to_syscall_nrs.h",
2392 ],
2393}
2394
Martijn Coenenc3752be2019-01-09 16:19:57 +01002395// SECCOMP_BLACKLIST_APP_ZYGOTE.TXT = SECCOMP_BLACKLIST_APP.txt - setresgid*
2396genrule {
2397 name: "generate_app_zygote_blacklist",
2398 out: ["SECCOMP_BLACKLIST_APP_ZYGOTE.TXT"],
2399 srcs: ["SECCOMP_BLACKLIST_APP.TXT"],
2400 cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)",
2401}
2402
2403cc_genrule {
2404 name: "libseccomp_policy_app_zygote_sources",
2405 recovery_available: true,
2406 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
2407
2408 tools: [ "genseccomp" ],
2409
2410 srcs: [
2411 "SYSCALLS.TXT",
2412 "SECCOMP_WHITELIST_COMMON.TXT",
2413 "SECCOMP_WHITELIST_APP.TXT",
2414 "SECCOMP_BLACKLIST_COMMON.TXT",
2415 ":generate_app_zygote_blacklist",
2416 ":libseccomp_gen_syscall_nrs_arm",
2417 ":libseccomp_gen_syscall_nrs_arm64",
2418 ":libseccomp_gen_syscall_nrs_mips",
2419 ":libseccomp_gen_syscall_nrs_mips64",
2420 ":libseccomp_gen_syscall_nrs_x86",
2421 ":libseccomp_gen_syscall_nrs_x86_64",
2422 ],
2423
2424 out: [
2425 "arm64_app_zygote_policy.cpp",
2426 "arm_app_zygote_policy.cpp",
2427 "mips64_app_zygote_policy.cpp",
2428 "mips_app_zygote_policy.cpp",
2429 "x86_64_app_zygote_policy.cpp",
2430 "x86_app_zygote_policy.cpp",
2431 ],
2432}
2433
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002434cc_genrule {
2435 name: "libseccomp_policy_app_sources",
2436 recovery_available: true,
2437 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
2438
2439 tools: [ "genseccomp" ],
2440
2441 srcs: [
2442 "SYSCALLS.TXT",
2443 "SECCOMP_WHITELIST_COMMON.TXT",
2444 "SECCOMP_WHITELIST_APP.TXT",
2445 "SECCOMP_BLACKLIST_COMMON.TXT",
2446 "SECCOMP_BLACKLIST_APP.TXT",
2447 ":libseccomp_gen_syscall_nrs_arm",
2448 ":libseccomp_gen_syscall_nrs_arm64",
2449 ":libseccomp_gen_syscall_nrs_mips",
2450 ":libseccomp_gen_syscall_nrs_mips64",
2451 ":libseccomp_gen_syscall_nrs_x86",
2452 ":libseccomp_gen_syscall_nrs_x86_64",
2453 ],
2454
2455 out: [
2456 "arm64_app_policy.cpp",
2457 "arm_app_policy.cpp",
2458 "mips64_app_policy.cpp",
2459 "mips_app_policy.cpp",
2460 "x86_64_app_policy.cpp",
2461 "x86_app_policy.cpp",
2462 ],
2463}
2464
2465cc_genrule {
2466 name: "libseccomp_policy_system_sources",
2467 recovery_available: true,
2468 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
2469
2470 tools: [ "genseccomp" ],
2471
2472 srcs: [
2473 "SYSCALLS.TXT",
2474 "SECCOMP_WHITELIST_COMMON.TXT",
2475 "SECCOMP_WHITELIST_SYSTEM.TXT",
2476 "SECCOMP_BLACKLIST_COMMON.TXT",
2477 ":libseccomp_gen_syscall_nrs_arm",
2478 ":libseccomp_gen_syscall_nrs_arm64",
2479 ":libseccomp_gen_syscall_nrs_mips",
2480 ":libseccomp_gen_syscall_nrs_mips64",
2481 ":libseccomp_gen_syscall_nrs_x86",
2482 ":libseccomp_gen_syscall_nrs_x86_64",
2483 ],
2484
2485 out: [
2486 "arm64_system_policy.cpp",
2487 "arm_system_policy.cpp",
2488 "mips64_system_policy.cpp",
2489 "mips_system_policy.cpp",
2490 "x86_64_system_policy.cpp",
2491 "x86_system_policy.cpp",
2492 ],
2493}
2494
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002495cc_library {
2496 name: "libseccomp_policy",
2497 recovery_available: true,
Martijn Coenend269d9b2018-11-08 16:41:42 +01002498 generated_headers: ["func_to_syscall_nrs"],
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002499 generated_sources: [
2500 "libseccomp_policy_app_sources",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002501 "libseccomp_policy_app_zygote_sources",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002502 "libseccomp_policy_system_sources",
2503 ],
2504
2505 srcs: [
2506 "seccomp/seccomp_policy.cpp",
2507 ],
2508
2509 export_include_dirs: ["seccomp/include"],
2510 cflags: [
2511 "-Wall",
2512 "-Werror",
2513 ],
2514 shared: {
2515 shared_libs: ["libbase"],
2516 },
2517 static: {
2518 static_libs: ["libbase"],
2519 },
2520}
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002521
2522// This is a temporary library that will use scudo as the native memory
2523// allocator. To use it, add it as the first shared library.
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002524cc_defaults {
2525 name: "libc_scudo_wrapper_defaults",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002526 srcs: [
2527 "bionic/malloc_common.cpp",
2528 "bionic/malloc_common_dynamic.cpp",
2529 "bionic/malloc_heapprofd.cpp",
2530 "bionic/malloc_limit.cpp",
2531 "bionic/scudo_wrapper.cpp",
2532 "bionic/__set_errno.cpp",
2533 ],
2534 cflags: ["-DUSE_SCUDO"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002535 shared_libs: ["libscudo_wrapper"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002536
2537 header_libs: ["libc_headers"],
2538
2539 static_libs: ["libasync_safe"],
2540
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002541 arch: {
2542 arm: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002543 srcs: [":syscalls-arm.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002544 },
2545 arm64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002546 srcs: [":syscalls-arm64.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002547 },
2548 x86: {
2549 srcs: [
2550 "arch-x86/bionic/__libc_init_sysinfo.cpp",
Elliott Hughes782c4852019-04-16 12:31:00 -07002551 ":syscalls-x86.S",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002552 ],
2553 },
2554 x86_64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002555 srcs: [":syscalls-x86_64.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002556 },
2557 },
2558
2559 // Mark this library as global so it overrides all the allocation
2560 // definitions properly.
2561 ldflags: ["-Wl,-z,global"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002562}
Pirama Arumuga Nainar17e7c752019-05-22 22:14:57 -07002563
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002564cc_library_shared {
2565 name: "libc_scudo",
2566 defaults: ["libc_scudo_wrapper_defaults"],
2567 vendor_available: true,
2568 stl: "none",
2569 system_shared_libs: [],
2570
2571 allow_undefined_symbols: true,
Pirama Arumuga Nainar17e7c752019-05-22 22:14:57 -07002572 // Like libc, disable native coverage for libc_scudo.
2573 native_coverage: false,
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002574}
2575
2576subdirs = [
2577 "bionic/scudo",
2578]