blob: ae943fc7d0fb629d34265ee0b7d199d119677142 [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001// Define the common source files for all the libc instances
2// =========================================================
3libc_common_src_files = [
Christopher Ferris7a3681e2017-04-24 17:48:32 -07004 "async_safe/async_safe_log.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07005 "bionic/ether_aton.c",
6 "bionic/ether_ntoa.c",
7 "bionic/fts.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07008 "bionic/initgroups.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07009 "bionic/isatty.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070010 "bionic/pututline.c",
11 "bionic/sched_cpualloc.c",
12 "bionic/sched_cpucount.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070013 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070014 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070015 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080016 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070017 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080018 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070019 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070021]
22
23// Various kinds of cruft.
24// ========================================================
25libc_common_src_files += [
26 "bionic/ndk_cruft.cpp",
Elliott Hughes1c8a2a92019-09-27 14:42:39 -070027 "bionic/ndk_cruft_data.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070028]
29
30libc_common_src_files_32 = [
31 "bionic/legacy_32_bit_support.cpp",
32 "bionic/time64.c",
33]
34
Elliott Hughes53cf3482016-08-09 13:06:41 -070035libc_common_flags = [
36 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080037 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070038 "-Wall",
39 "-Wextra",
40 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080041 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070042 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070043 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070044 "-Wframe-larger-than=2048",
George Burgess IVfa5410f2018-08-13 17:44:06 -070045 "-Wimplicit-fallthrough",
Elliott Hughes53cf3482016-08-09 13:06:41 -070046
47 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
48 "-Werror=pointer-to-int-cast",
49 "-Werror=int-to-pointer-cast",
50 "-Werror=type-limits",
51 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080052
53 // Clang's exit-time destructor registration hides __dso_handle, but
54 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
55 "-Wexit-time-destructors",
Elliott Hughes53cf3482016-08-09 13:06:41 -070056]
57
Dan Willemsen208ae172015-09-16 16:33:27 -070058// Define some common cflags
59// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070060cc_defaults {
61 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080062 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070063 cflags: libc_common_flags,
64 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070065 conlyflags: ["-std=gnu99"],
66 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070067 include_dirs: [
68 "bionic/libc/async_safe/include",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070069 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070070
Colin Cross50c21ab2015-10-31 23:03:05 -070071 stl: "none",
72 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070073 sanitize: {
Evgenii Stepanovbe551f52018-08-13 16:46:15 -070074 address: false,
75 integer_overflow: false,
Mitch Phillipsdfde0ee2019-05-01 14:26:13 -070076 // TODO(b/132640749): Fix broken fuzzer support.
77 fuzzer: false,
Colin Cross27c43c52016-04-07 13:27:24 -070078 },
Colin Cross50c21ab2015-10-31 23:03:05 -070079 native_coverage: false,
Jiyong Park5603c6e2018-04-27 21:53:11 +090080 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +020081 native_bridge_supported: true,
Ivan Lozanof17fd1d2018-11-27 07:56:17 -080082
Yi Konge3d90de2019-02-20 14:28:56 -080083 // lld complains about duplicate symbols in libcrt and libgcc. Suppress the
84 // warning since this is intended right now.
85 ldflags: ["-Wl,-z,muldefs"],
Dan Willemsen208ae172015-09-16 16:33:27 -070086}
87
Christopher Ferrise55e5ee2019-10-01 17:54:42 -070088// Defaults for native allocator libs/includes to make it
89// easier to change.
90// To enable scudo, change the below to libc_scudo_defaults
91// and comment out the defaults line in libc_scudo shared
92// library.
93// ========================================================
94cc_defaults {
95 name: "libc_native_allocator_defaults",
96
97 defaults: ["libc_jemalloc5_defaults"],
98}
99
100cc_defaults {
101 name: "libc_jemalloc5_defaults",
102
103 include_dirs: [
104 "external/jemalloc_new/include",
105 ],
106
107 whole_static_libs: [
108 "libjemalloc5",
109 "libc_jemalloc_wrapper",
110 ],
111}
112
113// Functions not implemented by jemalloc directly, or that need to
114// be modified for Android.
115cc_library_static {
116 name: "libc_jemalloc_wrapper",
117 defaults: ["libc_defaults"],
118 srcs: ["bionic/jemalloc_wrapper.cpp"],
119 cflags: ["-fvisibility=hidden"],
120
121 include_dirs: [
122 "external/jemalloc_new/include",
123 ],
124}
125
126cc_defaults {
127 name: "libc_scudo_defaults",
128
129 cflags: [
130 "-DUSE_SCUDO",
131 ],
132
133 whole_static_libs: [
134 "libscudo",
135 ],
136}
137
Dan Willemsen208ae172015-09-16 16:33:27 -0700138// ========================================================
139// libc_stack_protector.a - stack protector code
140// ========================================================
141//
Colin Crossa3f9fca2016-01-11 13:20:55 -0800142// Code that implements the stack protector (or that runs
143// before TLS has been set up) needs to be compiled with
144// -fno-stack-protector, since it accesses the stack canary
145// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -0700146
147cc_library_static {
148
Colin Crossa3f9fca2016-01-11 13:20:55 -0800149 srcs: [
150 "bionic/__libc_init_main_thread.cpp",
151 "bionic/__stack_chk_fail.cpp",
152 ],
153 arch: {
154 arm64: {
155 srcs: ["arch-arm64/bionic/__set_tls.c"],
156 },
157 x86: {
Ryan Prichard27475b52018-05-17 17:14:18 -0700158 srcs: [
159 "arch-x86/bionic/__libc_init_sysinfo.cpp",
160 "arch-x86/bionic/__set_tls.cpp",
161 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800162 },
163 x86_64: {
164 srcs: ["arch-x86_64/bionic/__set_tls.c"],
165 },
166 },
167
Colin Cross50c21ab2015-10-31 23:03:05 -0700168 defaults: ["libc_defaults"],
169 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700170 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700171}
172
Colin Crossa3f9fca2016-01-11 13:20:55 -0800173// libc_init_static.cpp also needs to be built without stack protector,
174// because it's responsible for setting up TLS for static executables.
175// This isn't the case for dynamic executables because the dynamic linker
176// has already set up the main thread's TLS.
177
178cc_library_static {
179 name: "libc_init_static",
180 defaults: ["libc_defaults"],
181 srcs: ["bionic/libc_init_static.cpp"],
182 cflags: ["-fno-stack-protector"],
183}
184
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700185cc_library_static {
186 name: "libc_init_dynamic",
187 defaults: ["libc_defaults"],
188 srcs: ["bionic/libc_init_dynamic.cpp"],
189 cflags: ["-fno-stack-protector"],
190}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800191
Dan Willemsen208ae172015-09-16 16:33:27 -0700192// ========================================================
193// libc_tzcode.a - upstream 'tzcode' code
194// ========================================================
195
196cc_library_static {
197
Colin Cross50c21ab2015-10-31 23:03:05 -0700198 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700199 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800200 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700201 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700202 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
203 ],
204
Colin Cross50c21ab2015-10-31 23:03:05 -0700205 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700206 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700207 // Don't use ridiculous amounts of stack.
208 "-DALL_STATE",
209 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
210 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800211 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700212 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700213 // The name of the tm_gmtoff field in our struct tm.
214 "-DTM_GMTOFF=tm_gmtoff",
215 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700216 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700217 // Include `tzname`, `timezone`, and `daylight` globals.
218 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700219 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800220 // Use the empty string (instead of " ") as the timezone abbreviation
221 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700222 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700223 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
224 "-Dlint",
225 ],
226
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 local_include_dirs: ["tzcode/"],
228 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700229}
230
231// ========================================================
232// libc_dns.a - modified NetBSD DNS code
233// ========================================================
234
235cc_library_static {
236
Colin Cross50c21ab2015-10-31 23:03:05 -0700237 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800239 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700240
241 "upstream-netbsd/lib/libc/isc/ev_streams.c",
242 "upstream-netbsd/lib/libc/isc/ev_timers.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700243 ],
244
Colin Cross50c21ab2015-10-31 23:03:05 -0700245 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700246 "-DANDROID_CHANGES",
247 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700248 "-Wno-unused-parameter",
249 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700250 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 ],
252
Dan Willemsen208ae172015-09-16 16:33:27 -0700253 local_include_dirs: [
254 "dns/include",
255 "private",
256 "upstream-netbsd/lib/libc/include",
257 "upstream-netbsd/android/include",
258 ],
259
260 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700261}
262
263// ========================================================
264// libc_freebsd.a - upstream FreeBSD C library code
265// ========================================================
266//
267// These files are built with the freebsd-compat.h header file
268// automatically included.
269
270cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700271 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700272 srcs: [
273 "upstream-freebsd/lib/libc/gen/ldexp.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700274 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700275 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
276 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
277 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
278 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700279 "upstream-freebsd/lib/libc/stdlib/qsort.c",
280 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700281 "upstream-freebsd/lib/libc/string/wcpcpy.c",
282 "upstream-freebsd/lib/libc/string/wcpncpy.c",
283 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700284 "upstream-freebsd/lib/libc/string/wcscat.c",
285 "upstream-freebsd/lib/libc/string/wcschr.c",
286 "upstream-freebsd/lib/libc/string/wcscmp.c",
287 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700288 "upstream-freebsd/lib/libc/string/wcscspn.c",
289 "upstream-freebsd/lib/libc/string/wcsdup.c",
290 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700291 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700292 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
293 "upstream-freebsd/lib/libc/string/wcsncat.c",
294 "upstream-freebsd/lib/libc/string/wcsncmp.c",
295 "upstream-freebsd/lib/libc/string/wcsncpy.c",
296 "upstream-freebsd/lib/libc/string/wcsnlen.c",
297 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700298 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700299 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700300 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700301 "upstream-freebsd/lib/libc/string/wcstok.c",
302 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700303 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700304 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700305 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800306 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700307 ],
308 arch: {
309 arm64: {
310 exclude_srcs: [
311 "upstream-freebsd/lib/libc/string/wmemmove.c",
312 ],
313 },
314 x86: {
315 exclude_srcs: [
316 "upstream-freebsd/lib/libc/string/wcschr.c",
317 "upstream-freebsd/lib/libc/string/wcscmp.c",
318 "upstream-freebsd/lib/libc/string/wcslen.c",
319 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700320 "upstream-freebsd/lib/libc/string/wmemcmp.c",
321 "upstream-freebsd/lib/libc/string/wcscat.c",
322 "upstream-freebsd/lib/libc/string/wcscpy.c",
323 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530324 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700325 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700326 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700327 },
328
Colin Cross50c21ab2015-10-31 23:03:05 -0700329 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700330 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700331 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700332 "-include freebsd-compat.h",
333 ],
334
Dan Willemsen208ae172015-09-16 16:33:27 -0700335 local_include_dirs: [
336 "upstream-freebsd/android/include",
337 ],
338
339 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700340}
341
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700342cc_library_static {
343 defaults: ["libc_defaults"],
344 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700345 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700346 "upstream-freebsd/lib/libc/stdlib/realpath.c",
347 ],
348
349 cflags: [
350 "-Wno-sign-compare",
351 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700352 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700353 ],
354
355 local_include_dirs: [
356 "upstream-freebsd/android/include",
357 ],
358
359 name: "libc_freebsd_large_stack",
360}
361
Dan Willemsen208ae172015-09-16 16:33:27 -0700362// ========================================================
363// libc_netbsd.a - upstream NetBSD C library code
364// ========================================================
365//
366// These files are built with the netbsd-compat.h header file
367// automatically included.
368
369cc_library_static {
370
Colin Cross50c21ab2015-10-31 23:03:05 -0700371 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700372 srcs: [
373 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700374 "upstream-netbsd/lib/libc/gen/nice.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700375 "upstream-netbsd/lib/libc/gen/psignal.c",
376 "upstream-netbsd/lib/libc/gen/utime.c",
377 "upstream-netbsd/lib/libc/gen/utmp.c",
378 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
379 "upstream-netbsd/lib/libc/regex/regcomp.c",
380 "upstream-netbsd/lib/libc/regex/regerror.c",
381 "upstream-netbsd/lib/libc/regex/regexec.c",
382 "upstream-netbsd/lib/libc/regex/regfree.c",
383 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700384 "upstream-netbsd/lib/libc/stdlib/drand48.c",
385 "upstream-netbsd/lib/libc/stdlib/erand48.c",
386 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
387 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700388 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
389 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
390 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
391 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
392 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
393 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
394 "upstream-netbsd/lib/libc/stdlib/seed48.c",
395 "upstream-netbsd/lib/libc/stdlib/srand48.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700396 ],
397 multilib: {
398 lib32: {
399 // LP32 cruft
400 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
401 },
402 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700403 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700404 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800405 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700406 "-DPOSIX_MISTAKE",
407 "-include netbsd-compat.h",
408 ],
409
Dan Willemsen208ae172015-09-16 16:33:27 -0700410 local_include_dirs: [
411 "upstream-netbsd/android/include",
412 "upstream-netbsd/lib/libc/include",
413 ],
414
415 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700416}
417
418// ========================================================
419// libc_openbsd_ndk.a - upstream OpenBSD C library code
420// that can be safely included in the libc_ndk.a (doesn't
421// contain any troublesome global data or constructors).
422// ========================================================
423//
424// These files are built with the openbsd-compat.h header file
425// automatically included.
426
427cc_library_static {
428 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700429 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700430 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700431 "upstream-openbsd/lib/libc/gen/alarm.c",
432 "upstream-openbsd/lib/libc/gen/ctype_.c",
433 "upstream-openbsd/lib/libc/gen/daemon.c",
434 "upstream-openbsd/lib/libc/gen/err.c",
435 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700436 "upstream-openbsd/lib/libc/gen/fnmatch.c",
437 "upstream-openbsd/lib/libc/gen/ftok.c",
438 "upstream-openbsd/lib/libc/gen/getprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700439 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700440 "upstream-openbsd/lib/libc/gen/verr.c",
441 "upstream-openbsd/lib/libc/gen/verrx.c",
442 "upstream-openbsd/lib/libc/gen/vwarn.c",
443 "upstream-openbsd/lib/libc/gen/vwarnx.c",
444 "upstream-openbsd/lib/libc/gen/warn.c",
445 "upstream-openbsd/lib/libc/gen/warnx.c",
446 "upstream-openbsd/lib/libc/locale/btowc.c",
447 "upstream-openbsd/lib/libc/locale/mbrlen.c",
448 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
449 "upstream-openbsd/lib/libc/locale/mbtowc.c",
450 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700451 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
452 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/locale/wcstoll.c",
454 "upstream-openbsd/lib/libc/locale/wcstombs.c",
455 "upstream-openbsd/lib/libc/locale/wcstoul.c",
456 "upstream-openbsd/lib/libc/locale/wcstoull.c",
457 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
458 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
459 "upstream-openbsd/lib/libc/locale/wctob.c",
460 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700461 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700462 "upstream-openbsd/lib/libc/net/htonl.c",
463 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700464 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
465 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
466 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
468 "upstream-openbsd/lib/libc/net/inet_ntop.c",
469 "upstream-openbsd/lib/libc/net/inet_pton.c",
470 "upstream-openbsd/lib/libc/net/ntohl.c",
471 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800472 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700473 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700474 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
475 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700476 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700477 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700478 "upstream-openbsd/lib/libc/stdio/fputwc.c",
479 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700480 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700481 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700482 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700483 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700484 "upstream-openbsd/lib/libc/stdio/makebuf.c",
485 "upstream-openbsd/lib/libc/stdio/mktemp.c",
486 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
487 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700488 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700489 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700490 "upstream-openbsd/lib/libc/stdio/tempnam.c",
491 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
492 "upstream-openbsd/lib/libc/stdio/ungetc.c",
493 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
494 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
495 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700496 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
497 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
498 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700499 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700500 "upstream-openbsd/lib/libc/stdio/wsetup.c",
501 "upstream-openbsd/lib/libc/stdlib/abs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800502 "upstream-openbsd/lib/libc/stdlib/div.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700503 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700504 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700505 "upstream-openbsd/lib/libc/stdlib/insque.c",
506 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
507 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
508 "upstream-openbsd/lib/libc/stdlib/labs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800509 "upstream-openbsd/lib/libc/stdlib/ldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700510 "upstream-openbsd/lib/libc/stdlib/llabs.c",
Elliott Hughes01809e12019-02-05 16:48:22 -0800511 "upstream-openbsd/lib/libc/stdlib/lldiv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700512 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700513 "upstream-openbsd/lib/libc/stdlib/remque.c",
514 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700515 "upstream-openbsd/lib/libc/stdlib/tfind.c",
516 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800517 "upstream-openbsd/lib/libc/string/memccpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700518 "upstream-openbsd/lib/libc/string/strcasecmp.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800519 "upstream-openbsd/lib/libc/string/strcasestr.c",
520 "upstream-openbsd/lib/libc/string/strcoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700521 "upstream-openbsd/lib/libc/string/strcspn.c",
522 "upstream-openbsd/lib/libc/string/strdup.c",
523 "upstream-openbsd/lib/libc/string/strndup.c",
524 "upstream-openbsd/lib/libc/string/strpbrk.c",
525 "upstream-openbsd/lib/libc/string/strsep.c",
526 "upstream-openbsd/lib/libc/string/strspn.c",
527 "upstream-openbsd/lib/libc/string/strstr.c",
528 "upstream-openbsd/lib/libc/string/strtok.c",
Elliott Hughesfbac97a2019-02-04 16:46:24 -0800529 "upstream-openbsd/lib/libc/string/strxfrm.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700530 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700531 "upstream-openbsd/lib/libc/string/wcswidth.c",
532 ],
533
Colin Cross50c21ab2015-10-31 23:03:05 -0700534 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700535 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700536 "-Wno-unused-parameter",
537 "-include openbsd-compat.h",
538 ],
539
Dan Willemsen208ae172015-09-16 16:33:27 -0700540 local_include_dirs: [
541 "private",
542 "stdio",
543 "upstream-openbsd/android/include",
544 "upstream-openbsd/lib/libc/include",
545 "upstream-openbsd/lib/libc/gdtoa/",
546 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700547}
548
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700549cc_library_static {
550 name: "libc_openbsd_large_stack",
551 defaults: ["libc_defaults"],
552 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700553 "stdio/vfprintf.cpp",
554 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700555 ],
556 cflags: [
557 "-include openbsd-compat.h",
558 "-Wno-sign-compare",
559 "-Wframe-larger-than=5000",
560 ],
561
562 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700563 "upstream-openbsd/android/include/",
564 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700565 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700566 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700567 ],
568}
569
Dan Willemsen208ae172015-09-16 16:33:27 -0700570// ========================================================
571// libc_openbsd.a - upstream OpenBSD C library code
572// ========================================================
573//
574// These files are built with the openbsd-compat.h header file
575// automatically included.
576cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700577 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700578 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800579 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700580 "upstream-openbsd/lib/libc/crypt/arc4random.c",
581 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
582
583 // May be overriden by per-arch optimized versions
584 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700585 "upstream-openbsd/lib/libc/string/memrchr.c",
586 "upstream-openbsd/lib/libc/string/stpcpy.c",
587 "upstream-openbsd/lib/libc/string/stpncpy.c",
588 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700589 "upstream-openbsd/lib/libc/string/strcpy.c",
590 "upstream-openbsd/lib/libc/string/strlcat.c",
591 "upstream-openbsd/lib/libc/string/strlcpy.c",
592 "upstream-openbsd/lib/libc/string/strncat.c",
593 "upstream-openbsd/lib/libc/string/strncmp.c",
594 "upstream-openbsd/lib/libc/string/strncpy.c",
595 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700596
597 arch: {
598 arm: {
599 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700600 "upstream-openbsd/lib/libc/string/strcpy.c",
Haibo Huangea9957a2018-11-19 11:00:32 -0800601 "upstream-openbsd/lib/libc/string/stpcpy.c",
602 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700603 ],
604 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700605 arm64: {
606 exclude_srcs: [
607 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700608 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700609 "upstream-openbsd/lib/libc/string/strcpy.c",
610 "upstream-openbsd/lib/libc/string/strncmp.c",
611 ],
612 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530613 mips: {
614 exclude_srcs: [
615 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530616 "upstream-openbsd/lib/libc/string/strcpy.c",
617 "upstream-openbsd/lib/libc/string/strncmp.c",
618 ],
619 },
620 mips64: {
621 exclude_srcs: [
622 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530623 "upstream-openbsd/lib/libc/string/strcpy.c",
624 "upstream-openbsd/lib/libc/string/strncmp.c",
625 ],
626 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700627 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800628 exclude_srcs: [
629 "upstream-openbsd/lib/libc/string/memchr.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800630 "upstream-openbsd/lib/libc/string/memrchr.c",
631 "upstream-openbsd/lib/libc/string/stpcpy.c",
632 "upstream-openbsd/lib/libc/string/stpncpy.c",
633 "upstream-openbsd/lib/libc/string/strcat.c",
634 "upstream-openbsd/lib/libc/string/strcpy.c",
635 "upstream-openbsd/lib/libc/string/strncmp.c",
636 "upstream-openbsd/lib/libc/string/strncpy.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700637 "upstream-openbsd/lib/libc/string/strlcat.c",
638 "upstream-openbsd/lib/libc/string/strlcpy.c",
639 "upstream-openbsd/lib/libc/string/strncat.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800640 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700641 },
642
643 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800644 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800645 "upstream-openbsd/lib/libc/string/stpcpy.c",
646 "upstream-openbsd/lib/libc/string/stpncpy.c",
647 "upstream-openbsd/lib/libc/string/strcat.c",
648 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800649 "upstream-openbsd/lib/libc/string/strncat.c",
650 "upstream-openbsd/lib/libc/string/strncmp.c",
651 "upstream-openbsd/lib/libc/string/strncpy.c",
652 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700653 },
654 },
655
Colin Cross50c21ab2015-10-31 23:03:05 -0700656 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700657 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700658 "-Wno-unused-parameter",
659 "-include openbsd-compat.h",
660 ],
661
Dan Willemsen208ae172015-09-16 16:33:27 -0700662 local_include_dirs: [
663 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700664 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700665 ],
666
667 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700668}
669
670// ========================================================
671// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
672// ========================================================
673//
674// These files are built with the openbsd-compat.h header file
675// automatically included.
676
677cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700678 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700679 srcs: [
680 "upstream-openbsd/android/gdtoa_support.cpp",
681 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
682 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
683 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
684 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
685 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
686 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
687 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
688 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
689 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
690 "upstream-openbsd/lib/libc/gdtoa/misc.c",
691 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
692 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
693 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
694 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
695 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
696 "upstream-openbsd/lib/libc/gdtoa/sum.c",
697 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
698 ],
699 multilib: {
700 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800701 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700702 },
703 },
704
Colin Cross50c21ab2015-10-31 23:03:05 -0700705 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700706 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700707 "-include openbsd-compat.h",
708 ],
709
Dan Willemsen208ae172015-09-16 16:33:27 -0700710 local_include_dirs: [
711 "private",
712 "upstream-openbsd/android/include",
713 "upstream-openbsd/lib/libc/include",
714 ],
715
716 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700717}
718
719// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700720// libc_fortify.a - container for our FORITFY
721// implementation details
722// ========================================================
723cc_library_static {
724 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700725 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700726
727 name: "libc_fortify",
728
729 // Disable FORTIFY for the compilation of these, so we don't end up having
730 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800731 cflags: [
732 "-U_FORTIFY_SOURCE",
733 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
734 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700735
736 arch: {
737 arm: {
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800738 cflags: [
739 "-DNO___MEMCPY_CHK",
740 "-DRENAME___STRCAT_CHK",
741 "-DRENAME___STRCPY_CHK",
742 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700743 srcs: [
744 "arch-arm/generic/bionic/__memcpy_chk.S",
Haibo Huangf1c8d1a2018-11-27 15:38:47 -0800745
746 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
747 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
748
749 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
750 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
751
752 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
753 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
754
755 "arch-arm/krait/bionic/__strcat_chk.S",
756 "arch-arm/krait/bionic/__strcpy_chk.S",
757
758 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
759 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
760
Haibo Huang01bfd892018-12-03 15:05:16 -0800761 "arch-arm/cortex-a55/bionic/__strcat_chk.S",
762 "arch-arm/cortex-a55/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700763 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700764 },
765 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700766 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700767 srcs: [
768 "arch-arm64/generic/bionic/__memcpy_chk.S",
769 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700770 },
771 },
772}
773
774// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700775// libc_bionic.a - home-grown C library code
776// ========================================================
777
778cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700779 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700780 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700781 // The data that backs getauxval is initialized in the libc init
782 // functions which are invoked by the linker. If this file is included
783 // in libc_ndk.a, only one of the copies of the global data will be
784 // initialized, resulting in nullptr dereferences.
785 "bionic/getauxval.cpp",
786
Elliott Hughes211c4d32018-02-02 15:10:32 -0800787 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700788 "bionic/sysconf.cpp",
789 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700790 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700791
Josh Gao10ec9282017-04-03 15:13:29 -0700792 // The following must not be statically linked into libc_ndk.a, because
793 // debuggerd will look for the abort message in libc.so's copy.
794 "bionic/android_set_abort_message.cpp",
795
Dan Willemsen208ae172015-09-16 16:33:27 -0700796 "bionic/strchr.cpp",
797 "bionic/strnlen.c",
798 "bionic/strrchr.cpp",
799 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700800
801 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700802 arm: {
Elliott Hughes1b61d782019-06-04 10:38:34 -0700803 asflags: libc_common_flags + ["-mno-restrict-it"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700804 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800805 "arch-arm/generic/bionic/memcmp.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700806 "arch-arm/generic/bionic/memmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800807 "arch-arm/generic/bionic/memset.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800808 "arch-arm/generic/bionic/stpcpy.c",
809 "arch-arm/generic/bionic/strcat.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800810 "arch-arm/generic/bionic/strcmp.S",
811 "arch-arm/generic/bionic/strcpy.S",
812 "arch-arm/generic/bionic/strlen.c",
813
Ryan Prichard45024fe2018-12-30 21:10:26 -0800814 "arch-arm/bionic/__aeabi_read_tp.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700815 "arch-arm/bionic/__bionic_clone.S",
Yi Kongb410d0e2019-04-22 16:00:46 -0700816 "arch-arm/bionic/__restore.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700817 "arch-arm/bionic/_exit_with_stack_teardown.S",
Yi Kongb410d0e2019-04-22 16:00:46 -0700818 "arch-arm/bionic/atomics_arm.c",
819 "arch-arm/bionic/bpabi.c",
Yi Kong165b1cf2019-02-13 14:10:10 -0800820 "arch-arm/bionic/libcrt_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700821 "arch-arm/bionic/popcount_tab.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700822 "arch-arm/bionic/setjmp.S",
823 "arch-arm/bionic/syscall.S",
824 "arch-arm/bionic/vfork.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800825
826 "arch-arm/cortex-a15/bionic/memcpy.S",
827 "arch-arm/cortex-a15/bionic/memmove.S",
828 "arch-arm/cortex-a15/bionic/memset.S",
829 "arch-arm/cortex-a15/bionic/stpcpy.S",
830 "arch-arm/cortex-a15/bionic/strcat.S",
831 "arch-arm/cortex-a15/bionic/strcmp.S",
832 "arch-arm/cortex-a15/bionic/strcpy.S",
833 "arch-arm/cortex-a15/bionic/strlen.S",
834
835 "arch-arm/cortex-a7/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800836 "arch-arm/cortex-a7/bionic/memset.S",
837
838 "arch-arm/cortex-a9/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800839 "arch-arm/cortex-a9/bionic/memset.S",
840 "arch-arm/cortex-a9/bionic/stpcpy.S",
841 "arch-arm/cortex-a9/bionic/strcat.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800842 "arch-arm/cortex-a9/bionic/strcpy.S",
843 "arch-arm/cortex-a9/bionic/strlen.S",
844
845 "arch-arm/krait/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800846 "arch-arm/krait/bionic/memset.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800847
848 "arch-arm/cortex-a53/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800849
Haibo Huang01bfd892018-12-03 15:05:16 -0800850 "arch-arm/cortex-a55/bionic/memcpy.S",
Haibo Huangea9957a2018-11-19 11:00:32 -0800851
852 "arch-arm/kryo/bionic/memcpy.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700853 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700854 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700855 arm64: {
856 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700857 "arch-arm64/generic/bionic/memcmp.S",
858 "arch-arm64/generic/bionic/memcpy.S",
859 "arch-arm64/generic/bionic/memmove.S",
860 "arch-arm64/generic/bionic/memset.S",
861 "arch-arm64/generic/bionic/stpcpy.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700862 "arch-arm64/generic/bionic/strcpy.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700863 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800864
Peter Collingbourne900d07d2019-10-28 13:11:00 -0700865 "arch-arm64/default/bionic/memchr.S",
866 "arch-arm64/default/bionic/strchr.S",
867 "arch-arm64/default/bionic/strcmp.S",
868 "arch-arm64/default/bionic/strlen.S",
869 "arch-arm64/default/bionic/strncmp.S",
870 "arch-arm64/default/bionic/strnlen.S",
871
872 "arch-arm64/mte/bionic/memchr.c",
873 "arch-arm64/mte/bionic/strchr.cpp",
874 "arch-arm64/mte/bionic/strcmp.c",
875 "arch-arm64/mte/bionic/strlen.c",
876 "arch-arm64/mte/bionic/strncmp.c",
877 "arch-arm64/mte/bionic/strnlen.c",
878
Dan Willemsen3e621712016-02-03 21:48:08 -0800879 "arch-arm64/bionic/__bionic_clone.S",
880 "arch-arm64/bionic/_exit_with_stack_teardown.S",
881 "arch-arm64/bionic/setjmp.S",
882 "arch-arm64/bionic/syscall.S",
883 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700884 ],
885 exclude_srcs: [
886 "bionic/__memcpy_chk.cpp",
887 "bionic/strchr.cpp",
888 "bionic/strnlen.c",
889 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700890 },
891
892 mips: {
893 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800894 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530895 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800896 "arch-mips/string/memset.S",
897 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530898 "arch-mips/string/strncmp.S",
899 "arch-mips/string/strlen.c",
900 "arch-mips/string/strnlen.c",
901 "arch-mips/string/strchr.c",
902 "arch-mips/string/strcpy.c",
903 "arch-mips/string/memchr.c",
904 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800905
Dan Willemsen208ae172015-09-16 16:33:27 -0700906 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700907 "arch-mips/bionic/cacheflush.cpp",
908 "arch-mips/bionic/_exit_with_stack_teardown.S",
Yi Kong165b1cf2019-02-13 14:10:10 -0800909 "arch-mips/bionic/libcrt_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700910 "arch-mips/bionic/setjmp.S",
911 "arch-mips/bionic/syscall.S",
912 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700913 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +0530914 exclude_srcs: [
915 "bionic/strchr.cpp",
916 "bionic/strnlen.c",
917 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700918 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700919 mips64: {
920 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800921 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530922 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800923 "arch-mips/string/memset.S",
924 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530925 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800926 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530927 "arch-mips/string/strnlen.c",
928 "arch-mips/string/strchr.c",
929 "arch-mips/string/strcpy.c",
930 "arch-mips/string/memchr.c",
931 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800932
Dan Willemsen208ae172015-09-16 16:33:27 -0700933 "arch-mips64/bionic/__bionic_clone.S",
934 "arch-mips64/bionic/_exit_with_stack_teardown.S",
935 "arch-mips64/bionic/setjmp.S",
936 "arch-mips64/bionic/syscall.S",
937 "arch-mips64/bionic/vfork.S",
938 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700939 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +0530940 exclude_srcs: [
941 "bionic/strchr.cpp",
942 "bionic/strnlen.c",
943 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700944 },
945
946 x86: {
947 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700948 "arch-x86/generic/string/memcmp.S",
949 "arch-x86/generic/string/strcmp.S",
950 "arch-x86/generic/string/strncmp.S",
951 "arch-x86/generic/string/strcat.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700952
953 "arch-x86/generic/string/strlcat.c",
954 "arch-x86/generic/string/strlcpy.c",
955 "arch-x86/generic/string/strncat.c",
956 "arch-x86/generic/string/wcscat.c",
957 "arch-x86/generic/string/wcscpy.c",
958 "arch-x86/generic/string/wmemcmp.c",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +0530959 "arch-x86/generic/string/wmemset.c",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700960
Dan Willemsen208ae172015-09-16 16:33:27 -0700961 "arch-x86/atom/string/sse2-memchr-atom.S",
962 "arch-x86/atom/string/sse2-memrchr-atom.S",
963 "arch-x86/atom/string/sse2-strchr-atom.S",
964 "arch-x86/atom/string/sse2-strnlen-atom.S",
965 "arch-x86/atom/string/sse2-strrchr-atom.S",
966 "arch-x86/atom/string/sse2-wcschr-atom.S",
967 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
968 "arch-x86/atom/string/sse2-wcslen-atom.S",
969 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700970 "arch-x86/silvermont/string/sse2-memmove-slm.S",
971 "arch-x86/silvermont/string/sse2-memset-slm.S",
972 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
973 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
974 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
975 "arch-x86/silvermont/string/sse2-strlen-slm.S",
976 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800977
978 "arch-x86/bionic/__bionic_clone.S",
979 "arch-x86/bionic/_exit_with_stack_teardown.S",
Yi Kong165b1cf2019-02-13 14:10:10 -0800980 "arch-x86/bionic/libcrt_compat.c",
Dan Willemsen3e621712016-02-03 21:48:08 -0800981 "arch-x86/bionic/__restore.S",
982 "arch-x86/bionic/setjmp.S",
983 "arch-x86/bionic/syscall.S",
984 "arch-x86/bionic/vfork.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -0700985
986 // ssse3 functions
987 "arch-x86/atom/string/ssse3-strcat-atom.S",
988 "arch-x86/atom/string/ssse3-strcmp-atom.S",
989 "arch-x86/atom/string/ssse3-strlcat-atom.S",
990 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
991 "arch-x86/atom/string/ssse3-strncat-atom.S",
992 "arch-x86/atom/string/ssse3-strncmp-atom.S",
993 "arch-x86/atom/string/ssse3-wcscat-atom.S",
994 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
995
996 // sse4 functions
997 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
998 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
999
1000 // atom functions
1001 "arch-x86/atom/string/sse2-memset-atom.S",
1002 "arch-x86/atom/string/sse2-strlen-atom.S",
1003 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Haibo Huange1413622018-11-13 14:20:43 -08001004 "arch-x86/atom/string/ssse3-memmove-atom.S",
Haibo Huangb9244ff2018-08-11 10:12:13 -07001005 "arch-x86/atom/string/ssse3-strcpy-atom.S",
1006 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1007 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +05301008
1009 // avx2 functions
1010 "arch-x86/kabylake/string/avx2-wmemset-kbl.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001011 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001012
1013 exclude_srcs: [
1014 "bionic/strchr.cpp",
1015 "bionic/strnlen.c",
1016 "bionic/strrchr.cpp",
1017 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001018 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001019 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001020 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001021 "arch-x86_64/string/sse2-memmove-slm.S",
1022 "arch-x86_64/string/sse2-memset-slm.S",
1023 "arch-x86_64/string/sse2-stpcpy-slm.S",
1024 "arch-x86_64/string/sse2-stpncpy-slm.S",
1025 "arch-x86_64/string/sse2-strcat-slm.S",
1026 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001027 "arch-x86_64/string/sse2-strlen-slm.S",
1028 "arch-x86_64/string/sse2-strncat-slm.S",
1029 "arch-x86_64/string/sse2-strncpy-slm.S",
1030 "arch-x86_64/string/sse4-memcmp-slm.S",
1031 "arch-x86_64/string/ssse3-strcmp-slm.S",
1032 "arch-x86_64/string/ssse3-strncmp-slm.S",
Shalini Salomi Bodapati4ed2f472019-06-13 09:54:08 +05301033 "arch-x86_64/string/avx2-wmemset-kbl.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001034
1035 "arch-x86_64/bionic/__bionic_clone.S",
1036 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1037 "arch-x86_64/bionic/__restore_rt.S",
1038 "arch-x86_64/bionic/setjmp.S",
1039 "arch-x86_64/bionic/syscall.S",
1040 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001041 ],
1042 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001043 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001044
Colin Cross50c21ab2015-10-31 23:03:05 -07001045 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001046 include_dirs: ["bionic/libstdc++/include"],
1047 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001048}
1049
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001050genrule {
1051 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001052 out: ["generated_android_ids.h"],
1053 srcs: [":android_filesystem_config_header"],
1054 tool_files: ["fs_config_generator.py"],
1055 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001056}
1057
Dan Willemsen268a6732015-10-15 14:49:45 -07001058// ========================================================
1059// libc_bionic_ndk.a- The portions of libc_bionic that can
1060// be safely used in libc_ndk.a (no troublesome global data
1061// or constructors).
1062// ========================================================
1063cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001064 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001065 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001066 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001067 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001068 "bionic/__cmsg_nxthdr.cpp",
1069 "bionic/__errno.cpp",
1070 "bionic/__gnu_basename.cpp",
1071 "bionic/__libc_current_sigrtmax.cpp",
1072 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001073 "bionic/abort.cpp",
1074 "bionic/accept.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001075 "bionic/access.cpp",
1076 "bionic/arpa_inet.cpp",
1077 "bionic/assert.cpp",
1078 "bionic/atof.cpp",
Ryan Prichard083d8502019-01-24 13:47:13 -08001079 "bionic/bionic_allocator.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001080 "bionic/bionic_arc4random.cpp",
Peter Collingbournee9491952019-10-28 10:57:26 -07001081 "bionic/bionic_call_ifunc_resolver.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001082 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001083 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001084 "bionic/bionic_systrace.cpp",
1085 "bionic/bionic_time_conversions.cpp",
1086 "bionic/brk.cpp",
1087 "bionic/c16rtomb.cpp",
1088 "bionic/c32rtomb.cpp",
1089 "bionic/chmod.cpp",
1090 "bionic/chown.cpp",
1091 "bionic/clearenv.cpp",
1092 "bionic/clock.cpp",
1093 "bionic/clock_getcpuclockid.cpp",
1094 "bionic/clock_nanosleep.cpp",
1095 "bionic/clone.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001096 "bionic/ctype.cpp",
1097 "bionic/dirent.cpp",
1098 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001099 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001100 "bionic/error.cpp",
1101 "bionic/eventfd_read.cpp",
1102 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001103 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001104 "bionic/faccessat.cpp",
1105 "bionic/fchmod.cpp",
1106 "bionic/fchmodat.cpp",
Josh Gaof6e5b582018-06-01 15:30:54 -07001107 "bionic/fdsan.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001108 "bionic/ffs.cpp",
1109 "bionic/fgetxattr.cpp",
1110 "bionic/flistxattr.cpp",
1111 "bionic/flockfile.cpp",
1112 "bionic/fpclassify.cpp",
1113 "bionic/fsetxattr.cpp",
1114 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001115 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001116 "bionic/futimens.cpp",
1117 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001118 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001119 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001120 "bionic/gethostname.cpp",
Elliott Hughes2d0b28b2018-10-23 11:23:00 -07001121 "bionic/getloadavg.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001122 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001123 "bionic/getpgrp.cpp",
1124 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001125 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001126 "bionic/gettid.cpp",
Elliott Hughesce934e32018-09-06 13:26:08 -07001127 "bionic/get_device_api_level.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001128 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001129 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001130 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001131 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001132 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001133 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001134 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001135 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001136 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001137 "bionic/lchown.cpp",
1138 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001139 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001140 "bionic/libgen.cpp",
1141 "bionic/link.cpp",
1142 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001143 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001144 "bionic/lstat.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001145 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001146 "bionic/mbrtoc16.cpp",
1147 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001148 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001149 "bionic/mempcpy.cpp",
1150 "bionic/mkdir.cpp",
1151 "bionic/mkfifo.cpp",
1152 "bionic/mknod.cpp",
1153 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001154 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001155 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001156 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001157 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001158 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001159 "bionic/open.cpp",
1160 "bionic/pathconf.cpp",
1161 "bionic/pause.cpp",
1162 "bionic/pipe.cpp",
1163 "bionic/poll.cpp",
1164 "bionic/posix_fadvise.cpp",
1165 "bionic/posix_fallocate.cpp",
1166 "bionic/posix_madvise.cpp",
1167 "bionic/posix_timers.cpp",
1168 "bionic/ptrace.cpp",
1169 "bionic/pty.cpp",
1170 "bionic/raise.cpp",
1171 "bionic/rand.cpp",
1172 "bionic/readlink.cpp",
1173 "bionic/reboot.cpp",
1174 "bionic/recv.cpp",
1175 "bionic/rename.cpp",
1176 "bionic/rmdir.cpp",
1177 "bionic/scandir.cpp",
1178 "bionic/sched_getaffinity.cpp",
1179 "bionic/sched_getcpu.cpp",
1180 "bionic/semaphore.cpp",
1181 "bionic/send.cpp",
1182 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001183 "bionic/seteuid.cpp",
1184 "bionic/setpgrp.cpp",
1185 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001186 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001187 "bionic/sigprocmask.cpp",
Elliott Hughesca3f8e42019-10-28 15:59:38 -07001188 "bionic/sleep.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001189 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001190 "bionic/stat.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001191 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001192 "bionic/strchrnul.cpp",
1193 "bionic/strerror.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001194 "bionic/string_l.cpp",
1195 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001196 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001197 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001198 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001199 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001200 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001201 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001202 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001203 "bionic/sys_msg.cpp",
1204 "bionic/sys_sem.cpp",
1205 "bionic/sys_shm.cpp",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001206 "bionic/sys_signalfd.cpp",
Elliott Hughes261bd742019-08-29 20:45:14 -07001207 "bionic/sys_statfs.cpp",
1208 "bionic/sys_statvfs.cpp",
Elliott Hughes449eff02016-06-08 19:51:20 -07001209 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001210 "bionic/sysinfo.cpp",
1211 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001212 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001213 "bionic/system_property_api.cpp",
1214 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001215 "bionic/tdestroy.cpp",
1216 "bionic/termios.cpp",
1217 "bionic/thread_private.cpp",
Elliott Hughes42067112019-04-18 14:27:24 -07001218 "bionic/threads.cpp",
Elliott Hughesf98d87b2018-07-17 13:21:05 -07001219 "bionic/timespec_get.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001220 "bionic/tmpfile.cpp",
1221 "bionic/umount.cpp",
1222 "bionic/unlink.cpp",
Elliott Hughesca3f8e42019-10-28 15:59:38 -07001223 "bionic/usleep.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001224 "bionic/wait.cpp",
1225 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001226 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001227 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001228 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001229 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001230 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001231
1232 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1233 // which will be overridden by the actual one in libc.so.
1234 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001235 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001236
Dan Willemsen208ae172015-09-16 16:33:27 -07001237 multilib: {
1238 lib32: {
1239 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001240 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001241 },
1242 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001243 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001244 treble_linker_namespaces: {
1245 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001246 },
1247 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001248 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001249 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001250 local_include_dirs: ["stdio"],
1251 include_dirs: ["bionic/libstdc++/include"],
1252 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001253 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001254}
1255
Dan Willemsen208ae172015-09-16 16:33:27 -07001256// ========================================================
1257// libc_pthread.a - pthreads parts that previously lived in
1258// libc_bionic.a. Relocated to their own library because
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001259// they can't be included in libc_ndk.a (as the layout of
Dan Willemsen208ae172015-09-16 16:33:27 -07001260// pthread_t has changed over the years and has ABI
1261// compatibility issues).
1262// ========================================================
1263
1264cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001265 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001266 srcs: [
Ryan Prichard45d13492019-01-03 02:51:30 -08001267 "bionic/bionic_elf_tls.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001268 "bionic/pthread_atfork.cpp",
1269 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001270 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001271 "bionic/pthread_cond.cpp",
1272 "bionic/pthread_create.cpp",
1273 "bionic/pthread_detach.cpp",
1274 "bionic/pthread_equal.cpp",
1275 "bionic/pthread_exit.cpp",
1276 "bionic/pthread_getcpuclockid.cpp",
1277 "bionic/pthread_getschedparam.cpp",
1278 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001279 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001280 "bionic/pthread_join.cpp",
1281 "bionic/pthread_key.cpp",
1282 "bionic/pthread_kill.cpp",
1283 "bionic/pthread_mutex.cpp",
1284 "bionic/pthread_once.cpp",
1285 "bionic/pthread_rwlock.cpp",
Josh Gao726b63f2018-08-27 16:00:58 -07001286 "bionic/pthread_sigqueue.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001287 "bionic/pthread_self.cpp",
1288 "bionic/pthread_setname_np.cpp",
1289 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001290 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001291
1292 // The following implementations depend on pthread data or implementation,
1293 // so we can't include them in libc_ndk.a.
1294 "bionic/__cxa_thread_atexit_impl.cpp",
1295 "stdlib/atexit.c",
1296 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001297 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001298
Colin Cross50c21ab2015-10-31 23:03:05 -07001299 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001300 include_dirs: ["bionic/libstdc++/include"],
1301 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001302}
1303
1304// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001305// libc_syscalls.a
1306// ========================================================
1307
Elliott Hughes782c4852019-04-16 12:31:00 -07001308genrule {
1309 name: "syscalls-arm.S",
1310 out: ["syscalls-arm.S"],
1311 srcs: ["SYSCALLS.TXT"],
1312 tool_files: [":bionic-gensyscalls"],
1313 cmd: "$(location :bionic-gensyscalls) arm $(in) > $(out)",
1314}
1315
1316genrule {
1317 name: "syscalls-arm64.S",
1318 out: ["syscalls-arm64.S"],
1319 srcs: ["SYSCALLS.TXT"],
1320 tool_files: [":bionic-gensyscalls"],
1321 cmd: "$(location :bionic-gensyscalls) arm64 $(in) > $(out)",
1322}
1323
1324genrule {
1325 name: "syscalls-x86.S",
1326 out: ["syscalls-x86.S"],
1327 srcs: ["SYSCALLS.TXT"],
1328 tool_files: [":bionic-gensyscalls"],
1329 cmd: "$(location :bionic-gensyscalls) x86 $(in) > $(out)",
1330}
1331
1332genrule {
1333 name: "syscalls-x86_64.S",
1334 out: ["syscalls-x86_64.S"],
1335 srcs: ["SYSCALLS.TXT"],
1336 tool_files: [":bionic-gensyscalls"],
1337 cmd: "$(location :bionic-gensyscalls) x86_64 $(in) > $(out)",
1338}
1339
Dan Willemsen208ae172015-09-16 16:33:27 -07001340cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001341 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001342 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001343 arch: {
1344 arm: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001345 srcs: [":syscalls-arm.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001346 },
1347 arm64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001348 srcs: [":syscalls-arm64.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001349 },
1350 x86: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001351 srcs: [":syscalls-x86.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001352 },
1353 x86_64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07001354 srcs: [":syscalls-x86_64.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001355 },
1356 },
1357 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001358}
1359
1360// ========================================================
1361// libc_aeabi.a
1362// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1363// to avoid infinite recursion. For the other architectures we just build an
1364// empty library to keep this makefile simple.
1365// ========================================================
1366
1367cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001368 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001369 arch: {
1370 arm: {
1371 srcs: ["arch-arm/bionic/__aeabi.c"],
1372 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001373 },
1374 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001375 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001376}
1377
1378// ========================================================
1379// libc_ndk.a
1380// Compatibility library for the NDK. This library contains
1381// all the parts of libc that are safe to statically link.
1382// We can't safely statically link things that can only run
1383// on a certain version of the OS. Examples include
1384// anything that talks to netd (a large portion of the DNS
1385// code) and anything that is dependent on the layout of a
1386// data structure that has changed across releases (such as
1387// pthread_t).
1388// ========================================================
1389
1390cc_library_static {
1391 name: "libc_ndk",
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001392 defaults: [
1393 "libc_defaults",
1394 "libc_native_allocator_defaults",
1395 ],
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001396 srcs: libc_common_src_files + [
1397 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001398 "bionic/malloc_limit.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001399 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001400 multilib: {
1401 lib32: {
1402 srcs: libc_common_src_files_32,
1403 },
1404 },
1405 arch: {
1406 arm: {
1407 srcs: [
1408 "arch-arm/bionic/exidx_dynamic.c",
1409 "arch-common/bionic/crtbegin_so.c",
1410 "arch-arm/bionic/atexit_legacy.c",
1411 "arch-common/bionic/crtend_so.S",
1412 ],
1413 whole_static_libs: ["libc_aeabi"],
1414 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001415 },
1416
Colin Cross50c21ab2015-10-31 23:03:05 -07001417 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001418 "-fvisibility=hidden",
1419 "-DLIBC_STATIC",
1420 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001421
1422 whole_static_libs: [
1423 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001424 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001425 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001426 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001427 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001428 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001429 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001430 "libc_openbsd_ndk",
1431 "libc_stack_protector",
1432 "libc_syscalls",
1433 "libc_tzcode",
1434 "libm",
Elliott Hughes816fab92016-05-27 17:57:46 -07001435 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001436 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001437}
1438
1439// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001440// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001441// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001442cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001443 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001444 srcs: libc_common_src_files,
1445 multilib: {
1446 lib32: {
1447 srcs: libc_common_src_files_32,
1448 },
1449 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001450 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001451
1452 whole_static_libs: [
1453 "libc_bionic",
1454 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001455 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001456 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001457 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001458 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001459 "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -07001460 "libc_netbsd",
1461 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001462 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001463 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001464 "libc_stack_protector",
1465 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001466 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001467 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001468 ],
1469
1470 arch: {
1471 arm: {
1472 whole_static_libs: ["libc_aeabi"],
1473 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001474 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001475}
1476
1477// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001478// libc_common.a
1479// ========================================================
1480
1481cc_library_static {
1482 defaults: ["libc_defaults"],
1483 name: "libc_common",
1484
1485 whole_static_libs: [
1486 "libc_nopthread",
1487 "libc_pthread",
1488 ],
1489}
1490
1491// ========================================================
Haibo Huangf71edfa2018-11-12 10:06:56 -08001492// libc_common_static.a For static binaries.
1493// ========================================================
1494cc_library_static {
1495 defaults: ["libc_defaults"],
1496 name: "libc_common_static",
1497
Haibo Huangb9244ff2018-08-11 10:12:13 -07001498 arch: {
1499 x86: {
1500 srcs: ["arch-x86/static_function_dispatch.S"],
1501 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001502 arm: {
1503 srcs: ["arch-arm/static_function_dispatch.S"],
1504 },
Peter Collingbourne900d07d2019-10-28 13:11:00 -07001505 arm64: {
1506 srcs: ["arch-arm64/static_function_dispatch.S"],
1507 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001508 },
1509
Haibo Huangf71edfa2018-11-12 10:06:56 -08001510 whole_static_libs: [
1511 "libc_common",
1512 ],
1513}
1514
1515// ========================================================
1516// libc_common_shared.a For shared libraries.
1517// ========================================================
1518cc_library_static {
1519 defaults: ["libc_defaults"],
1520 name: "libc_common_shared",
1521
Haibo Huangb9244ff2018-08-11 10:12:13 -07001522 cflags: [
Peter Collingbourne36a56442019-10-31 17:11:54 -07001523 "-ffreestanding",
Haibo Huangb9244ff2018-08-11 10:12:13 -07001524 "-fno-stack-protector",
1525 "-fno-jump-tables",
1526 ],
1527 arch: {
1528 x86: {
1529 srcs: ["arch-x86/dynamic_function_dispatch.cpp"],
1530 },
Haibo Huangea9957a2018-11-19 11:00:32 -08001531 arm: {
Elliott Hughes927fe992019-01-31 22:29:22 +00001532 srcs: ["arch-arm/dynamic_function_dispatch.cpp"],
Haibo Huangea9957a2018-11-19 11:00:32 -08001533 },
Peter Collingbourne900d07d2019-10-28 13:11:00 -07001534 arm64: {
1535 srcs: ["arch-arm64/dynamic_function_dispatch.cpp"],
1536 },
Haibo Huangb9244ff2018-08-11 10:12:13 -07001537 },
1538
Haibo Huangf71edfa2018-11-12 10:06:56 -08001539 whole_static_libs: [
1540 "libc_common",
1541 ],
1542}
1543
Ryan Prichard22a6a052019-10-10 23:59:30 -07001544// Versions of dl_iterate_phdr and similar APIs used to lookup unwinding information in a static
1545// executable.
1546cc_library_static {
1547 name: "libc_unwind_static",
1548 defaults: ["libc_defaults"],
1549 cflags: ["-DLIBC_STATIC"],
1550
1551 srcs: ["bionic/dl_iterate_phdr_static.cpp"],
1552 arch: {
1553 // arm32-specific dl_unwind_find_exidx and __gnu_Unwind_Find_exidx APIs
1554 arm: {
1555 srcs: ["arch-arm/bionic/exidx_static.c"],
1556 },
1557 },
1558}
1559
Haibo Huangf71edfa2018-11-12 10:06:56 -08001560// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001561// libc_nomalloc.a
1562// ========================================================
1563//
1564// This is a version of the static C library that does not
1565// include malloc. It's useful in situations when the user wants
1566// to provide their own malloc implementation, or wants to
1567// explicitly disallow the use of malloc, such as in the
1568// dynamic linker.
1569
1570cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001571 name: "libc_nomalloc",
Colin Cross50c21ab2015-10-31 23:03:05 -07001572 defaults: ["libc_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001573 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001574
Colin Crossa3f9fca2016-01-11 13:20:55 -08001575 whole_static_libs: [
Haibo Huangf71edfa2018-11-12 10:06:56 -08001576 "libc_common_static",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001577 "libc_init_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001578 "libc_unwind_static",
Colin Crossa3f9fca2016-01-11 13:20:55 -08001579 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001580}
1581
dimitryc0c0ef62018-12-05 16:33:52 +01001582filegroup {
1583 name: "libc_sources_shared",
1584 srcs: [
1585 "arch-common/bionic/crtbegin_so.c",
1586 "arch-common/bionic/crtbrand.S",
1587 "bionic/icu.cpp",
1588 "bionic/malloc_common.cpp",
Christopher Ferrise4cdbc42019-02-08 17:30:58 -08001589 "bionic/malloc_common_dynamic.cpp",
1590 "bionic/malloc_heapprofd.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001591 "bionic/malloc_limit.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001592 "bionic/NetdClient.cpp",
1593 "arch-common/bionic/crtend_so.S",
1594 ],
1595}
1596
1597filegroup {
1598 name: "libc_sources_static",
1599 srcs: [
dimitryc0c0ef62018-12-05 16:33:52 +01001600 "bionic/malloc_common.cpp",
Christopher Ferris1fc5ccf2019-02-15 18:06:15 -08001601 "bionic/malloc_limit.cpp",
dimitryc0c0ef62018-12-05 16:33:52 +01001602 ],
1603}
1604
1605filegroup {
1606 name: "libc_sources_shared_arm",
1607 srcs: [
1608 "arch-arm/bionic/exidx_dynamic.c",
1609 "arch-arm/bionic/atexit_legacy.c",
1610 ],
1611}
1612
Dan Willemsen208ae172015-09-16 16:33:27 -07001613// ========================================================
1614// libc.a + libc.so
1615// ========================================================
1616cc_library {
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001617 defaults: [
1618 "libc_defaults",
1619 "libc_native_allocator_defaults",
1620 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001621 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001622 static_ndk_lib: true,
Logan Chien833cbe42018-10-19 17:57:54 +08001623 export_include_dirs: ["include"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001624 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001625 platform_sdk_version: {
1626 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1627 },
1628 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001629 static: {
dimitryc0c0ef62018-12-05 16:33:52 +01001630 srcs: [ ":libc_sources_static" ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001631 cflags: ["-DLIBC_STATIC"],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001632 whole_static_libs: [
1633 "libc_init_static",
1634 "libc_common_static",
Ryan Prichard22a6a052019-10-10 23:59:30 -07001635 "libc_unwind_static",
Haibo Huangf71edfa2018-11-12 10:06:56 -08001636 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001637 },
1638 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001639 srcs: [ ":libc_sources_shared" ],
Haibo Huangf71edfa2018-11-12 10:06:56 -08001640 whole_static_libs: [
1641 "libc_init_dynamic",
1642 "libc_common_shared",
1643 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001644 },
1645
Neil Fullera7db90f2019-04-25 09:28:27 +01001646 required: [
1647 "tzdata",
1648 "tz_version", // Version metadata for tzdata to help debugging.
1649 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001650
Colin Cross4ce94d22016-11-15 13:15:43 -08001651 // Do not pack libc.so relocations; see http://b/20645321 for details.
1652 pack_relocations: false,
1653
dimitry06016f22018-01-05 11:39:28 +01001654 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1655 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1656 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1657 // those new libraries from libgcc.a are not declared external; if that were the case,
1658 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1659 // on the external symbols from the dependent libraries. That would create a "cloaked"
1660 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001661
dimitry06016f22018-01-05 11:39:28 +01001662 shared_libs: [
1663 "ld-android",
1664 "libdl",
1665 ],
Jiyong Park3ff116a2019-04-02 23:04:52 +09001666 static_libs: [
1667 "libdl_android",
1668 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001669
1670 nocrt: true,
1671
Dan Willemsen208ae172015-09-16 16:33:27 -07001672 arch: {
1673 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001674 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001675 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001676 ldflags: ["-Wl,--hash-style=both"],
1677
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001678 version_script: ":libc.arm.map",
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001679
Dan Willemsen208ae172015-09-16 16:33:27 -07001680 shared: {
dimitryc0c0ef62018-12-05 16:33:52 +01001681 srcs: [":libc_sources_shared_arm"],
Dan Willemsen0c657082016-05-12 01:43:07 -07001682 // special for arm
1683 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001684 },
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001685
1686 // Arm 32 bit does not produce complete exidx unwind information
1687 // so keep the .debug_frame which is relatively small and does
1688 // include needed unwind information.
1689 // See b/132992102 for details.
1690 strip: {
1691 keep_symbols_and_debug_frame: true,
1692 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001693 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001694 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001695 version_script: ":libc.arm64.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001696
1697 // Leave the symbols in the shared library so that stack unwinders can produce
1698 // meaningful name resolution.
1699 strip: {
1700 keep_symbols: true,
1701 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001702 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001703 x86: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001704 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001705 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001706 ldflags: ["-Wl,--hash-style=both"],
1707
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001708 version_script: ":libc.x86.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001709
1710 // Leave the symbols in the shared library so that stack unwinders can produce
1711 // meaningful name resolution.
1712 strip: {
1713 keep_symbols: true,
1714 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001715 },
1716 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001717 version_script: ":libc.x86_64.map",
Christopher Ferris0c0f6fb2019-05-17 16:22:56 -07001718
1719 // Leave the symbols in the shared library so that stack unwinders can produce
1720 // meaningful name resolution.
1721 strip: {
1722 keep_symbols: true,
1723 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001724 },
1725 },
Jiyong Parkc45fe9f2018-12-13 18:26:48 +09001726
1727 stubs: {
1728 symbol_file: "libc.map.txt",
1729 versions: ["10000"],
1730 },
Vic Yang6903fb82019-01-14 11:34:39 -08001731
Jiyong Parke87e0dc2019-10-02 17:09:33 +09001732 apex_available: [
1733 "//apex_available:platform",
1734 "com.android.runtime",
1735 ],
1736
Vic Yang03ff4362019-06-24 16:11:37 -07001737 // Sorting bss symbols by size usually results in less dirty pages at run
1738 // time, because small symbols are grouped together.
1739 sort_bss_symbols_by_size: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001740}
1741
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001742genrule {
1743 name: "libc.arm.map",
1744 out: ["libc.arm.map"],
1745 srcs: ["libc.map.txt"],
1746 tool_files: [":bionic-generate-version-script"],
1747 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
1748}
1749
1750genrule {
1751 name: "libc.arm64.map",
1752 out: ["libc.arm64.map"],
1753 srcs: ["libc.map.txt"],
1754 tool_files: [":bionic-generate-version-script"],
1755 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
1756}
1757
1758genrule {
1759 name: "libc.x86.map",
1760 out: ["libc.x86.map"],
1761 srcs: ["libc.map.txt"],
1762 tool_files: [":bionic-generate-version-script"],
1763 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
1764}
1765
1766genrule {
1767 name: "libc.x86_64.map",
1768 out: ["libc.x86_64.map"],
1769 srcs: ["libc.map.txt"],
1770 tool_files: [":bionic-generate-version-script"],
1771 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
1772}
1773
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001774// Headers that only other parts of the platform can include.
1775cc_library_headers {
1776 name: "bionic_libc_platform_headers",
1777 visibility: [
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001778 "//art:__subpackages__",
1779 "//bionic/libc:__subpackages__",
1780 "//frameworks:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001781 "//external/perfetto:__subpackages__",
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001782 "//external/scudo:__subpackages__",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001783 ],
1784 host_supported: true,
Christopher Ferrisc5d3a432019-09-25 17:50:36 -07001785 recovery_available: true,
1786 native_bridge_supported: true,
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001787 export_include_dirs: [
1788 "platform",
1789 ],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07001790 system_shared_libs: [],
1791 stl: "none",
Christopher Ferris2b0638e2019-09-11 19:05:29 -07001792 sdk_version: "current",
1793}
1794
Logan Chien17af91b2019-01-15 21:19:56 +08001795// libc_headers for libasync_safe and libpropertyinfoparser
1796cc_library_headers {
1797 name: "libc_headers",
1798
1799 host_supported: true,
1800 vendor_available: true,
1801 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001802 native_bridge_supported: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001803
1804 no_libcrt: true,
Logan Chien17af91b2019-01-15 21:19:56 +08001805 stl: "none",
1806 system_shared_libs: [],
1807
1808 export_include_dirs: [
1809 "include",
1810 "kernel/uapi",
1811 "kernel/android/uapi",
1812 ],
1813
1814 arch: {
1815 arm: {
1816 export_include_dirs: [
1817 "kernel/uapi/asm-arm",
1818 ],
1819 },
1820 arm64: {
1821 export_include_dirs: [
1822 "kernel/uapi/asm-arm64",
1823 ],
1824 },
1825 mips: {
1826 export_include_dirs: [
1827 "kernel/uapi/asm-mips",
1828 ],
1829 },
1830 mips64: {
1831 export_include_dirs: [
1832 "kernel/uapi/asm-mips",
1833 ],
1834 },
1835 x86: {
1836 export_include_dirs: [
1837 "kernel/uapi/asm-x86",
1838 ],
1839 },
1840 x86_64: {
1841 export_include_dirs: [
1842 "kernel/uapi/asm-x86",
1843 ],
1844 },
1845 },
1846}
1847
Dan Willemsen208ae172015-09-16 16:33:27 -07001848// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001849// libstdc++.so and libstdc++.a.
Dan Willemsen208ae172015-09-16 16:33:27 -07001850// ========================================================
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001851
Dan Willemsen208ae172015-09-16 16:33:27 -07001852cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001853 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001854 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001855 srcs: [
1856 "bionic/__cxa_guard.cpp",
1857 "bionic/__cxa_pure_virtual.cpp",
1858 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001859 ],
1860 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001861 static_ndk_lib: true,
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001862 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001863
Dan Willemsen6b3be172018-12-03 13:57:20 -08001864 static: {
1865 system_shared_libs: [],
1866 },
1867 shared: {
1868 system_shared_libs: ["libc"],
1869 },
1870
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001871 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001872 arch: {
1873 arm: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001874 // TODO: This is to work around b/24465209. Remove after root cause is fixed.
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001875 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001876 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001877 version_script: ":libstdc++.arm.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001878 },
1879 arm64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001880 version_script: ":libstdc++.arm64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001881 },
1882 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001883 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001884 ldflags: ["-Wl,--hash-style=both"],
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001885 version_script: ":libstdc++.x86.map",
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001886 },
1887 x86_64: {
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001888 version_script: ":libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001889 },
1890 },
1891}
1892
Elliott Hughesd19b3c52018-09-06 16:04:08 -07001893genrule {
1894 name: "libstdc++.arm.map",
1895 out: ["libstdc++.arm.map"],
1896 srcs: ["libstdc++.map.txt"],
1897 tool_files: [":bionic-generate-version-script"],
1898 cmd: "$(location :bionic-generate-version-script) arm $(in) $(out)",
1899}
1900
1901genrule {
1902 name: "libstdc++.arm64.map",
1903 out: ["libstdc++.arm64.map"],
1904 srcs: ["libstdc++.map.txt"],
1905 tool_files: [":bionic-generate-version-script"],
1906 cmd: "$(location :bionic-generate-version-script) arm64 $(in) $(out)",
1907}
1908
1909genrule {
1910 name: "libstdc++.x86.map",
1911 out: ["libstdc++.x86.map"],
1912 srcs: ["libstdc++.map.txt"],
1913 tool_files: [":bionic-generate-version-script"],
1914 cmd: "$(location :bionic-generate-version-script) x86 $(in) $(out)",
1915}
1916
1917genrule {
1918 name: "libstdc++.x86_64.map",
1919 out: ["libstdc++.x86_64.map"],
1920 srcs: ["libstdc++.map.txt"],
1921 tool_files: [":bionic-generate-version-script"],
1922 cmd: "$(location :bionic-generate-version-script) x86_64 $(in) $(out)",
1923}
1924
1925// ========================================================
1926// crt object files.
1927// ========================================================
1928
Colin Cross50c21ab2015-10-31 23:03:05 -07001929cc_defaults {
1930 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001931 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001932 vendor_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001933 recovery_available: true,
dimitry7f048802019-05-03 15:57:34 +02001934 native_bridge_supported: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001935
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001936 cflags: [
1937 "-Wno-gcc-compat",
1938 "-Wall",
1939 "-Werror",
1940 ],
Peter Collingbourne7eb851c2019-09-26 12:16:06 -07001941 sanitize: {
1942 never: true,
1943 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001944}
1945
Colin Cross50c21ab2015-10-31 23:03:05 -07001946cc_defaults {
1947 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001948 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001949
1950 arch: {
1951 mips: {
1952 cflags: ["-fPIC"],
1953 },
1954 mips64: {
1955 cflags: ["-fPIC"],
1956 },
1957 x86: {
1958 cflags: ["-fPIC"],
1959 },
1960 x86_64: {
1961 cflags: ["-fPIC"],
1962 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001963 },
Colin Crossab179442018-09-27 11:03:22 -07001964 stl: "none",
Dan Willemsen208ae172015-09-16 16:33:27 -07001965}
1966
Dan Willemsen208ae172015-09-16 16:33:27 -07001967cc_object {
1968 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001969 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001970 local_include_dirs: ["include"],
1971 product_variables: {
1972 platform_sdk_version: {
1973 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1974 },
1975 },
1976 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001977
Colin Cross7d7b3682017-11-03 13:38:40 -07001978 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001979}
1980
Dan Willemsen208ae172015-09-16 16:33:27 -07001981cc_object {
1982 name: "crtbegin_so1",
1983 local_include_dirs: ["include"],
1984 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001985
Colin Cross7d7b3682017-11-03 13:38:40 -07001986 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001987}
1988
Dan Willemsen208ae172015-09-16 16:33:27 -07001989cc_object {
1990 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001991
Colin Cross7d7b3682017-11-03 13:38:40 -07001992 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001993 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001994 "crtbegin_so1",
1995 "crtbrand",
1996 ],
1997}
1998
Dan Willemsen208ae172015-09-16 16:33:27 -07001999cc_object {
2000 name: "crtend_so",
2001 local_include_dirs: ["include"],
2002 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002003
Colin Cross7d7b3682017-11-03 13:38:40 -07002004 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002005}
2006
Dan Willemsen208ae172015-09-16 16:33:27 -07002007cc_object {
2008 name: "crtbegin_static1",
2009 local_include_dirs: ["include"],
2010 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002011
Colin Cross50c21ab2015-10-31 23:03:05 -07002012 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07002013 mips: {
2014 srcs: [
2015 "arch-mips/bionic/crtbegin.c",
2016 ],
2017 exclude_srcs: [
2018 "arch-common/bionic/crtbegin.c",
2019 ],
2020 },
2021 mips64: {
2022 srcs: [
2023 "arch-mips64/bionic/crtbegin.c",
2024 ],
2025 exclude_srcs: [
2026 "arch-common/bionic/crtbegin.c",
2027 ],
2028 },
2029 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002030
2031 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002032}
2033
Dan Willemsen208ae172015-09-16 16:33:27 -07002034cc_object {
2035 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07002036
Colin Cross77d57bf2016-04-11 14:34:18 -07002037 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002038 "crtbegin_static1",
2039 "crtbrand",
2040 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07002041 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002042}
2043
Dan Willemsen208ae172015-09-16 16:33:27 -07002044cc_object {
2045 name: "crtbegin_dynamic1",
2046 local_include_dirs: ["include"],
2047 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002048
Colin Cross50c21ab2015-10-31 23:03:05 -07002049 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07002050 mips: {
2051 srcs: [
2052 "arch-mips/bionic/crtbegin.c",
2053 ],
2054 exclude_srcs: [
2055 "arch-common/bionic/crtbegin.c",
2056 ],
2057 },
2058 mips64: {
2059 srcs: [
2060 "arch-mips64/bionic/crtbegin.c",
2061 ],
2062 exclude_srcs: [
2063 "arch-common/bionic/crtbegin.c",
2064 ],
2065 },
2066 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002067 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002068}
2069
Dan Willemsen208ae172015-09-16 16:33:27 -07002070cc_object {
2071 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07002072
Colin Cross77d57bf2016-04-11 14:34:18 -07002073 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002074 "crtbegin_dynamic1",
2075 "crtbrand",
2076 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002077 target: {
2078 linux_bionic: {
2079 generated_sources: ["host_bionic_linker_asm"],
2080 objs: [
2081 "linker_wrapper",
2082 ],
2083 },
2084 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002085 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002086}
2087
Dan Willemsen208ae172015-09-16 16:33:27 -07002088cc_object {
2089 // We rename crtend.o to crtend_android.o to avoid a
2090 // name clash between gcc and bionic.
2091 name: "crtend_android",
2092 local_include_dirs: ["include"],
2093 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002094
Colin Cross50c21ab2015-10-31 23:03:05 -07002095 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002096}
Colin Crossbaa48992016-07-13 11:15:21 -07002097
Elliott Hughesd19b3c52018-09-06 16:04:08 -07002098// ========================================================
2099// NDK headers.
2100// ========================================================
2101
Dan Albert26e1c412018-05-24 14:56:46 -07002102versioned_ndk_headers {
Dan Albert22805ea2017-03-22 15:28:05 -07002103 name: "common_libc",
2104 from: "include",
2105 to: "",
2106 license: "NOTICE",
2107}
Dan Albert4238a352016-06-28 11:18:05 -07002108
2109ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002110 name: "libc_uapi",
2111 from: "kernel/uapi",
2112 to: "",
2113 srcs: [
2114 "kernel/uapi/asm-generic/**/*.h",
2115 "kernel/uapi/drm/**/*.h",
2116 "kernel/uapi/linux/**/*.h",
2117 "kernel/uapi/misc/**/*.h",
2118 "kernel/uapi/mtd/**/*.h",
2119 "kernel/uapi/rdma/**/*.h",
2120 "kernel/uapi/scsi/**/*.h",
2121 "kernel/uapi/sound/**/*.h",
2122 "kernel/uapi/video/**/*.h",
2123 "kernel/uapi/xen/**/*.h",
2124 ],
Dan Albert92592652016-10-20 01:42:54 -07002125 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002126}
2127
2128ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002129 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002130 from: "kernel/android/uapi/linux",
2131 to: "linux",
2132 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002133 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002134}
2135
2136ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002137 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002138 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002139 to: "scsi",
2140 srcs: ["kernel/android/scsi/**/*.h"],
2141 license: "NOTICE",
2142}
2143
2144ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002145 name: "libc_asm_arm",
2146 from: "kernel/uapi/asm-arm",
2147 to: "arm-linux-androideabi",
2148 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002149 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002150}
2151
2152ndk_headers {
2153 name: "libc_asm_arm64",
2154 from: "kernel/uapi/asm-arm64",
2155 to: "aarch64-linux-android",
2156 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002157 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002158}
2159
Elliott Hughesee291c02017-12-11 11:32:34 -08002160// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002161ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002162 name: "libc_asm_mips",
2163 from: "kernel/uapi/asm-mips",
2164 to: "mipsel-linux-android",
2165 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2166 license: "NOTICE",
2167}
2168
Elliott Hughesee291c02017-12-11 11:32:34 -08002169// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002170ndk_headers {
2171 name: "libc_asm_mips64",
2172 from: "kernel/uapi/asm-mips",
2173 to: "mips64el-linux-android",
2174 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2175 license: "NOTICE",
2176}
2177
2178ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002179 name: "libc_asm_x86",
2180 from: "kernel/uapi/asm-x86",
2181 to: "i686-linux-android",
2182 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002183 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002184}
2185
2186ndk_headers {
2187 name: "libc_asm_x86_64",
2188 from: "kernel/uapi/asm-x86",
2189 to: "x86_64-linux-android",
2190 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002191 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002192}
2193
Dan Albert4238a352016-06-28 11:18:05 -07002194ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002195 name: "libc",
dimitry7f048802019-05-03 15:57:34 +02002196 native_bridge_supported: true,
Dan Albert4238a352016-06-28 11:18:05 -07002197 symbol_file: "libc.map.txt",
2198 first_version: "9",
2199}
2200
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002201llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002202 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002203 symbol_file: "libc.map.txt",
2204 export_headers_as_system: true,
2205 export_preprocessed_headers: ["include"],
dimitry7f048802019-05-03 15:57:34 +02002206 native_bridge_supported: true,
Logan Chien17af91b2019-01-15 21:19:56 +08002207 export_include_dirs: [
2208 "kernel/android/uapi",
2209 "kernel/uapi",
2210 ],
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002211 arch: {
2212 arm: {
2213 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002214 "kernel/uapi/asm-arm",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002215 ],
2216 },
2217 arm64: {
2218 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002219 "kernel/uapi/asm-arm64",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002220 ],
2221 },
2222 mips: {
2223 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002224 "kernel/uapi/asm-mips",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002225 ],
2226 },
2227 mips64: {
2228 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002229 "kernel/uapi/asm-mips",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002230 ],
2231 },
2232 x86: {
2233 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002234 "kernel/uapi/asm-x86",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002235 ],
2236 },
2237 x86_64: {
2238 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002239 "kernel/uapi/asm-x86",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002240 ],
2241 },
2242 },
2243}
2244
Dan Albertdf31aff2016-10-06 15:50:41 -07002245ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002246 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002247 symbol_file: "libstdc++.map.txt",
2248 first_version: "9",
2249}
2250
Dan Willemsenca056d72018-01-08 14:00:24 -08002251// Export these headers for toolbox to process
2252filegroup {
2253 name: "kernel_input_headers",
2254 srcs: [
2255 "kernel/uapi/linux/input.h",
2256 "kernel/uapi/linux/input-event-codes.h",
2257 ],
2258}
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002259
2260// Generate a syscall name / number mapping. These objects are text files
2261// (thanks to the -dD -E flags) and not binary files. They will then be
2262// consumed by the genseccomp.py script and converted into C++ code.
2263cc_defaults {
2264 name: "libseccomp_gen_syscall_nrs_defaults",
2265 recovery_available: true,
2266 srcs: ["seccomp/gen_syscall_nrs.cpp"],
2267 cflags: [
2268 "-dD",
2269 "-E",
2270 "-Wall",
2271 "-Werror",
2272 "-nostdinc",
2273 ],
2274}
2275
2276cc_object {
2277 name: "libseccomp_gen_syscall_nrs_arm",
2278 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2279 local_include_dirs: [
2280 "kernel/uapi/asm-arm",
2281 "kernel/uapi",
2282 ],
2283}
2284
2285cc_object {
2286 name: "libseccomp_gen_syscall_nrs_arm64",
2287 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2288 local_include_dirs: [
2289 "kernel/uapi/asm-arm64",
2290 "kernel/uapi",
2291 ],
2292}
2293
2294cc_object {
2295 name: "libseccomp_gen_syscall_nrs_x86",
2296 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2297 srcs: ["seccomp/gen_syscall_nrs_x86.cpp"],
2298 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2299 local_include_dirs: [
2300 "kernel/uapi/asm-x86",
2301 "kernel/uapi",
2302 ],
2303}
2304
2305cc_object {
2306 name: "libseccomp_gen_syscall_nrs_x86_64",
2307 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2308 srcs: ["seccomp/gen_syscall_nrs_x86_64.cpp"],
2309 exclude_srcs: ["seccomp/gen_syscall_nrs.cpp"],
2310 local_include_dirs: [
2311 "kernel/uapi/asm-x86",
2312 "kernel/uapi",
2313 ],
2314}
2315
2316cc_object {
2317 name: "libseccomp_gen_syscall_nrs_mips",
2318 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2319 cflags: [
2320 "-D_MIPS_SIM=_MIPS_SIM_ABI32",
2321 ],
2322 local_include_dirs: [
2323 "kernel/uapi/asm-mips",
2324 "kernel/uapi",
2325 ],
2326}
2327
2328cc_object {
2329 name: "libseccomp_gen_syscall_nrs_mips64",
2330 defaults: ["libseccomp_gen_syscall_nrs_defaults"],
2331 cflags: [
2332 "-D_MIPS_SIM=_MIPS_SIM_ABI64",
2333 ],
2334 local_include_dirs: [
2335 "kernel/uapi/asm-mips",
2336 "kernel/uapi",
2337 ],
2338}
2339
Elliott Hughesae03b122019-09-17 16:37:05 -07002340// Generate the C++ policy sources for app and system seccomp-bpf filters.
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002341python_binary_host {
2342 name: "genseccomp",
2343 main: "tools/genseccomp.py",
2344
2345 srcs: [
2346 "tools/genseccomp.py",
2347 "tools/gensyscalls.py",
2348 ],
2349
2350 data: [
2351 "kernel/uapi/**/*.h",
2352 ],
2353
2354 version: {
2355 py2: {
2356 enabled: true,
2357 },
2358 py3: {
2359 enabled: false,
2360 },
2361 },
2362}
2363
Martijn Coenen0c6de752019-01-02 12:52:51 +01002364python_binary_host {
2365 name: "genfunctosyscallnrs",
2366 main: "tools/genfunctosyscallnrs.py",
2367
2368 srcs: [
2369 "tools/genseccomp.py",
2370 "tools/genfunctosyscallnrs.py",
2371 "tools/gensyscalls.py",
2372 ],
2373
2374 data: [
2375 "kernel/uapi/**/*.h",
2376 ],
2377
2378 version: {
2379 py2: {
2380 enabled: true,
2381 },
2382 py3: {
2383 enabled: false,
2384 },
2385 },
2386}
2387
2388cc_genrule {
2389 name: "func_to_syscall_nrs",
2390 recovery_available: true,
2391 cmd: "$(location genfunctosyscallnrs) --out-dir=$(genDir) $(in)",
2392
2393 tools: [ "genfunctosyscallnrs" ],
2394
2395 srcs: [
2396 "SYSCALLS.TXT",
2397 ":libseccomp_gen_syscall_nrs_arm",
2398 ":libseccomp_gen_syscall_nrs_arm64",
2399 ":libseccomp_gen_syscall_nrs_mips",
2400 ":libseccomp_gen_syscall_nrs_mips64",
2401 ":libseccomp_gen_syscall_nrs_x86",
2402 ":libseccomp_gen_syscall_nrs_x86_64",
2403 ],
2404
2405 out: [
2406 "func_to_syscall_nrs.h",
2407 ],
2408}
2409
Martijn Coenenc3752be2019-01-09 16:19:57 +01002410// SECCOMP_BLACKLIST_APP_ZYGOTE.TXT = SECCOMP_BLACKLIST_APP.txt - setresgid*
2411genrule {
2412 name: "generate_app_zygote_blacklist",
2413 out: ["SECCOMP_BLACKLIST_APP_ZYGOTE.TXT"],
2414 srcs: ["SECCOMP_BLACKLIST_APP.TXT"],
2415 cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)",
2416}
2417
2418cc_genrule {
2419 name: "libseccomp_policy_app_zygote_sources",
2420 recovery_available: true,
2421 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
2422
2423 tools: [ "genseccomp" ],
2424
2425 srcs: [
2426 "SYSCALLS.TXT",
2427 "SECCOMP_WHITELIST_COMMON.TXT",
2428 "SECCOMP_WHITELIST_APP.TXT",
2429 "SECCOMP_BLACKLIST_COMMON.TXT",
2430 ":generate_app_zygote_blacklist",
2431 ":libseccomp_gen_syscall_nrs_arm",
2432 ":libseccomp_gen_syscall_nrs_arm64",
2433 ":libseccomp_gen_syscall_nrs_mips",
2434 ":libseccomp_gen_syscall_nrs_mips64",
2435 ":libseccomp_gen_syscall_nrs_x86",
2436 ":libseccomp_gen_syscall_nrs_x86_64",
2437 ],
2438
2439 out: [
2440 "arm64_app_zygote_policy.cpp",
2441 "arm_app_zygote_policy.cpp",
2442 "mips64_app_zygote_policy.cpp",
2443 "mips_app_zygote_policy.cpp",
2444 "x86_64_app_zygote_policy.cpp",
2445 "x86_app_zygote_policy.cpp",
2446 ],
2447}
2448
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002449cc_genrule {
2450 name: "libseccomp_policy_app_sources",
2451 recovery_available: true,
2452 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
2453
2454 tools: [ "genseccomp" ],
2455
2456 srcs: [
2457 "SYSCALLS.TXT",
2458 "SECCOMP_WHITELIST_COMMON.TXT",
2459 "SECCOMP_WHITELIST_APP.TXT",
2460 "SECCOMP_BLACKLIST_COMMON.TXT",
2461 "SECCOMP_BLACKLIST_APP.TXT",
2462 ":libseccomp_gen_syscall_nrs_arm",
2463 ":libseccomp_gen_syscall_nrs_arm64",
2464 ":libseccomp_gen_syscall_nrs_mips",
2465 ":libseccomp_gen_syscall_nrs_mips64",
2466 ":libseccomp_gen_syscall_nrs_x86",
2467 ":libseccomp_gen_syscall_nrs_x86_64",
2468 ],
2469
2470 out: [
2471 "arm64_app_policy.cpp",
2472 "arm_app_policy.cpp",
2473 "mips64_app_policy.cpp",
2474 "mips_app_policy.cpp",
2475 "x86_64_app_policy.cpp",
2476 "x86_app_policy.cpp",
2477 ],
2478}
2479
2480cc_genrule {
2481 name: "libseccomp_policy_system_sources",
2482 recovery_available: true,
2483 cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
2484
2485 tools: [ "genseccomp" ],
2486
2487 srcs: [
2488 "SYSCALLS.TXT",
2489 "SECCOMP_WHITELIST_COMMON.TXT",
2490 "SECCOMP_WHITELIST_SYSTEM.TXT",
2491 "SECCOMP_BLACKLIST_COMMON.TXT",
2492 ":libseccomp_gen_syscall_nrs_arm",
2493 ":libseccomp_gen_syscall_nrs_arm64",
2494 ":libseccomp_gen_syscall_nrs_mips",
2495 ":libseccomp_gen_syscall_nrs_mips64",
2496 ":libseccomp_gen_syscall_nrs_x86",
2497 ":libseccomp_gen_syscall_nrs_x86_64",
2498 ],
2499
2500 out: [
2501 "arm64_system_policy.cpp",
2502 "arm_system_policy.cpp",
2503 "mips64_system_policy.cpp",
2504 "mips_system_policy.cpp",
2505 "x86_64_system_policy.cpp",
2506 "x86_system_policy.cpp",
2507 ],
2508}
2509
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002510cc_library {
2511 name: "libseccomp_policy",
2512 recovery_available: true,
Martijn Coenend269d9b2018-11-08 16:41:42 +01002513 generated_headers: ["func_to_syscall_nrs"],
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002514 generated_sources: [
2515 "libseccomp_policy_app_sources",
Martijn Coenenc3752be2019-01-09 16:19:57 +01002516 "libseccomp_policy_app_zygote_sources",
Luis Hector Chavezfa09b3c2018-08-03 20:53:28 -07002517 "libseccomp_policy_system_sources",
2518 ],
2519
2520 srcs: [
2521 "seccomp/seccomp_policy.cpp",
2522 ],
2523
2524 export_include_dirs: ["seccomp/include"],
2525 cflags: [
2526 "-Wall",
2527 "-Werror",
2528 ],
2529 shared: {
2530 shared_libs: ["libbase"],
2531 },
2532 static: {
2533 static_libs: ["libbase"],
2534 },
2535}
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002536
2537// This is a temporary library that will use scudo as the native memory
2538// allocator. To use it, add it as the first shared library.
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002539cc_defaults {
2540 name: "libc_scudo_wrapper_defaults",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002541 srcs: [
2542 "bionic/malloc_common.cpp",
2543 "bionic/malloc_common_dynamic.cpp",
2544 "bionic/malloc_heapprofd.cpp",
2545 "bionic/malloc_limit.cpp",
2546 "bionic/scudo_wrapper.cpp",
2547 "bionic/__set_errno.cpp",
2548 ],
2549 cflags: ["-DUSE_SCUDO"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002550 shared_libs: ["libscudo_wrapper"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002551
2552 header_libs: ["libc_headers"],
2553
2554 static_libs: ["libasync_safe"],
2555
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002556 arch: {
2557 arm: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002558 srcs: [":syscalls-arm.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002559 },
2560 arm64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002561 srcs: [":syscalls-arm64.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002562 },
2563 x86: {
2564 srcs: [
2565 "arch-x86/bionic/__libc_init_sysinfo.cpp",
Elliott Hughes782c4852019-04-16 12:31:00 -07002566 ":syscalls-x86.S",
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002567 ],
2568 },
2569 x86_64: {
Elliott Hughes782c4852019-04-16 12:31:00 -07002570 srcs: [":syscalls-x86_64.S"],
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002571 },
2572 },
2573
2574 // Mark this library as global so it overrides all the allocation
2575 // definitions properly.
2576 ldflags: ["-Wl,-z,global"],
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002577}
Pirama Arumuga Nainar17e7c752019-05-22 22:14:57 -07002578
Christopher Ferrise55e5ee2019-10-01 17:54:42 -07002579cc_library_shared {
2580 name: "libc_scudo",
2581 defaults: ["libc_scudo_wrapper_defaults"],
2582 vendor_available: true,
2583 stl: "none",
2584 system_shared_libs: [],
2585
2586 allow_undefined_symbols: true,
Pirama Arumuga Nainar17e7c752019-05-22 22:14:57 -07002587 // Like libc, disable native coverage for libc_scudo.
2588 native_coverage: false,
Christopher Ferrisfc26d712019-02-27 18:07:55 -08002589}
2590
2591subdirs = [
2592 "bionic/scudo",
2593]