blob: 3448094fdee2a23badd114e003b310c2e2e22563 [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
Peter Collingbourne570de332019-12-11 10:00:58 -080023// off64_t/time64_t support on LP32.
Dan Willemsen208ae172015-09-16 16:33:27 -070024// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -070025libc_common_src_files_32 = [
26 "bionic/legacy_32_bit_support.cpp",
27 "bionic/time64.c",
28]
29
Elliott Hughes53cf3482016-08-09 13:06:41 -070030libc_common_flags = [
31 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080032 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070033 "-Wall",
34 "-Wextra",
35 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080036 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070037 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070038 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070039 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070040
41 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
42 "-Werror=pointer-to-int-cast",
43 "-Werror=int-to-pointer-cast",
44 "-Werror=type-limits",
45 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080046
47 // Clang's exit-time destructor registration hides __dso_handle, but
48 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
49 "-Wexit-time-destructors",
Mitch Phillipsf3968e82020-01-31 19:57:04 -080050
51 // GWP-ASan requires platform TLS.
52 "-fno-emulated-tls",
Elliott Hughes53cf3482016-08-09 13:06:41 -070053]
54
Dan Willemsen208ae172015-09-16 16:33:27 -070055// Define some common cflags
56// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070057cc_defaults {
58 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080059 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070060 cflags: libc_common_flags,
61 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070062 conlyflags: ["-std=gnu99"],
63 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070064 include_dirs: [
65 "bionic/libc/async_safe/include",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070066 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070067
Mitch Phillipsf3968e82020-01-31 19:57:04 -080068 header_libs: ["gwp_asan_headers"],
69
Colin Cross50c21ab2015-10-31 23:03:05 -070070 stl: "none",
71 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070072 sanitize: {
Evgenii Stepanovbe551f52018-08-13 16:46:15 -070073 address: false,
74 integer_overflow: false,
Mitch Phillipsdfde0ee2019-05-01 14:26:13 -070075 // TODO(b/132640749): Fix broken fuzzer support.
76 fuzzer: false,
Colin Cross27c43c52016-04-07 13:27:24 -070077 },
Colin Cross50c21ab2015-10-31 23:03:05 -070078 native_coverage: false,
Yifan Hong5a39cee2020-01-21 16:43:56 -080079 ramdisk_available: true,
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"],
Peter Collingbournee99912f2019-11-01 15:37:00 -070086
87 product_variables: {
88 experimental_mte: {
89 cflags: ["-DANDROID_EXPERIMENTAL_MTE"],
90 },
91 },
Dan Willemsen208ae172015-09-16 16:33:27 -070092}
93
Christopher Ferris4df29ed2020-01-24 18:06:42 -080094libc_scudo_product_variables = {
95 malloc_not_svelte: {
96 cflags: ["-DUSE_SCUDO"],
97 whole_static_libs: ["libscudo"],
98 exclude_static_libs: [
99 "libjemalloc5",
100 "libc_jemalloc_wrapper",
101 ],
102 },
103}
104
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700105// Defaults for native allocator libs/includes to make it
106// easier to change.
Christopher Ferris062eba22020-01-31 22:40:45 -0800107// To disable scudo for the non-svelte config remove the line:
Christopher Ferris4df29ed2020-01-24 18:06:42 -0800108// product_variables: libc_scudo_product_variables,
Christopher Ferris062eba22020-01-31 22:40:45 -0800109// in the cc_defaults below.
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700110// ========================================================
111cc_defaults {
112 name: "libc_native_allocator_defaults",
113
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700114 whole_static_libs: [
115 "libjemalloc5",
116 "libc_jemalloc_wrapper",
117 ],
Mitch Phillipsf3968e82020-01-31 19:57:04 -0800118 header_libs: ["gwp_asan_headers"],
Christopher Ferris062eba22020-01-31 22:40:45 -0800119 product_variables: libc_scudo_product_variables,
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700120}
121
122// Functions not implemented by jemalloc directly, or that need to
123// be modified for Android.
124cc_library_static {
125 name: "libc_jemalloc_wrapper",
126 defaults: ["libc_defaults"],
127 srcs: ["bionic/jemalloc_wrapper.cpp"],
128 cflags: ["-fvisibility=hidden"],
129
Christopher Ferris4df29ed2020-01-24 18:06:42 -0800130 // Used to pull in the jemalloc include directory so that if the
131 // library is removed, the include directory is also removed.
132 static_libs: ["libjemalloc5"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -0700133}
134
Dan Willemsen208ae172015-09-16 16:33:27 -0700135// ========================================================
Ryan Prichard249757b2019-11-01 17:18:28 -0700136// libc_bootstrap.a - -fno-stack-protector and -ffreestanding
Dan Willemsen208ae172015-09-16 16:33:27 -0700137// ========================================================
138//
Ryan Prichard249757b2019-11-01 17:18:28 -0700139// Code that implements the stack protector (or that runs before TLS has been set up) needs to be
140// compiled with -fno-stack-protector, since it accesses the stack canary TLS slot. In the linker,
141// some of this code runs before ifunc resolvers have made string.h functions work, so compile with
142// -ffreestanding.
Dan Willemsen208ae172015-09-16 16:33:27 -0700143
144cc_library_static {
145
Colin Crossa3f9fca2016-01-11 13:20:55 -0800146 srcs: [
147 "bionic/__libc_init_main_thread.cpp",
148 "bionic/__stack_chk_fail.cpp",
Ryan Prichard249757b2019-11-01 17:18:28 -0700149 "bionic/bionic_call_ifunc_resolver.cpp",
150 "bionic/getauxval.cpp",
Colin Crossa3f9fca2016-01-11 13:20:55 -0800151 ],
152 arch: {
153 arm64: {
154 srcs: ["arch-arm64/bionic/__set_tls.c"],
155 },
156 x86: {
Ryan Prichard27475b52018-05-17 17:14:18 -0700157 srcs: [
158 "arch-x86/bionic/__libc_init_sysinfo.cpp",
159 "arch-x86/bionic/__set_tls.cpp",
160 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800161 },
162 x86_64: {
163 srcs: ["arch-x86_64/bionic/__set_tls.c"],
164 },
165 },
166
Colin Cross50c21ab2015-10-31 23:03:05 -0700167 defaults: ["libc_defaults"],
Ryan Prichard249757b2019-11-01 17:18:28 -0700168 cflags: ["-fno-stack-protector", "-ffreestanding"],
169 name: "libc_bootstrap",
Dan Willemsen208ae172015-09-16 16:33:27 -0700170}
171
Ryan Prichard249757b2019-11-01 17:18:28 -0700172// libc_init_static.cpp and libc_init_dynamic.cpp need to be built without stack protector.
173// libc_init_static.cpp sets up TLS for static executables, and libc_init_dynamic.cpp initializes
174// the stack protector global variable.
Colin Crossa3f9fca2016-01-11 13:20:55 -0800175
176cc_library_static {
177 name: "libc_init_static",
178 defaults: ["libc_defaults"],
179 srcs: ["bionic/libc_init_static.cpp"],
Ryan Prichard249757b2019-11-01 17:18:28 -0700180 cflags: [
181 "-fno-stack-protector",
182
183 // Compile libc_init_static.cpp with -ffreestanding, because some of its code is called
184 // from the linker before ifunc resolvers have made string.h functions available.
185 "-ffreestanding",
186 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800187}
188
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700189cc_library_static {
190 name: "libc_init_dynamic",
191 defaults: ["libc_defaults"],
192 srcs: ["bionic/libc_init_dynamic.cpp"],
193 cflags: ["-fno-stack-protector"],
194}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800195
Dan Willemsen208ae172015-09-16 16:33:27 -0700196// ========================================================
197// libc_tzcode.a - upstream 'tzcode' code
198// ========================================================
199
200cc_library_static {
201
Colin Cross50c21ab2015-10-31 23:03:05 -0700202 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700203 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800204 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700205 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700206 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
207 ],
208
Colin Cross50c21ab2015-10-31 23:03:05 -0700209 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700210 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700211 // Don't use ridiculous amounts of stack.
212 "-DALL_STATE",
213 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
214 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800215 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700216 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700217 // The name of the tm_gmtoff field in our struct tm.
218 "-DTM_GMTOFF=tm_gmtoff",
219 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700220 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700221 // Include `tzname`, `timezone`, and `daylight` globals.
222 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700223 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800224 // Use the empty string (instead of " ") as the timezone abbreviation
225 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700226 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
228 "-Dlint",
229 ],
230
Dan Willemsen208ae172015-09-16 16:33:27 -0700231 local_include_dirs: ["tzcode/"],
232 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700233}
234
235// ========================================================
236// libc_dns.a - modified NetBSD DNS code
237// ========================================================
238
239cc_library_static {
240
Colin Cross50c21ab2015-10-31 23:03:05 -0700241 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700242 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800243 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700244
245 "upstream-netbsd/lib/libc/isc/ev_streams.c",
246 "upstream-netbsd/lib/libc/isc/ev_timers.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700247 ],
248
Colin Cross50c21ab2015-10-31 23:03:05 -0700249 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700250 "-DANDROID_CHANGES",
251 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700252 "-Wno-unused-parameter",
253 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700254 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700255 ],
256
Dan Willemsen208ae172015-09-16 16:33:27 -0700257 local_include_dirs: [
258 "dns/include",
259 "private",
260 "upstream-netbsd/lib/libc/include",
261 "upstream-netbsd/android/include",
262 ],
263
264 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700265}
266
267// ========================================================
268// libc_freebsd.a - upstream FreeBSD C library code
269// ========================================================
270//
271// These files are built with the freebsd-compat.h header file
272// automatically included.
273
274cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700275 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700276 srcs: [
277 "upstream-freebsd/lib/libc/gen/ldexp.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700278 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700279 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
280 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
281 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
282 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 "upstream-freebsd/lib/libc/stdlib/qsort.c",
284 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700285 "upstream-freebsd/lib/libc/string/wcpcpy.c",
286 "upstream-freebsd/lib/libc/string/wcpncpy.c",
287 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700288 "upstream-freebsd/lib/libc/string/wcscat.c",
289 "upstream-freebsd/lib/libc/string/wcschr.c",
290 "upstream-freebsd/lib/libc/string/wcscmp.c",
291 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700292 "upstream-freebsd/lib/libc/string/wcscspn.c",
293 "upstream-freebsd/lib/libc/string/wcsdup.c",
294 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700295 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700296 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
297 "upstream-freebsd/lib/libc/string/wcsncat.c",
298 "upstream-freebsd/lib/libc/string/wcsncmp.c",
299 "upstream-freebsd/lib/libc/string/wcsncpy.c",
300 "upstream-freebsd/lib/libc/string/wcsnlen.c",
301 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700302 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700303 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700304 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700305 "upstream-freebsd/lib/libc/string/wcstok.c",
306 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700307 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700308 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700309 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800310 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700311 ],
312 arch: {
313 arm64: {
314 exclude_srcs: [
315 "upstream-freebsd/lib/libc/string/wmemmove.c",
316 ],
317 },
318 x86: {
319 exclude_srcs: [
320 "upstream-freebsd/lib/libc/string/wcschr.c",
321 "upstream-freebsd/lib/libc/string/wcscmp.c",
322 "upstream-freebsd/lib/libc/string/wcslen.c",
323 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700324 "upstream-freebsd/lib/libc/string/wmemcmp.c",
325 "upstream-freebsd/lib/libc/string/wcscat.c",
326 "upstream-freebsd/lib/libc/string/wcscpy.c",
327 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530328 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700329 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700330 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700331 },
332
Colin Cross50c21ab2015-10-31 23:03:05 -0700333 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700334 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700335 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700336 "-include freebsd-compat.h",
337 ],
338
Dan Willemsen208ae172015-09-16 16:33:27 -0700339 local_include_dirs: [
340 "upstream-freebsd/android/include",
341 ],
342
343 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700344}
345
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700346cc_library_static {
347 defaults: ["libc_defaults"],
348 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700349 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700350 ],
351
352 cflags: [
353 "-Wno-sign-compare",
354 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700355 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700356 ],
357
358 local_include_dirs: [
359 "upstream-freebsd/android/include",
360 ],
361
362 name: "libc_freebsd_large_stack",
363}
364
Dan Willemsen208ae172015-09-16 16:33:27 -0700365// ========================================================
366// libc_netbsd.a - upstream NetBSD C library code
367// ========================================================
368//
369// These files are built with the netbsd-compat.h header file
370// automatically included.
371
372cc_library_static {
373
Colin Cross50c21ab2015-10-31 23:03:05 -0700374 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700375 srcs: [
376 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700377 "upstream-netbsd/lib/libc/gen/nice.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700378 "upstream-netbsd/lib/libc/gen/psignal.c",
379 "upstream-netbsd/lib/libc/gen/utime.c",
380 "upstream-netbsd/lib/libc/gen/utmp.c",
381 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
382 "upstream-netbsd/lib/libc/regex/regcomp.c",
383 "upstream-netbsd/lib/libc/regex/regerror.c",
384 "upstream-netbsd/lib/libc/regex/regexec.c",
385 "upstream-netbsd/lib/libc/regex/regfree.c",
386 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700387 "upstream-netbsd/lib/libc/stdlib/drand48.c",
388 "upstream-netbsd/lib/libc/stdlib/erand48.c",
389 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
390 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700391 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
392 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
393 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
394 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
395 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
396 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
397 "upstream-netbsd/lib/libc/stdlib/seed48.c",
398 "upstream-netbsd/lib/libc/stdlib/srand48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700399 ],
400 multilib: {
401 lib32: {
402 // LP32 cruft
403 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
404 },
405 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700406 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700407 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800408 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700409 "-DPOSIX_MISTAKE",
410 "-include netbsd-compat.h",
411 ],
412
Dan Willemsen208ae172015-09-16 16:33:27 -0700413 local_include_dirs: [
414 "upstream-netbsd/android/include",
415 "upstream-netbsd/lib/libc/include",
416 ],
417
418 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700419}
420
421// ========================================================
422// libc_openbsd_ndk.a - upstream OpenBSD C library code
423// that can be safely included in the libc_ndk.a (doesn't
424// contain any troublesome global data or constructors).
425// ========================================================
426//
427// These files are built with the openbsd-compat.h header file
428// automatically included.
429
430cc_library_static {
431 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700432 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700433 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700434 "upstream-openbsd/lib/libc/gen/alarm.c",
435 "upstream-openbsd/lib/libc/gen/ctype_.c",
436 "upstream-openbsd/lib/libc/gen/daemon.c",
437 "upstream-openbsd/lib/libc/gen/err.c",
438 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700439 "upstream-openbsd/lib/libc/gen/fnmatch.c",
440 "upstream-openbsd/lib/libc/gen/ftok.c",
441 "upstream-openbsd/lib/libc/gen/getprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/gen/verr.c",
444 "upstream-openbsd/lib/libc/gen/verrx.c",
445 "upstream-openbsd/lib/libc/gen/vwarn.c",
446 "upstream-openbsd/lib/libc/gen/vwarnx.c",
447 "upstream-openbsd/lib/libc/gen/warn.c",
448 "upstream-openbsd/lib/libc/gen/warnx.c",
449 "upstream-openbsd/lib/libc/locale/btowc.c",
450 "upstream-openbsd/lib/libc/locale/mbrlen.c",
451 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
452 "upstream-openbsd/lib/libc/locale/mbtowc.c",
453 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700454 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
455 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700456 "upstream-openbsd/lib/libc/locale/wcstoll.c",
457 "upstream-openbsd/lib/libc/locale/wcstombs.c",
458 "upstream-openbsd/lib/libc/locale/wcstoul.c",
459 "upstream-openbsd/lib/libc/locale/wcstoull.c",
460 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
461 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
462 "upstream-openbsd/lib/libc/locale/wctob.c",
463 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700464 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700465 "upstream-openbsd/lib/libc/net/htonl.c",
466 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
468 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
469 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
471 "upstream-openbsd/lib/libc/net/inet_ntop.c",
472 "upstream-openbsd/lib/libc/net/inet_pton.c",
473 "upstream-openbsd/lib/libc/net/ntohl.c",
474 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800475 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700476 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700477 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
478 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700479 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700480 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700481 "upstream-openbsd/lib/libc/stdio/fputwc.c",
482 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700483 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700484 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700485 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700486 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700487 "upstream-openbsd/lib/libc/stdio/makebuf.c",
488 "upstream-openbsd/lib/libc/stdio/mktemp.c",
489 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
490 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700491 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700492 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700493 "upstream-openbsd/lib/libc/stdio/tempnam.c",
494 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
495 "upstream-openbsd/lib/libc/stdio/ungetc.c",
496 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
497 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
498 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700499 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
500 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
501 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700502 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700503 "upstream-openbsd/lib/libc/stdio/wsetup.c",
504 "upstream-openbsd/lib/libc/stdlib/abs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800505 "upstream-openbsd/lib/libc/stdlib/div.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700506 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700507 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700508 "upstream-openbsd/lib/libc/stdlib/insque.c",
509 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
510 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
511 "upstream-openbsd/lib/libc/stdlib/labs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800512 "upstream-openbsd/lib/libc/stdlib/ldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700513 "upstream-openbsd/lib/libc/stdlib/llabs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800514 "upstream-openbsd/lib/libc/stdlib/lldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700515 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700516 "upstream-openbsd/lib/libc/stdlib/remque.c",
517 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700518 "upstream-openbsd/lib/libc/stdlib/tfind.c",
519 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800520 "upstream-openbsd/lib/libc/string/memccpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700521 "upstream-openbsd/lib/libc/string/strcasecmp.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800522 "upstream-openbsd/lib/libc/string/strcasestr.c",
523 "upstream-openbsd/lib/libc/string/strcoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700524 "upstream-openbsd/lib/libc/string/strcspn.c",
525 "upstream-openbsd/lib/libc/string/strdup.c",
526 "upstream-openbsd/lib/libc/string/strndup.c",
527 "upstream-openbsd/lib/libc/string/strpbrk.c",
528 "upstream-openbsd/lib/libc/string/strsep.c",
529 "upstream-openbsd/lib/libc/string/strspn.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700530 "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 Hughesc6b38ae2019-11-22 11:15:42 -0800557 "upstream-openbsd/lib/libc/string/strstr.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700558 ],
559 cflags: [
560 "-include openbsd-compat.h",
561 "-Wno-sign-compare",
562 "-Wframe-larger-than=5000",
563 ],
564
565 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700566 "upstream-openbsd/android/include/",
567 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700568 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700569 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700570 ],
571}
572
Dan Willemsen208ae172015-09-16 16:33:27 -0700573// ========================================================
574// libc_openbsd.a - upstream OpenBSD C library code
575// ========================================================
576//
577// These files are built with the openbsd-compat.h header file
578// automatically included.
579cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700580 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700581 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800582 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700583 "upstream-openbsd/lib/libc/crypt/arc4random.c",
584 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
585
586 // May be overriden by per-arch optimized versions
587 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700588 "upstream-openbsd/lib/libc/string/memrchr.c",
589 "upstream-openbsd/lib/libc/string/stpcpy.c",
590 "upstream-openbsd/lib/libc/string/stpncpy.c",
591 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700592 "upstream-openbsd/lib/libc/string/strcpy.c",
593 "upstream-openbsd/lib/libc/string/strlcat.c",
594 "upstream-openbsd/lib/libc/string/strlcpy.c",
595 "upstream-openbsd/lib/libc/string/strncat.c",
596 "upstream-openbsd/lib/libc/string/strncmp.c",
597 "upstream-openbsd/lib/libc/string/strncpy.c",
598 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700599
600 arch: {
601 arm: {
602 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700603 "upstream-openbsd/lib/libc/string/strcpy.c",
Haibo Huangea9957a2018-11-19 11:00:32 -0800604 "upstream-openbsd/lib/libc/string/stpcpy.c",
605 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700606 ],
607 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700608 arm64: {
609 exclude_srcs: [
610 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700611 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700612 "upstream-openbsd/lib/libc/string/strcpy.c",
613 "upstream-openbsd/lib/libc/string/strncmp.c",
614 ],
615 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700616 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800617 exclude_srcs: [
618 "upstream-openbsd/lib/libc/string/memchr.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800619 "upstream-openbsd/lib/libc/string/memrchr.c",
620 "upstream-openbsd/lib/libc/string/stpcpy.c",
621 "upstream-openbsd/lib/libc/string/stpncpy.c",
622 "upstream-openbsd/lib/libc/string/strcat.c",
623 "upstream-openbsd/lib/libc/string/strcpy.c",
624 "upstream-openbsd/lib/libc/string/strncmp.c",
625 "upstream-openbsd/lib/libc/string/strncpy.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700626 "upstream-openbsd/lib/libc/string/strlcat.c",
627 "upstream-openbsd/lib/libc/string/strlcpy.c",
628 "upstream-openbsd/lib/libc/string/strncat.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800629 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700630 },
631
632 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800633 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800634 "upstream-openbsd/lib/libc/string/stpcpy.c",
635 "upstream-openbsd/lib/libc/string/stpncpy.c",
636 "upstream-openbsd/lib/libc/string/strcat.c",
637 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800638 "upstream-openbsd/lib/libc/string/strncat.c",
639 "upstream-openbsd/lib/libc/string/strncmp.c",
640 "upstream-openbsd/lib/libc/string/strncpy.c",
641 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700642 },
643 },
644
Colin Cross50c21ab2015-10-31 23:03:05 -0700645 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700646 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700647 "-Wno-unused-parameter",
648 "-include openbsd-compat.h",
649 ],
650
Dan Willemsen208ae172015-09-16 16:33:27 -0700651 local_include_dirs: [
652 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700653 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700654 ],
655
656 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700657}
658
659// ========================================================
660// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
661// ========================================================
662//
663// These files are built with the openbsd-compat.h header file
664// automatically included.
665
666cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700667 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700668 srcs: [
669 "upstream-openbsd/android/gdtoa_support.cpp",
670 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
671 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
672 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
673 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
674 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
675 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
676 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
677 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
678 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
679 "upstream-openbsd/lib/libc/gdtoa/misc.c",
680 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
681 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
682 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
683 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
684 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
685 "upstream-openbsd/lib/libc/gdtoa/sum.c",
686 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
687 ],
688 multilib: {
689 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800690 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700691 },
692 },
693
Colin Cross50c21ab2015-10-31 23:03:05 -0700694 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700695 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700696 "-include openbsd-compat.h",
697 ],
698
Dan Willemsen208ae172015-09-16 16:33:27 -0700699 local_include_dirs: [
700 "private",
701 "upstream-openbsd/android/include",
702 "upstream-openbsd/lib/libc/include",
703 ],
704
705 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700706}
707
708// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700709// libc_fortify.a - container for our FORITFY
710// implementation details
711// ========================================================
712cc_library_static {
713 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700714 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700715
716 name: "libc_fortify",
717
718 // Disable FORTIFY for the compilation of these, so we don't end up having
719 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800720 cflags: [
721 "-U_FORTIFY_SOURCE",
722 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
723 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700724
725 arch: {
726 arm: {
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800727 cflags: [
728 "-DNO___MEMCPY_CHK",
729 "-DRENAME___STRCAT_CHK",
730 "-DRENAME___STRCPY_CHK",
731 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700732 srcs: [
733 "arch-arm/generic/bionic/__memcpy_chk.S",
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800734
735 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
736 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
737
738 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
739 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
740
741 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
742 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
743
744 "arch-arm/krait/bionic/__strcat_chk.S",
745 "arch-arm/krait/bionic/__strcpy_chk.S",
746
747 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
748 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
749
Haibo Huang01bfd892018-12-03 15:05:16 -0800750 "arch-arm/cortex-a55/bionic/__strcat_chk.S",
751 "arch-arm/cortex-a55/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700752 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700753 },
754 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700755 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700756 srcs: [
757 "arch-arm64/generic/bionic/__memcpy_chk.S",
758 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700759 },
760 },
761}
762
763// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700764// libc_bionic.a - home-grown C library code
765// ========================================================
766
767cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700768 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700769 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800770 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700771 "bionic/sysconf.cpp",
772 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700773 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700774
Josh Gao10ec9282017-04-03 15:13:29 -0700775 // The following must not be statically linked into libc_ndk.a, because
776 // debuggerd will look for the abort message in libc.so's copy.
777 "bionic/android_set_abort_message.cpp",
778
Dan Willemsen208ae172015-09-16 16:33:27 -0700779 "bionic/strchr.cpp",
Peter Collingbourne337a5b32020-02-21 12:11:02 -0800780 "bionic/strchrnul.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700781 "bionic/strnlen.c",
782 "bionic/strrchr.cpp",
783 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700784
785 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700786 arm: {
Elliott Hughes1b61d782019-06-04 10:38:34 -0700787 asflags: libc_common_flags + ["-mno-restrict-it"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700788 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800789 "arch-arm/generic/bionic/memcmp.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700790 "arch-arm/generic/bionic/memmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800791 "arch-arm/generic/bionic/memset.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800792 "arch-arm/generic/bionic/stpcpy.c",
793 "arch-arm/generic/bionic/strcat.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800794 "arch-arm/generic/bionic/strcmp.S",
795 "arch-arm/generic/bionic/strcpy.S",
796 "arch-arm/generic/bionic/strlen.c",
797
Ryan Prichard45024fe2018-12-30 21:10:26 -0800798 "arch-arm/bionic/__aeabi_read_tp.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700799 "arch-arm/bionic/__bionic_clone.S",
Yi Kongb410d0e2019-04-22 16:00:46 -0700800 "arch-arm/bionic/__restore.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700801 "arch-arm/bionic/_exit_with_stack_teardown.S",
Yi Kongb410d0e2019-04-22 16:00:46 -0700802 "arch-arm/bionic/atomics_arm.c",
803 "arch-arm/bionic/bpabi.c",
Yi Kong165b1cf2019-02-13 14:10:10 -0800804 "arch-arm/bionic/libcrt_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700805 "arch-arm/bionic/popcount_tab.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700806 "arch-arm/bionic/setjmp.S",
807 "arch-arm/bionic/syscall.S",
808 "arch-arm/bionic/vfork.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800809
810 "arch-arm/cortex-a15/bionic/memcpy.S",
811 "arch-arm/cortex-a15/bionic/memmove.S",
812 "arch-arm/cortex-a15/bionic/memset.S",
813 "arch-arm/cortex-a15/bionic/stpcpy.S",
814 "arch-arm/cortex-a15/bionic/strcat.S",
815 "arch-arm/cortex-a15/bionic/strcmp.S",
816 "arch-arm/cortex-a15/bionic/strcpy.S",
817 "arch-arm/cortex-a15/bionic/strlen.S",
818
819 "arch-arm/cortex-a7/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800820 "arch-arm/cortex-a7/bionic/memset.S",
821
822 "arch-arm/cortex-a9/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800823 "arch-arm/cortex-a9/bionic/memset.S",
824 "arch-arm/cortex-a9/bionic/stpcpy.S",
825 "arch-arm/cortex-a9/bionic/strcat.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800826 "arch-arm/cortex-a9/bionic/strcpy.S",
827 "arch-arm/cortex-a9/bionic/strlen.S",
828
829 "arch-arm/krait/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800830 "arch-arm/krait/bionic/memset.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800831
832 "arch-arm/cortex-a53/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800833
Haibo Huang01bfd892018-12-03 15:05:16 -0800834 "arch-arm/cortex-a55/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800835
836 "arch-arm/kryo/bionic/memcpy.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700837 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700838 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700839 arm64: {
840 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700841 "arch-arm64/generic/bionic/memcpy.S",
842 "arch-arm64/generic/bionic/memmove.S",
843 "arch-arm64/generic/bionic/memset.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700844 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800845
Peter Collingbourne900d07d2019-10-28 13:11:00 -0700846 "arch-arm64/mte/bionic/memchr.c",
Peter Collingbourne337a5b32020-02-21 12:11:02 -0800847 "arch-arm64/mte/bionic/stpcpy.S",
848 "arch-arm64/mte/bionic/strchrnul.cpp",
849 "arch-arm64/mte/bionic/strrchr.cpp",
Peter Collingbourne900d07d2019-10-28 13:11:00 -0700850 "arch-arm64/mte/bionic/strcmp.c",
Peter Collingbourne337a5b32020-02-21 12:11:02 -0800851 "arch-arm64/mte/bionic/strcpy.S",
Peter Collingbourne900d07d2019-10-28 13:11:00 -0700852 "arch-arm64/mte/bionic/strncmp.c",
853 "arch-arm64/mte/bionic/strnlen.c",
854
Dan Willemsen3e621712016-02-03 21:48:08 -0800855 "arch-arm64/bionic/__bionic_clone.S",
856 "arch-arm64/bionic/_exit_with_stack_teardown.S",
857 "arch-arm64/bionic/setjmp.S",
858 "arch-arm64/bionic/syscall.S",
859 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700860 ],
861 exclude_srcs: [
862 "bionic/__memcpy_chk.cpp",
863 "bionic/strchr.cpp",
Peter Collingbourne337a5b32020-02-21 12:11:02 -0800864 "bionic/strchrnul.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700865 "bionic/strnlen.c",
Peter Collingbourne337a5b32020-02-21 12:11:02 -0800866 "bionic/strrchr.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700867 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700868 },
869
Dan Willemsen208ae172015-09-16 16:33:27 -0700870 x86: {
871 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700872 "arch-x86/generic/string/memcmp.S",
873 "arch-x86/generic/string/strcmp.S",
874 "arch-x86/generic/string/strncmp.S",
875 "arch-x86/generic/string/strcat.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700876
877 "arch-x86/generic/string/strlcat.c",
878 "arch-x86/generic/string/strlcpy.c",
879 "arch-x86/generic/string/strncat.c",
880 "arch-x86/generic/string/wcscat.c",
881 "arch-x86/generic/string/wcscpy.c",
882 "arch-x86/generic/string/wmemcmp.c",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530883 "arch-x86/generic/string/wmemset.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700884
Dan Willemsen208ae172015-09-16 16:33:27 -0700885 "arch-x86/atom/string/sse2-memchr-atom.S",
886 "arch-x86/atom/string/sse2-memrchr-atom.S",
887 "arch-x86/atom/string/sse2-strchr-atom.S",
888 "arch-x86/atom/string/sse2-strnlen-atom.S",
889 "arch-x86/atom/string/sse2-strrchr-atom.S",
890 "arch-x86/atom/string/sse2-wcschr-atom.S",
891 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
892 "arch-x86/atom/string/sse2-wcslen-atom.S",
893 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700894 "arch-x86/silvermont/string/sse2-memmove-slm.S",
895 "arch-x86/silvermont/string/sse2-memset-slm.S",
896 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
897 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
898 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
899 "arch-x86/silvermont/string/sse2-strlen-slm.S",
900 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800901
902 "arch-x86/bionic/__bionic_clone.S",
903 "arch-x86/bionic/_exit_with_stack_teardown.S",
Yi Kong165b1cf2019-02-13 14:10:10 -0800904 "arch-x86/bionic/libcrt_compat.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800905 "arch-x86/bionic/__restore.S",
906 "arch-x86/bionic/setjmp.S",
907 "arch-x86/bionic/syscall.S",
908 "arch-x86/bionic/vfork.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700909
910 // ssse3 functions
911 "arch-x86/atom/string/ssse3-strcat-atom.S",
912 "arch-x86/atom/string/ssse3-strcmp-atom.S",
913 "arch-x86/atom/string/ssse3-strlcat-atom.S",
914 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
915 "arch-x86/atom/string/ssse3-strncat-atom.S",
916 "arch-x86/atom/string/ssse3-strncmp-atom.S",
917 "arch-x86/atom/string/ssse3-wcscat-atom.S",
918 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
919
920 // sse4 functions
921 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
922 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
923
924 // atom functions
925 "arch-x86/atom/string/sse2-memset-atom.S",
926 "arch-x86/atom/string/sse2-strlen-atom.S",
927 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Haibo Huange1413622018-11-13 14:20:43 -0800928 "arch-x86/atom/string/ssse3-memmove-atom.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700929 "arch-x86/atom/string/ssse3-strcpy-atom.S",
930 "arch-x86/atom/string/ssse3-strncpy-atom.S",
931 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530932
933 // avx2 functions
934 "arch-x86/kabylake/string/avx2-wmemset-kbl.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700935 ],
Dan Willemsen268a6732015-10-15 14:49:45 -0700936
937 exclude_srcs: [
938 "bionic/strchr.cpp",
939 "bionic/strnlen.c",
940 "bionic/strrchr.cpp",
941 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700942 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700943 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700944 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700945 "arch-x86_64/string/sse2-memmove-slm.S",
946 "arch-x86_64/string/sse2-memset-slm.S",
947 "arch-x86_64/string/sse2-stpcpy-slm.S",
948 "arch-x86_64/string/sse2-stpncpy-slm.S",
949 "arch-x86_64/string/sse2-strcat-slm.S",
950 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700951 "arch-x86_64/string/sse2-strlen-slm.S",
952 "arch-x86_64/string/sse2-strncat-slm.S",
953 "arch-x86_64/string/sse2-strncpy-slm.S",
954 "arch-x86_64/string/sse4-memcmp-slm.S",
955 "arch-x86_64/string/ssse3-strcmp-slm.S",
956 "arch-x86_64/string/ssse3-strncmp-slm.S",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530957 "arch-x86_64/string/avx2-wmemset-kbl.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800958
959 "arch-x86_64/bionic/__bionic_clone.S",
960 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
961 "arch-x86_64/bionic/__restore_rt.S",
962 "arch-x86_64/bionic/setjmp.S",
963 "arch-x86_64/bionic/syscall.S",
964 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700965 ],
966 },
Dan Willemsen268a6732015-10-15 14:49:45 -0700967 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700968
Colin Cross50c21ab2015-10-31 23:03:05 -0700969 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -0700970 include_dirs: ["bionic/libstdc++/include"],
971 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -0700972}
973
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000974genrule {
975 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -0800976 out: ["generated_android_ids.h"],
977 srcs: [":android_filesystem_config_header"],
978 tool_files: ["fs_config_generator.py"],
979 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000980}
981
Dan Willemsen268a6732015-10-15 14:49:45 -0700982// ========================================================
983// libc_bionic_ndk.a- The portions of libc_bionic that can
984// be safely used in libc_ndk.a (no troublesome global data
985// or constructors).
986// ========================================================
987cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700988 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -0700989 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -0700990 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -0700991 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -0700992 "bionic/__cmsg_nxthdr.cpp",
993 "bionic/__errno.cpp",
994 "bionic/__gnu_basename.cpp",
995 "bionic/__libc_current_sigrtmax.cpp",
996 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -0700997 "bionic/abort.cpp",
998 "bionic/accept.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -0700999 "bionic/access.cpp",
1000 "bionic/arpa_inet.cpp",
1001 "bionic/assert.cpp",
1002 "bionic/atof.cpp",
Ryan Prichard083d8502019-01-24 13:47:13 -08001003 "bionic/bionic_allocator.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001004 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001005 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001006 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001007 "bionic/bionic_systrace.cpp",
1008 "bionic/bionic_time_conversions.cpp",
1009 "bionic/brk.cpp",
1010 "bionic/c16rtomb.cpp",
1011 "bionic/c32rtomb.cpp",
1012 "bionic/chmod.cpp",
1013 "bionic/chown.cpp",
1014 "bionic/clearenv.cpp",
1015 "bionic/clock.cpp",
1016 "bionic/clock_getcpuclockid.cpp",
1017 "bionic/clock_nanosleep.cpp",
1018 "bionic/clone.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001019 "bionic/ctype.cpp",
1020 "bionic/dirent.cpp",
Josh Gao97271922019-11-06 13:15:00 -08001021 "bionic/dup.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001022 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001023 "bionic/error.cpp",
1024 "bionic/eventfd_read.cpp",
1025 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001026 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001027 "bionic/faccessat.cpp",
1028 "bionic/fchmod.cpp",
1029 "bionic/fchmodat.cpp",
Josh Gao97271922019-11-06 13:15:00 -08001030 "bionic/fcntl.cpp",
Josh Gaof6e5b582018-06-01 15:30:54 -07001031 "bionic/fdsan.cpp",
Josh Gao97271922019-11-06 13:15:00 -08001032 "bionic/fdtrack.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001033 "bionic/ffs.cpp",
1034 "bionic/fgetxattr.cpp",
1035 "bionic/flistxattr.cpp",
1036 "bionic/flockfile.cpp",
1037 "bionic/fpclassify.cpp",
1038 "bionic/fsetxattr.cpp",
1039 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001040 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001041 "bionic/futimens.cpp",
1042 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001043 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001044 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001045 "bionic/gethostname.cpp",
Elliott Hughes2d0b28b2018-10-23 11:23:00 -07001046 "bionic/getloadavg.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001047 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001048 "bionic/getpgrp.cpp",
1049 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001050 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001051 "bionic/gettid.cpp",
Elliott Hughesce934e32018-09-06 13:26:08 -07001052 "bionic/get_device_api_level.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001053 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001054 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001055 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001056 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001057 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001058 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001059 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001060 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001061 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001062 "bionic/lchown.cpp",
1063 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001064 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001065 "bionic/libgen.cpp",
1066 "bionic/link.cpp",
1067 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001068 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001069 "bionic/lstat.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001070 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001071 "bionic/mbrtoc16.cpp",
1072 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001073 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001074 "bionic/mempcpy.cpp",
1075 "bionic/mkdir.cpp",
1076 "bionic/mkfifo.cpp",
1077 "bionic/mknod.cpp",
1078 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001079 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001080 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001081 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001082 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001083 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001084 "bionic/open.cpp",
1085 "bionic/pathconf.cpp",
1086 "bionic/pause.cpp",
1087 "bionic/pipe.cpp",
1088 "bionic/poll.cpp",
1089 "bionic/posix_fadvise.cpp",
1090 "bionic/posix_fallocate.cpp",
1091 "bionic/posix_madvise.cpp",
1092 "bionic/posix_timers.cpp",
1093 "bionic/ptrace.cpp",
1094 "bionic/pty.cpp",
1095 "bionic/raise.cpp",
1096 "bionic/rand.cpp",
1097 "bionic/readlink.cpp",
Elliott Hughes22fb2672019-11-01 08:07:25 -07001098 "bionic/realpath.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001099 "bionic/reboot.cpp",
1100 "bionic/recv.cpp",
Josh Gao97271922019-11-06 13:15:00 -08001101 "bionic/recvmsg.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001102 "bionic/rename.cpp",
1103 "bionic/rmdir.cpp",
1104 "bionic/scandir.cpp",
1105 "bionic/sched_getaffinity.cpp",
1106 "bionic/sched_getcpu.cpp",
1107 "bionic/semaphore.cpp",
1108 "bionic/send.cpp",
1109 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001110 "bionic/seteuid.cpp",
1111 "bionic/setpgrp.cpp",
1112 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001113 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001114 "bionic/sigprocmask.cpp",
Elliott Hughesca3f8e42019-10-28 15:59:38 -07001115 "bionic/sleep.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001116 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001117 "bionic/stat.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001118 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001119 "bionic/strerror.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001120 "bionic/string_l.cpp",
1121 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001122 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001123 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001124 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001125 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001126 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001127 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001128 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001129 "bionic/sys_msg.cpp",
1130 "bionic/sys_sem.cpp",
1131 "bionic/sys_shm.cpp",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001132 "bionic/sys_signalfd.cpp",
Elliott Hughes261bd742019-08-29 20:45:14 -07001133 "bionic/sys_statfs.cpp",
1134 "bionic/sys_statvfs.cpp",
Elliott Hughes449eff02016-06-08 19:51:20 -07001135 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001136 "bionic/sysinfo.cpp",
1137 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001138 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001139 "bionic/system_property_api.cpp",
1140 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001141 "bionic/tdestroy.cpp",
1142 "bionic/termios.cpp",
1143 "bionic/thread_private.cpp",
Elliott Hughes42067112019-04-18 14:27:24 -07001144 "bionic/threads.cpp",
Elliott Hughesf98d87b2018-07-17 13:21:05 -07001145 "bionic/timespec_get.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001146 "bionic/tmpfile.cpp",
1147 "bionic/umount.cpp",
1148 "bionic/unlink.cpp",
Elliott Hughesca3f8e42019-10-28 15:59:38 -07001149 "bionic/usleep.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001150 "bionic/wait.cpp",
1151 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001152 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001153 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001154 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001155 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001156 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001157
1158 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1159 // which will be overridden by the actual one in libc.so.
1160 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001161 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001162
Dan Willemsen208ae172015-09-16 16:33:27 -07001163 multilib: {
1164 lib32: {
1165 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001166 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001167 },
1168 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001169 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001170 treble_linker_namespaces: {
1171 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001172 },
1173 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001174 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001175 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001176 local_include_dirs: ["stdio"],
1177 include_dirs: ["bionic/libstdc++/include"],
1178 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001179 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001180}
1181
Dan Willemsen208ae172015-09-16 16:33:27 -07001182// ========================================================
1183// libc_pthread.a - pthreads parts that previously lived in
1184// libc_bionic.a. Relocated to their own library because
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001185// they can't be included in libc_ndk.a (as the layout of
Dan Willemsen208ae172015-09-16 16:33:27 -07001186// pthread_t has changed over the years and has ABI
1187// compatibility issues).
1188// ========================================================
1189
1190cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001191 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001192 srcs: [
Ryan Prichard45d13492019-01-03 02:51:30 -08001193 "bionic/bionic_elf_tls.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001194 "bionic/pthread_atfork.cpp",
1195 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001196 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001197 "bionic/pthread_cond.cpp",
1198 "bionic/pthread_create.cpp",
1199 "bionic/pthread_detach.cpp",
1200 "bionic/pthread_equal.cpp",
1201 "bionic/pthread_exit.cpp",
1202 "bionic/pthread_getcpuclockid.cpp",
1203 "bionic/pthread_getschedparam.cpp",
1204 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001205 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001206 "bionic/pthread_join.cpp",
1207 "bionic/pthread_key.cpp",
1208 "bionic/pthread_kill.cpp",
1209 "bionic/pthread_mutex.cpp",
1210 "bionic/pthread_once.cpp",
1211 "bionic/pthread_rwlock.cpp",
Josh Gao726b63f2018-08-27 16:00:58 -07001212 "bionic/pthread_sigqueue.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001213 "bionic/pthread_self.cpp",
1214 "bionic/pthread_setname_np.cpp",
1215 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001216 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001217
1218 // The following implementations depend on pthread data or implementation,
1219 // so we can't include them in libc_ndk.a.
1220 "bionic/__cxa_thread_atexit_impl.cpp",
Peter Collingbourne5f45c182020-01-14 17:59:41 -08001221 "bionic/android_unsafe_frame_pointer_chase.cpp",
Ryan Prichardafa983c2020-02-04 15:46:15 -08001222 "bionic/atexit.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001223 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001224 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001225
Colin Cross50c21ab2015-10-31 23:03:05 -07001226 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001227 include_dirs: ["bionic/libstdc++/include"],
Peter Collingbourne5f45c182020-01-14 17:59:41 -08001228 header_libs: ["bionic_libc_platform_headers"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001229 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001230}
1231
1232// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001233// libc_syscalls.a
1234// ========================================================
1235
Elliott Hughes782c4852019-04-16 12:31:00 -07001236genrule {
1237 name: "syscalls-arm.S",
1238 out: ["syscalls-arm.S"],
1239 srcs: ["SYSCALLS.TXT"],
1240 tool_files: [":bionic-gensyscalls"],
1241 cmd: "$(location :bionic-gensyscalls) arm $(in) > $(out)",
1242}
1243
1244genrule {
1245 name: "syscalls-arm64.S",
1246 out: ["syscalls-arm64.S"],
1247 srcs: ["SYSCALLS.TXT"],
1248 tool_files: [":bionic-gensyscalls"],
1249 cmd: "$(location :bionic-gensyscalls) arm64 $(in) > $(out)",
1250}
1251
1252genrule {
1253 name: "syscalls-x86.S",
1254 out: ["syscalls-x86.S"],
1255 srcs: ["SYSCALLS.TXT"],
1256 tool_files: [":bionic-gensyscalls"],
1257 cmd: "$(location :bionic-gensyscalls) x86 $(in) > $(out)",
1258}
1259
1260genrule {
1261 name: "syscalls-x86_64.S",
1262 out: ["syscalls-x86_64.S"],
1263 srcs: ["SYSCALLS.TXT"],
1264 tool_files: [":bionic-gensyscalls"],
1265 cmd: "$(location :bionic-gensyscalls) x86_64 $(in) > $(out)",
1266}
1267
Dan Willemsen208ae172015-09-16 16:33:27 -07001268cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001269 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001270 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001271 arch: {
1272 arm: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001273 srcs: [":syscalls-arm.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001274 },
1275 arm64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001276 srcs: [":syscalls-arm64.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001277 },
1278 x86: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001279 srcs: [":syscalls-x86.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001280 },
1281 x86_64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001282 srcs: [":syscalls-x86_64.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001283 },
1284 },
1285 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001286}
1287
1288// ========================================================
1289// libc_aeabi.a
1290// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1291// to avoid infinite recursion. For the other architectures we just build an
1292// empty library to keep this makefile simple.
1293// ========================================================
1294
1295cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001296 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001297 arch: {
1298 arm: {
1299 srcs: ["arch-arm/bionic/__aeabi.c"],
1300 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001301 },
1302 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001303 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001304}
1305
1306// ========================================================
1307// libc_ndk.a
1308// Compatibility library for the NDK. This library contains
1309// all the parts of libc that are safe to statically link.
1310// We can't safely statically link things that can only run
1311// on a certain version of the OS. Examples include
1312// anything that talks to netd (a large portion of the DNS
1313// code) and anything that is dependent on the layout of a
1314// data structure that has changed across releases (such as
1315// pthread_t).
1316// ========================================================
1317
1318cc_library_static {
1319 name: "libc_ndk",
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001320 defaults: [
1321 "libc_defaults",
1322 "libc_native_allocator_defaults",
1323 ],
Yifan Hong5a39cee2020-01-21 16:43:56 -08001324 ramdisk_available: false,
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001325 srcs: libc_common_src_files + [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001326 "bionic/gwp_asan_wrappers.cpp",
Peter Collingbourne1e110fb2020-01-09 10:48:22 -08001327 "bionic/heap_tagging.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001328 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001329 "bionic/malloc_limit.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001330 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001331 multilib: {
1332 lib32: {
1333 srcs: libc_common_src_files_32,
1334 },
1335 },
1336 arch: {
1337 arm: {
1338 srcs: [
1339 "arch-arm/bionic/exidx_dynamic.c",
1340 "arch-common/bionic/crtbegin_so.c",
1341 "arch-arm/bionic/atexit_legacy.c",
1342 "arch-common/bionic/crtend_so.S",
1343 ],
1344 whole_static_libs: ["libc_aeabi"],
1345 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001346 },
1347
Colin Cross50c21ab2015-10-31 23:03:05 -07001348 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001349 "-fvisibility=hidden",
1350 "-DLIBC_STATIC",
1351 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001352
1353 whole_static_libs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001354 "gwp_asan",
Peter Collingbourne337a5b32020-02-21 12:11:02 -08001355 "libarm-optimized-routines-string",
Dan Willemsen208ae172015-09-16 16:33:27 -07001356 "libc_bionic_ndk",
Ryan Prichard249757b2019-11-01 17:18:28 -07001357 "libc_bootstrap",
George Burgess IV6cb06872017-07-21 13:28:42 -07001358 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001359 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001360 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001361 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001362 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001363 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001364 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001365 "libc_syscalls",
1366 "libc_tzcode",
1367 "libm",
Elliott Hughes816fab92016-05-27 17:57:46 -07001368 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001369 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001370}
1371
1372// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001373// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001374// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001375cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001376 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001377 srcs: libc_common_src_files,
1378 multilib: {
1379 lib32: {
1380 srcs: libc_common_src_files_32,
1381 },
1382 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001383 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001384
1385 whole_static_libs: [
Peter Collingbourne337a5b32020-02-21 12:11:02 -08001386 "libarm-optimized-routines-string",
Dan Willemsen208ae172015-09-16 16:33:27 -07001387 "libc_bionic",
1388 "libc_bionic_ndk",
Ryan Prichard249757b2019-11-01 17:18:28 -07001389 "libc_bootstrap",
Dan Willemsen208ae172015-09-16 16:33:27 -07001390 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001391 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001392 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001393 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001394 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001395 "libc_netbsd",
1396 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001397 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001398 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001399 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001400 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001401 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001402 ],
1403
1404 arch: {
1405 arm: {
1406 whole_static_libs: ["libc_aeabi"],
1407 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001408 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001409}
1410
1411// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001412// libc_common.a
1413// ========================================================
1414
1415cc_library_static {
1416 defaults: ["libc_defaults"],
1417 name: "libc_common",
1418
1419 whole_static_libs: [
1420 "libc_nopthread",
1421 "libc_pthread",
1422 ],
1423}
1424
1425// ========================================================
Ryan Prichard249757b2019-11-01 17:18:28 -07001426// libc_static_dispatch.a
Haibo Huangf71edfa2018-11-12 10:06:56 -08001427// ========================================================
1428cc_library_static {
1429 defaults: ["libc_defaults"],
Ryan Prichard249757b2019-11-01 17:18:28 -07001430 name: "libc_static_dispatch",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001431
Haibo Huangb9244ff2018-08-11 10:12:13 -07001432 arch: {
1433 x86: {
1434 srcs: ["arch-x86/static_function_dispatch.S"],
1435 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001436 arm: {
1437 srcs: ["arch-arm/static_function_dispatch.S"],
1438 },
Peter Collingbourne900d07d2019-10-28 13:11:00 -07001439 arm64: {
1440 srcs: ["arch-arm64/static_function_dispatch.S"],
1441 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001442 },
Haibo Huangf71edfa2018-11-12 10:06:56 -08001443}
1444
1445// ========================================================
Ryan Prichard249757b2019-11-01 17:18:28 -07001446// libc_dynamic_dispatch.a
Haibo Huangf71edfa2018-11-12 10:06:56 -08001447// ========================================================
1448cc_library_static {
1449 defaults: ["libc_defaults"],
Ryan Prichard249757b2019-11-01 17:18:28 -07001450 name: "libc_dynamic_dispatch",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001451
Haibo Huangb9244ff2018-08-11 10:12:13 -07001452 cflags: [
Peter Collingbourne36a56442019-10-31 17:11:54 -07001453 "-ffreestanding",
Haibo Huangb9244ff2018-08-11 10:12:13 -07001454 "-fno-stack-protector",
1455 "-fno-jump-tables",
1456 ],
1457 arch: {
1458 x86: {
1459 srcs: ["arch-x86/dynamic_function_dispatch.cpp"],
1460 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001461 arm: {
Elliott Hughes927fe992019-01-31 22:29:22 +00001462 srcs: ["arch-arm/dynamic_function_dispatch.cpp"],
Haibo Huangea9957a2018-11-19 11:00:32 -08001463 },
Peter Collingbourne900d07d2019-10-28 13:11:00 -07001464 arm64: {
1465 srcs: ["arch-arm64/dynamic_function_dispatch.cpp"],
1466 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001467 },
Ryan Prichard249757b2019-11-01 17:18:28 -07001468}
1469
1470// ========================================================
1471// libc_common_static.a For static binaries.
1472// ========================================================
1473cc_library_static {
1474 defaults: ["libc_defaults"],
1475 name: "libc_common_static",
Haibo Huangb9244ff2018-08-11 10:12:13 -07001476
Haibo Huangf71edfa2018-11-12 10:06:56 -08001477 whole_static_libs: [
1478 "libc_common",
Ryan Prichard249757b2019-11-01 17:18:28 -07001479 "libc_static_dispatch",
1480 ],
1481}
1482
1483// ========================================================
1484// libc_common_shared.a For shared libraries.
1485// ========================================================
1486cc_library_static {
1487 defaults: ["libc_defaults"],
1488 name: "libc_common_shared",
1489
1490 whole_static_libs: [
1491 "libc_common",
1492 "libc_dynamic_dispatch",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001493 ],
1494}
1495
Ryan Prichard22a6a052019-10-10 23:59:30 -07001496// Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static
1497// executable.
1498cc_library_static {
1499 name: "libc_unwind_static",
1500 defaults: ["libc_defaults"],
1501 cflags: ["-DLIBC_STATIC"],
1502
1503 srcs: ["bionic/dl_iterate_phdr_static.cpp"],
1504 arch: {
1505 // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs
1506 arm: {
1507 srcs: ["arch-arm/bionic/exidx_static.c"],
1508 },
1509 },
1510}
1511
Haibo Huangf71edfa2018-11-12 10:06:56 -08001512// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001513// libc_nomalloc.a
1514// ========================================================
1515//
Ryan Prichard249757b2019-11-01 17:18:28 -07001516// This is a version of the static C library used by the dynamic linker that exclude malloc. It also
1517// excludes functions selected using ifunc's (e.g. for string.h). Link in either
1518// libc_static_dispatch or libc_dynamic_dispatch to provide those functions.
Dan Willemsen208ae172015-09-16 16:33:27 -07001519
1520cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001521 name: "libc_nomalloc",
Colin Cross50c21ab2015-10-31 23:03:05 -07001522 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001523
Colin Crossa3f9fca2016-01-11 13:20:55 -08001524 whole_static_libs: [
Ryan Prichard249757b2019-11-01 17:18:28 -07001525 "libc_common",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001526 "libc_init_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001527 "libc_unwind_static",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001528 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001529}
1530
dimitryc0c0ef62018-12-05 16:33:52 +01001531filegroup {
1532 name: "libc_sources_shared",
1533 srcs: [
1534 "arch-common/bionic/crtbegin_so.c",
1535 "arch-common/bionic/crtbrand.S",
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001536 "bionic/gwp_asan_wrappers.cpp",
Peter Collingbourne1e110fb2020-01-09 10:48:22 -08001537 "bionic/heap_tagging.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001538 "bionic/icu.cpp",
1539 "bionic/malloc_common.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001540 "bionic/malloc_common_dynamic.cpp",
Ryan Savitski175c8862020-01-02 19:54:57 +00001541 "bionic/android_profiling_dynamic.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001542 "bionic/malloc_heapprofd.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001543 "bionic/malloc_limit.cpp",
Peter Collingbourne570de332019-12-11 10:00:58 -08001544 "bionic/ndk_cruft.cpp",
1545 "bionic/ndk_cruft_data.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001546 "bionic/NetdClient.cpp",
1547 "arch-common/bionic/crtend_so.S",
1548 ],
1549}
1550
1551filegroup {
1552 name: "libc_sources_static",
1553 srcs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001554 "bionic/gwp_asan_wrappers.cpp",
Peter Collingbourne1e110fb2020-01-09 10:48:22 -08001555 "bionic/heap_tagging.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001556 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001557 "bionic/malloc_limit.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001558 ],
1559}
1560
1561filegroup {
1562 name: "libc_sources_shared_arm",
1563 srcs: [
1564 "arch-arm/bionic/exidx_dynamic.c",
1565 "arch-arm/bionic/atexit_legacy.c",
1566 ],
1567}
1568
Dan Willemsen208ae172015-09-16 16:33:27 -07001569// ========================================================
1570// libc.a + libc.so
1571// ========================================================
1572cc_library {
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001573 defaults: [
1574 "libc_defaults",
1575 "libc_native_allocator_defaults",
1576 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001577 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001578 static_ndk_lib: true,
Logan Chien833cbe42018-10-19 17:57:54 +08001579 export_include_dirs: ["include"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001580 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001581 platform_sdk_version: {
1582 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1583 },
1584 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001585 static: {
dimitryc0c0ef62018-12-05 16:33:52 +01001586 srcs: [ ":libc_sources_static" ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001587 cflags: ["-DLIBC_STATIC"],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001588 whole_static_libs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001589 "gwp_asan",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001590 "libc_init_static",
1591 "libc_common_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001592 "libc_unwind_static",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001593 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001594 },
1595 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001596 srcs: [ ":libc_sources_shared" ],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001597 whole_static_libs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08001598 "gwp_asan",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001599 "libc_init_dynamic",
1600 "libc_common_shared",
1601 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001602 },
1603
Neil Fullera7db90f2019-04-25 09:28:27 +01001604 required: [
1605 "tzdata",
1606 "tz_version", // Version metadata for tzdata to help debugging.
1607 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001608
Colin Cross4ce94d22016-11-15 13:15:43 -08001609 // Do not pack libc.so relocations; see http://b/20645321 for details.
1610 pack_relocations: false,
1611
dimitry06016f22018-01-05 11:39:28 +01001612 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1613 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1614 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1615 // those new libraries from libgcc.a are not declared external; if that were the case,
1616 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1617 // on the external symbols from the dependent libraries. That would create a "cloaked"
1618 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001619
dimitry06016f22018-01-05 11:39:28 +01001620 shared_libs: [
1621 "ld-android",
1622 "libdl",
1623 ],
Jiyong Park3ff116a2019-04-02 23:04:52 +09001624 static_libs: [
1625 "libdl_android",
1626 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001627
1628 nocrt: true,
1629
Dan Willemsen208ae172015-09-16 16:33:27 -07001630 arch: {
1631 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001632 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001633 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001634 ldflags: ["-Wl,--hash-style=both"],
1635
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001636 version_script: ":libc.arm.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001637
Dan Willemsen208ae172015-09-16 16:33:27 -07001638 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001639 srcs: [":libc_sources_shared_arm"],
Dan Willemsen0c657082016-05-12 01:43:07 -07001640 // special for arm
1641 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001642 },
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001643
1644 // Arm 32 bit does not produce complete exidx unwind information
1645 // so keep the .debug_frame which is relatively small and does
1646 // include needed unwind information.
1647 // See b/132992102 for details.
1648 strip: {
1649 keep_symbols_and_debug_frame: true,
1650 },
Peter Collingbourneb061e772019-11-12 14:26:21 -08001651
Peter Collingbournef2b1e032019-12-10 17:41:16 -08001652 whole_static_libs: [ "libunwind_llvm" ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001653 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001654 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001655 version_script: ":libc.arm64.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001656
1657 // Leave the symbols in the shared library so that stack unwinders can produce
1658 // meaningful name resolution.
1659 strip: {
1660 keep_symbols: true,
1661 },
Peter Collingbournef2b1e032019-12-10 17:41:16 -08001662
1663 whole_static_libs: [ "libgcc_stripped" ],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001664 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001665 x86: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001666 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001667 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001668 ldflags: ["-Wl,--hash-style=both"],
1669
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001670 version_script: ":libc.x86.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001671
1672 // Leave the symbols in the shared library so that stack unwinders can produce
1673 // meaningful name resolution.
1674 strip: {
1675 keep_symbols: true,
1676 },
Peter Collingbournef2b1e032019-12-10 17:41:16 -08001677
1678 whole_static_libs: [ "libgcc_stripped" ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001679 },
1680 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001681 version_script: ":libc.x86_64.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001682
1683 // Leave the symbols in the shared library so that stack unwinders can produce
1684 // meaningful name resolution.
1685 strip: {
1686 keep_symbols: true,
1687 },
Peter Collingbournef2b1e032019-12-10 17:41:16 -08001688
1689 whole_static_libs: [ "libgcc_stripped" ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001690 },
1691 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +09001692
1693 stubs: {
1694 symbol_file: "libc.map.txt",
1695 versions: ["10000"],
1696 },
Vic Yang6903fb82019-01-14 11:34:39 -08001697
Jiyong Parke87e0dc2019-10-02 17:09:33 +09001698 apex_available: [
1699 "//apex_available:platform",
1700 "com.android.runtime",
1701 ],
1702
Vic Yang03ff4362019-06-24 16:11:37 -07001703 // Sorting bss symbols by size usually results in less dirty pages at run
1704 // time, because small symbols are grouped together.
1705 sort_bss_symbols_by_size: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001706}
1707
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001708genrule {
1709 name: "libc.arm.map",
1710 out: ["libc.arm.map"],
1711 srcs: ["libc.map.txt"],
1712 tool_files: [":bionic-generate-version-script"],
1713 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
1714}
1715
1716genrule {
1717 name: "libc.arm64.map",
1718 out: ["libc.arm64.map"],
1719 srcs: ["libc.map.txt"],
1720 tool_files: [":bionic-generate-version-script"],
1721 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
1722}
1723
1724genrule {
1725 name: "libc.x86.map",
1726 out: ["libc.x86.map"],
1727 srcs: ["libc.map.txt"],
1728 tool_files: [":bionic-generate-version-script"],
1729 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
1730}
1731
1732genrule {
1733 name: "libc.x86_64.map",
1734 out: ["libc.x86_64.map"],
1735 srcs: ["libc.map.txt"],
1736 tool_files: [":bionic-generate-version-script"],
1737 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
1738}
1739
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001740// Headers that only other parts of the platform can include.
1741cc_library_headers {
1742 name: "bionic_libc_platform_headers",
1743 visibility: [
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001744 "//art:__subpackages__",
Josh Gao97271922019-11-06 13:15:00 -08001745 "//bionic:__subpackages__",
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001746 "//frameworks:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001747 "//external/perfetto:__subpackages__",
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001748 "//external/scudo:__subpackages__",
Josh Gao5074e7d2019-12-13 13:55:53 -08001749 "//system/core/debuggerd:__subpackages__",
Peter Collingbourne6a363f72020-01-13 10:39:33 -08001750 "//system/memory/libmemunreachable:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001751 ],
1752 host_supported: true,
Peter Collingbourne6a363f72020-01-13 10:39:33 -08001753 vendor_available: true,
Yifan Hong5a39cee2020-01-21 16:43:56 -08001754 ramdisk_available: true,
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001755 recovery_available: true,
1756 native_bridge_supported: true,
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001757 export_include_dirs: [
1758 "platform",
1759 ],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001760 system_shared_libs: [],
1761 stl: "none",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001762 sdk_version: "current",
1763}
1764
Logan Chien17af91b2019-01-15 21:19:56 +08001765// libc_headers for libasync_safe and libpropertyinfoparser
1766cc_library_headers {
1767 name: "libc_headers",
1768
1769 host_supported: true,
1770 vendor_available: true,
Yifan Hong5a39cee2020-01-21 16:43:56 -08001771 ramdisk_available: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001772 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001773 native_bridge_supported: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001774
1775 no_libcrt: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001776 stl: "none",
1777 system_shared_libs: [],
1778
Peter Collingbournef2b1e032019-12-10 17:41:16 -08001779 // The build system generally requires that any dependencies of a target
1780 // with an sdk_version must have a lower sdk_version. By setting sdk_version
1781 // to 1 we let targets with an sdk_version that need to depend on the libc
1782 // headers but cannot depend on libc itself due to circular dependencies
1783 // (such as libunwind_llvm) depend on the headers. Setting sdk_version to 1
1784 // is correct because the headers can support any sdk_version.
1785 sdk_version: "1",
1786
Logan Chien17af91b2019-01-15 21:19:56 +08001787 export_include_dirs: [
1788 "include",
1789 "kernel/uapi",
1790 "kernel/android/uapi",
1791 ],
1792
1793 arch: {
1794 arm: {
1795 export_include_dirs: [
1796 "kernel/uapi/asm-arm",
1797 ],
1798 },
1799 arm64: {
1800 export_include_dirs: [
1801 "kernel/uapi/asm-arm64",
1802 ],
1803 },
Logan Chien17af91b2019-01-15 21:19:56 +08001804 x86: {
1805 export_include_dirs: [
1806 "kernel/uapi/asm-x86",
1807 ],
1808 },
1809 x86_64: {
1810 export_include_dirs: [
1811 "kernel/uapi/asm-x86",
1812 ],
1813 },
1814 },
1815}
1816
Dan Willemsen208ae172015-09-16 16:33:27 -07001817// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001818// libstdc++.so and libstdc++.a.
Dan Willemsen208ae172015-09-16 16:33:27 -07001819// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001820
Dan Willemsen208ae172015-09-16 16:33:27 -07001821cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001822 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001823 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001824 srcs: [
1825 "bionic/__cxa_guard.cpp",
1826 "bionic/__cxa_pure_virtual.cpp",
1827 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001828 ],
1829 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001830 static_ndk_lib: true,
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001831 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001832
Dan Willemsen6b3be172018-12-03 13:57:20 -08001833 static: {
1834 system_shared_libs: [],
1835 },
1836 shared: {
1837 system_shared_libs: ["libc"],
1838 },
1839
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001840 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001841 arch: {
1842 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001843 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001844 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001845 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001846 version_script: ":libstdc++.arm.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001847 },
1848 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001849 version_script: ":libstdc++.arm64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001850 },
1851 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001852 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001853 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001854 version_script: ":libstdc++.x86.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001855 },
1856 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001857 version_script: ":libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001858 },
1859 },
1860}
1861
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001862genrule {
1863 name: "libstdc++.arm.map",
1864 out: ["libstdc++.arm.map"],
1865 srcs: ["libstdc++.map.txt"],
1866 tool_files: [":bionic-generate-version-script"],
1867 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
1868}
1869
1870genrule {
1871 name: "libstdc++.arm64.map",
1872 out: ["libstdc++.arm64.map"],
1873 srcs: ["libstdc++.map.txt"],
1874 tool_files: [":bionic-generate-version-script"],
1875 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
1876}
1877
1878genrule {
1879 name: "libstdc++.x86.map",
1880 out: ["libstdc++.x86.map"],
1881 srcs: ["libstdc++.map.txt"],
1882 tool_files: [":bionic-generate-version-script"],
1883 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
1884}
1885
1886genrule {
1887 name: "libstdc++.x86_64.map",
1888 out: ["libstdc++.x86_64.map"],
1889 srcs: ["libstdc++.map.txt"],
1890 tool_files: [":bionic-generate-version-script"],
1891 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
1892}
1893
1894// ========================================================
1895// crt object files.
1896// ========================================================
1897
Colin Cross50c21ab2015-10-31 23:03:05 -07001898cc_defaults {
1899 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001900 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001901 vendor_available: true,
Yifan Hong5a39cee2020-01-21 16:43:56 -08001902 ramdisk_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001903 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001904 native_bridge_supported: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001905
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001906 cflags: [
1907 "-Wno-gcc-compat",
1908 "-Wall",
1909 "-Werror",
1910 ],
Peter Collingbourne7eb851c2019-09-26 12:16:06 -07001911 sanitize: {
1912 never: true,
1913 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001914}
1915
Colin Cross50c21ab2015-10-31 23:03:05 -07001916cc_defaults {
1917 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001918 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001919
1920 arch: {
Colin Cross50c21ab2015-10-31 23:03:05 -07001921 x86: {
1922 cflags: ["-fPIC"],
1923 },
1924 x86_64: {
1925 cflags: ["-fPIC"],
1926 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001927 },
Colin Crossab179442018-09-27 11:03:22 -07001928 stl: "none",
Dan Willemsen208ae172015-09-16 16:33:27 -07001929}
1930
Dan Willemsen208ae172015-09-16 16:33:27 -07001931cc_object {
1932 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001933 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001934 local_include_dirs: ["include"],
1935 product_variables: {
1936 platform_sdk_version: {
1937 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1938 },
1939 },
1940 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001941
Colin Cross7d7b3682017-11-03 13:38:40 -07001942 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001943}
1944
Dan Willemsen208ae172015-09-16 16:33:27 -07001945cc_object {
1946 name: "crtbegin_so1",
1947 local_include_dirs: ["include"],
1948 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001949
Colin Cross7d7b3682017-11-03 13:38:40 -07001950 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001951}
1952
Dan Willemsen208ae172015-09-16 16:33:27 -07001953cc_object {
1954 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001955
Colin Cross7d7b3682017-11-03 13:38:40 -07001956 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001957 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001958 "crtbegin_so1",
1959 "crtbrand",
1960 ],
1961}
1962
Dan Willemsen208ae172015-09-16 16:33:27 -07001963cc_object {
1964 name: "crtend_so",
1965 local_include_dirs: ["include"],
1966 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001967
Colin Cross7d7b3682017-11-03 13:38:40 -07001968 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001969}
1970
Dan Willemsen208ae172015-09-16 16:33:27 -07001971cc_object {
1972 name: "crtbegin_static1",
1973 local_include_dirs: ["include"],
1974 srcs: ["arch-common/bionic/crtbegin.c"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001975 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001976}
1977
Dan Willemsen208ae172015-09-16 16:33:27 -07001978cc_object {
1979 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001980
Colin Cross77d57bf2016-04-11 14:34:18 -07001981 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001982 "crtbegin_static1",
1983 "crtbrand",
1984 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001985 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001986}
1987
Dan Willemsen208ae172015-09-16 16:33:27 -07001988cc_object {
1989 name: "crtbegin_dynamic1",
1990 local_include_dirs: ["include"],
1991 srcs: ["arch-common/bionic/crtbegin.c"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001992 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001993}
1994
Dan Willemsen208ae172015-09-16 16:33:27 -07001995cc_object {
1996 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001997
Colin Cross77d57bf2016-04-11 14:34:18 -07001998 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001999 "crtbegin_dynamic1",
2000 "crtbrand",
2001 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002002 target: {
2003 linux_bionic: {
2004 generated_sources: ["host_bionic_linker_asm"],
2005 objs: [
2006 "linker_wrapper",
2007 ],
2008 },
2009 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002010 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002011}
2012
Dan Willemsen208ae172015-09-16 16:33:27 -07002013cc_object {
2014 // We rename crtend.o to crtend_android.o to avoid a
2015 // name clash between gcc and bionic.
2016 name: "crtend_android",
2017 local_include_dirs: ["include"],
2018 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002019
Colin Cross50c21ab2015-10-31 23:03:05 -07002020 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002021}
Colin Crossbaa48992016-07-13 11:15:21 -07002022
Elliott Hughesd19b3c52018-09-06 16:04:08 -07002023// ========================================================
2024// NDK headers.
2025// ========================================================
2026
Dan Albert26e1c412018-05-24 14:56:46 -07002027versioned_ndk_headers {
Dan Albert22805ea2017-03-22 15:28:05 -07002028 name: "common_libc",
2029 from: "include",
2030 to: "",
2031 license: "NOTICE",
2032}
Dan Albert4238a352016-06-28 11:18:05 -07002033
2034ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002035 name: "libc_uapi",
2036 from: "kernel/uapi",
2037 to: "",
2038 srcs: [
2039 "kernel/uapi/asm-generic/**/*.h",
2040 "kernel/uapi/drm/**/*.h",
2041 "kernel/uapi/linux/**/*.h",
2042 "kernel/uapi/misc/**/*.h",
2043 "kernel/uapi/mtd/**/*.h",
2044 "kernel/uapi/rdma/**/*.h",
2045 "kernel/uapi/scsi/**/*.h",
2046 "kernel/uapi/sound/**/*.h",
2047 "kernel/uapi/video/**/*.h",
2048 "kernel/uapi/xen/**/*.h",
2049 ],
Dan Albert92592652016-10-20 01:42:54 -07002050 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002051}
2052
2053ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002054 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002055 from: "kernel/android/uapi/linux",
2056 to: "linux",
2057 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002058 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002059}
2060
2061ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002062 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002063 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002064 to: "scsi",
2065 srcs: ["kernel/android/scsi/**/*.h"],
2066 license: "NOTICE",
2067}
2068
2069ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002070 name: "libc_asm_arm",
2071 from: "kernel/uapi/asm-arm",
2072 to: "arm-linux-androideabi",
2073 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002074 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002075}
2076
2077ndk_headers {
2078 name: "libc_asm_arm64",
2079 from: "kernel/uapi/asm-arm64",
2080 to: "aarch64-linux-android",
2081 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002082 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002083}
2084
Lazar Trsic790d2f72017-11-27 11:54:11 +01002085ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002086 name: "libc_asm_x86",
2087 from: "kernel/uapi/asm-x86",
2088 to: "i686-linux-android",
2089 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002090 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002091}
2092
2093ndk_headers {
2094 name: "libc_asm_x86_64",
2095 from: "kernel/uapi/asm-x86",
2096 to: "x86_64-linux-android",
2097 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002098 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002099}
2100
Dan Albert4238a352016-06-28 11:18:05 -07002101ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002102 name: "libc",
dimitry7f048802019-05-03 15:57:34 +02002103 native_bridge_supported: true,
Dan Albert4238a352016-06-28 11:18:05 -07002104 symbol_file: "libc.map.txt",
2105 first_version: "9",
2106}
2107
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002108llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002109 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002110 symbol_file: "libc.map.txt",
2111 export_headers_as_system: true,
2112 export_preprocessed_headers: ["include"],
dimitry7f048802019-05-03 15:57:34 +02002113 native_bridge_supported: true,
Logan Chien17af91b2019-01-15 21:19:56 +08002114 export_include_dirs: [
Wenhao Wang69537f12019-12-17 13:54:04 -08002115 "kernel/android/scsi",
Logan Chien17af91b2019-01-15 21:19:56 +08002116 "kernel/android/uapi",
2117 "kernel/uapi",
2118 ],
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002119 arch: {
2120 arm: {
2121 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002122 "kernel/uapi/asm-arm",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002123 ],
2124 },
2125 arm64: {
2126 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002127 "kernel/uapi/asm-arm64",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002128 ],
2129 },
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002130 x86: {
2131 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002132 "kernel/uapi/asm-x86",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002133 ],
2134 },
2135 x86_64: {
2136 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002137 "kernel/uapi/asm-x86",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002138 ],
2139 },
2140 },
2141}
2142
Dan Albertdf31aff2016-10-06 15:50:41 -07002143ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002144 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002145 symbol_file: "libstdc++.map.txt",
2146 first_version: "9",
2147}
2148
Dan Willemsenca056d72018-01-08 14:00:24 -08002149// Export these headers for toolbox to process
2150filegroup {
2151 name: "kernel_input_headers",
2152 srcs: [
2153 "kernel/uapi/linux/input.h",
2154 "kernel/uapi/linux/input-event-codes.h",
2155 ],
2156}
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002157
2158// Generate a syscall name / number mapping. These objects are text files
2159// (thanks to the -dD -E flags) and not binary files. They will then be
2160// consumed by the genseccomp.py script and converted into C++ code.
2161cc_defaults {
2162 name: "libseccomp_gen_syscall_nrs_defaults",
2163 recovery_available: true,
2164 srcs: ["seccomp/gen_syscall_nrs.cpp"],
2165 cflags: [
2166 "-dD",
2167 "-E",
2168 "-Wall",
2169 "-Werror",
2170 "-nostdinc",
2171 ],
2172}
2173
2174cc_object {
2175 name: "libseccomp_gen_syscall_nrs_arm",
2176 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2177 local_include_dirs: [
2178 "kernel/uapi/asm-arm",
2179 "kernel/uapi",
2180 ],
2181}
2182
2183cc_object {
2184 name: "libseccomp_gen_syscall_nrs_arm64",
2185 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2186 local_include_dirs: [
2187 "kernel/uapi/asm-arm64",
2188 "kernel/uapi",
2189 ],
2190}
2191
2192cc_object {
2193 name: "libseccomp_gen_syscall_nrs_x86",
2194 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2195 srcs: ["seccomp/gen_syscall_nrs_x86.cpp"],
2196 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2197 local_include_dirs: [
2198 "kernel/uapi/asm-x86",
2199 "kernel/uapi",
2200 ],
2201}
2202
2203cc_object {
2204 name: "libseccomp_gen_syscall_nrs_x86_64",
2205 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2206 srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"],
2207 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2208 local_include_dirs: [
2209 "kernel/uapi/asm-x86",
2210 "kernel/uapi",
2211 ],
2212}
2213
Elliott Hughesae03b122019-09-17 16:37:05 -07002214// Generate the C++ policy sources for app and system seccomp-bpf filters.
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002215python_binary_host {
2216 name: "genseccomp",
2217 main: "tools/genseccomp.py",
2218
2219 srcs: [
2220 "tools/genseccomp.py",
2221 "tools/gensyscalls.py",
2222 ],
2223
2224 data: [
2225 "kernel/uapi/**/*.h",
2226 ],
2227
2228 version: {
2229 py2: {
2230 enabled: true,
2231 },
2232 py3: {
2233 enabled: false,
2234 },
2235 },
2236}
2237
Martijn Coenen0c6de752019-01-02 12:52:51 +01002238python_binary_host {
2239 name: "genfunctosyscallnrs",
2240 main: "tools/genfunctosyscallnrs.py",
2241
2242 srcs: [
2243 "tools/genseccomp.py",
2244 "tools/genfunctosyscallnrs.py",
2245 "tools/gensyscalls.py",
2246 ],
2247
2248 data: [
2249 "kernel/uapi/**/*.h",
2250 ],
2251
2252 version: {
2253 py2: {
2254 enabled: true,
2255 },
2256 py3: {
2257 enabled: false,
2258 },
2259 },
2260}
2261
2262cc_genrule {
2263 name: "func_to_syscall_nrs",
2264 recovery_available: true,
2265 cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)",
2266
2267 tools: [ "genfunctosyscallnrs" ],
2268
2269 srcs: [
2270 "SYSCALLS.TXT",
2271 ":libseccomp_gen_syscall_nrs_arm",
2272 ":libseccomp_gen_syscall_nrs_arm64",
Martijn Coenen0c6de752019-01-02 12:52:51 +01002273 ":libseccomp_gen_syscall_nrs_x86",
2274 ":libseccomp_gen_syscall_nrs_x86_64",
2275 ],
2276
2277 out: [
2278 "func_to_syscall_nrs.h",
2279 ],
2280}
2281
Martijn Coenenc3752be2019-01-09 16:19:57 +01002282// SECCOMP_BLACKLIST_APP_ZYGOTE.TXT = SECCOMP_BLACKLIST_APP.txt - setresgid*
2283genrule {
2284 name: "generate_app_zygote_blacklist",
2285 out: ["SECCOMP_BLACKLIST_APP_ZYGOTE.TXT"],
2286 srcs: ["SECCOMP_BLACKLIST_APP.TXT"],
2287 cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)",
2288}
2289
2290cc_genrule {
2291 name: "libseccomp_policy_app_zygote_sources",
2292 recovery_available: true,
2293 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
2294
2295 tools: [ "genseccomp" ],
2296
2297 srcs: [
2298 "SYSCALLS.TXT",
2299 "SECCOMP_WHITELIST_COMMON.TXT",
2300 "SECCOMP_WHITELIST_APP.TXT",
2301 "SECCOMP_BLACKLIST_COMMON.TXT",
2302 ":generate_app_zygote_blacklist",
2303 ":libseccomp_gen_syscall_nrs_arm",
2304 ":libseccomp_gen_syscall_nrs_arm64",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002305 ":libseccomp_gen_syscall_nrs_x86",
2306 ":libseccomp_gen_syscall_nrs_x86_64",
2307 ],
2308
2309 out: [
2310 "arm64_app_zygote_policy.cpp",
2311 "arm_app_zygote_policy.cpp",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002312 "x86_64_app_zygote_policy.cpp",
2313 "x86_app_zygote_policy.cpp",
2314 ],
2315}
2316
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002317cc_genrule {
2318 name: "libseccomp_policy_app_sources",
2319 recovery_available: true,
2320 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
2321
2322 tools: [ "genseccomp" ],
2323
2324 srcs: [
2325 "SYSCALLS.TXT",
2326 "SECCOMP_WHITELIST_COMMON.TXT",
2327 "SECCOMP_WHITELIST_APP.TXT",
2328 "SECCOMP_BLACKLIST_COMMON.TXT",
2329 "SECCOMP_BLACKLIST_APP.TXT",
2330 ":libseccomp_gen_syscall_nrs_arm",
2331 ":libseccomp_gen_syscall_nrs_arm64",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002332 ":libseccomp_gen_syscall_nrs_x86",
2333 ":libseccomp_gen_syscall_nrs_x86_64",
2334 ],
2335
2336 out: [
2337 "arm64_app_policy.cpp",
2338 "arm_app_policy.cpp",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002339 "x86_64_app_policy.cpp",
2340 "x86_app_policy.cpp",
2341 ],
2342}
2343
2344cc_genrule {
2345 name: "libseccomp_policy_system_sources",
2346 recovery_available: true,
2347 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
2348
2349 tools: [ "genseccomp" ],
2350
2351 srcs: [
2352 "SYSCALLS.TXT",
2353 "SECCOMP_WHITELIST_COMMON.TXT",
2354 "SECCOMP_WHITELIST_SYSTEM.TXT",
2355 "SECCOMP_BLACKLIST_COMMON.TXT",
2356 ":libseccomp_gen_syscall_nrs_arm",
2357 ":libseccomp_gen_syscall_nrs_arm64",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002358 ":libseccomp_gen_syscall_nrs_x86",
2359 ":libseccomp_gen_syscall_nrs_x86_64",
2360 ],
2361
2362 out: [
2363 "arm64_system_policy.cpp",
2364 "arm_system_policy.cpp",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002365 "x86_64_system_policy.cpp",
2366 "x86_system_policy.cpp",
2367 ],
2368}
2369
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002370cc_library {
2371 name: "libseccomp_policy",
2372 recovery_available: true,
Martijn Coenend269d9b2018-11-08 16:41:42 +01002373 generated_headers: ["func_to_syscall_nrs"],
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002374 generated_sources: [
2375 "libseccomp_policy_app_sources",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002376 "libseccomp_policy_app_zygote_sources",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002377 "libseccomp_policy_system_sources",
2378 ],
2379
2380 srcs: [
2381 "seccomp/seccomp_policy.cpp",
2382 ],
2383
2384 export_include_dirs: ["seccomp/include"],
2385 cflags: [
2386 "-Wall",
2387 "-Werror",
2388 ],
2389 shared: {
2390 shared_libs: ["libbase"],
2391 },
2392 static: {
2393 static_libs: ["libbase"],
2394 },
2395}
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002396
2397// This is a temporary library that will use scudo as the native memory
2398// allocator. To use it, add it as the first shared library.
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002399cc_defaults {
2400 name: "libc_scudo_wrapper_defaults",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002401 srcs: [
Mitch Phillipsf3968e82020-01-31 19:57:04 -08002402 "bionic/gwp_asan_wrappers.cpp",
Peter Collingbourne1e110fb2020-01-09 10:48:22 -08002403 "bionic/heap_tagging.cpp",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002404 "bionic/malloc_common.cpp",
2405 "bionic/malloc_common_dynamic.cpp",
2406 "bionic/malloc_heapprofd.cpp",
2407 "bionic/malloc_limit.cpp",
2408 "bionic/scudo_wrapper.cpp",
2409 "bionic/__set_errno.cpp",
2410 ],
Mitch Phillipsf3968e82020-01-31 19:57:04 -08002411 cflags: [
2412 "-DUSE_SCUDO",
2413 "-fno-emulated-tls", // Required for GWP-ASan.
2414 ],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002415 shared_libs: ["libscudo_wrapper"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002416
Mitch Phillipsf3968e82020-01-31 19:57:04 -08002417 header_libs: [
2418 "libc_headers",
2419 "gwp_asan_headers",
2420 ],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002421
Mitch Phillipsf3968e82020-01-31 19:57:04 -08002422 static_libs: [
2423 "libasync_safe",
2424 "gwp_asan",
2425 ],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002426
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002427 arch: {
2428 arm: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002429 srcs: [":syscalls-arm.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002430 },
2431 arm64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002432 srcs: [":syscalls-arm64.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002433 },
2434 x86: {
2435 srcs: [
2436 "arch-x86/bionic/__libc_init_sysinfo.cpp",
Elliott Hughes782c4852019-04-16 12:31:00 -07002437 ":syscalls-x86.S",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002438 ],
2439 },
2440 x86_64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002441 srcs: [":syscalls-x86_64.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002442 },
2443 },
2444
2445 // Mark this library as global so it overrides all the allocation
2446 // definitions properly.
2447 ldflags: ["-Wl,-z,global"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002448}
Pirama Arumuga Nainar17e7c752019-05-22 22:14:57 -07002449
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002450cc_library_shared {
2451 name: "libc_scudo",
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002452 vendor_available: true,
2453 stl: "none",
2454 system_shared_libs: [],
2455
2456 allow_undefined_symbols: true,
Pirama Arumuga Nainar17e7c752019-05-22 22:14:57 -07002457 // Like libc, disable native coverage for libc_scudo.
2458 native_coverage: false,
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002459}
2460
2461subdirs = [
2462 "bionic/scudo",
2463]