blob: 78fcb126b08b9496bd4bba0e839a9d9683a3304b [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",
13 "bionic/sigblock.c",
14 "bionic/siginterrupt.c",
15 "bionic/sigsetmask.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070016 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070017 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070018 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080019 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080021 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070022 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070023 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070024]
25
26// Various kinds of cruft.
27// ========================================================
28libc_common_src_files += [
29 "bionic/ndk_cruft.cpp",
30]
31
32libc_common_src_files_32 = [
33 "bionic/legacy_32_bit_support.cpp",
34 "bionic/time64.c",
35]
36
Elliott Hughes53cf3482016-08-09 13:06:41 -070037libc_common_flags = [
38 "-D_LIBC=1",
39 "-Wall",
40 "-Wextra",
41 "-Wunused",
42 "-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",
Elliott Hughes53cf3482016-08-09 13:06:41 -070045
46 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
47 "-Werror=pointer-to-int-cast",
48 "-Werror=int-to-pointer-cast",
49 "-Werror=type-limits",
50 "-Werror",
51]
52
Dan Willemsen208ae172015-09-16 16:33:27 -070053// Define some common cflags
54// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070055cc_defaults {
56 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080057 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070058 cflags: libc_common_flags,
59 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070060 conlyflags: ["-std=gnu99"],
61 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070062 include_dirs: [
63 "bionic/libc/async_safe/include",
64 "external/jemalloc/include",
65 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070066
Colin Cross50c21ab2015-10-31 23:03:05 -070067 stl: "none",
68 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070069 sanitize: {
70 never: true,
71 },
Colin Cross50c21ab2015-10-31 23:03:05 -070072 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070073}
74
Dan Willemsen208ae172015-09-16 16:33:27 -070075// ANDROIDMK TRANSLATION ERROR: unsupported directive
76// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
77//libc_common_cflags += ["-DDEBUG"]
78// ANDROIDMK TRANSLATION ERROR: unsupported directive
79// endif
80
Dan Willemsen208ae172015-09-16 16:33:27 -070081// ========================================================
82// libc_stack_protector.a - stack protector code
83// ========================================================
84//
Colin Crossa3f9fca2016-01-11 13:20:55 -080085// Code that implements the stack protector (or that runs
86// before TLS has been set up) needs to be compiled with
87// -fno-stack-protector, since it accesses the stack canary
88// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070089
90cc_library_static {
91
Colin Crossa3f9fca2016-01-11 13:20:55 -080092 srcs: [
93 "bionic/__libc_init_main_thread.cpp",
94 "bionic/__stack_chk_fail.cpp",
95 ],
96 arch: {
97 arm64: {
98 srcs: ["arch-arm64/bionic/__set_tls.c"],
99 },
100 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800101 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800102 },
103 x86_64: {
104 srcs: ["arch-x86_64/bionic/__set_tls.c"],
105 },
106 },
107
Colin Cross50c21ab2015-10-31 23:03:05 -0700108 defaults: ["libc_defaults"],
109 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700110 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700111}
112
Colin Crossa3f9fca2016-01-11 13:20:55 -0800113// libc_init_static.cpp also needs to be built without stack protector,
114// because it's responsible for setting up TLS for static executables.
115// This isn't the case for dynamic executables because the dynamic linker
116// has already set up the main thread's TLS.
117
118cc_library_static {
119 name: "libc_init_static",
120 defaults: ["libc_defaults"],
121 srcs: ["bionic/libc_init_static.cpp"],
122 cflags: ["-fno-stack-protector"],
123}
124
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700125cc_library_static {
126 name: "libc_init_dynamic",
127 defaults: ["libc_defaults"],
128 srcs: ["bionic/libc_init_dynamic.cpp"],
129 cflags: ["-fno-stack-protector"],
130}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800131
Dan Willemsen208ae172015-09-16 16:33:27 -0700132// ========================================================
133// libc_tzcode.a - upstream 'tzcode' code
134// ========================================================
135
136cc_library_static {
137
Colin Cross50c21ab2015-10-31 23:03:05 -0700138 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700139 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800140 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700141 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700142 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
143 ],
144
Colin Cross50c21ab2015-10-31 23:03:05 -0700145 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700146 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700147 // Don't use ridiculous amounts of stack.
148 "-DALL_STATE",
149 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
150 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800151 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700152 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700153 // The name of the tm_gmtoff field in our struct tm.
154 "-DTM_GMTOFF=tm_gmtoff",
155 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700156 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700157 // Include `tzname`, `timezone`, and `daylight` globals.
158 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700159 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800160 // Use the empty string (instead of " ") as the timezone abbreviation
161 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700162 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700163 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
164 "-Dlint",
165 ],
166
Dan Willemsen208ae172015-09-16 16:33:27 -0700167 local_include_dirs: ["tzcode/"],
168 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700169}
170
171// ========================================================
172// libc_dns.a - modified NetBSD DNS code
173// ========================================================
174
175cc_library_static {
176
Colin Cross50c21ab2015-10-31 23:03:05 -0700177 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700178 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800179 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700180
181 "upstream-netbsd/lib/libc/isc/ev_streams.c",
182 "upstream-netbsd/lib/libc/isc/ev_timers.c",
183 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700184 ],
185
Colin Cross50c21ab2015-10-31 23:03:05 -0700186 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700187 "-DANDROID_CHANGES",
188 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700189 "-Wno-unused-parameter",
190 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700191 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700192 ],
193
Dan Willemsen208ae172015-09-16 16:33:27 -0700194 local_include_dirs: [
195 "dns/include",
196 "private",
197 "upstream-netbsd/lib/libc/include",
198 "upstream-netbsd/android/include",
199 ],
200
201 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700202}
203
204// ========================================================
205// libc_freebsd.a - upstream FreeBSD C library code
206// ========================================================
207//
208// These files are built with the freebsd-compat.h header file
209// automatically included.
210
211cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700212 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700213 srcs: [
214 "upstream-freebsd/lib/libc/gen/ldexp.c",
215 "upstream-freebsd/lib/libc/gen/sleep.c",
216 "upstream-freebsd/lib/libc/gen/usleep.c",
217 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700218 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
219 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
220 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
221 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700222 "upstream-freebsd/lib/libc/stdlib/qsort.c",
223 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700224 "upstream-freebsd/lib/libc/string/wcpcpy.c",
225 "upstream-freebsd/lib/libc/string/wcpncpy.c",
226 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700227 "upstream-freebsd/lib/libc/string/wcscat.c",
228 "upstream-freebsd/lib/libc/string/wcschr.c",
229 "upstream-freebsd/lib/libc/string/wcscmp.c",
230 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700231 "upstream-freebsd/lib/libc/string/wcscspn.c",
232 "upstream-freebsd/lib/libc/string/wcsdup.c",
233 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700234 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700235 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
236 "upstream-freebsd/lib/libc/string/wcsncat.c",
237 "upstream-freebsd/lib/libc/string/wcsncmp.c",
238 "upstream-freebsd/lib/libc/string/wcsncpy.c",
239 "upstream-freebsd/lib/libc/string/wcsnlen.c",
240 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700241 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700242 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700243 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700244 "upstream-freebsd/lib/libc/string/wcstok.c",
245 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700246 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700247 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700248 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800249 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700250 ],
251 arch: {
252 arm64: {
253 exclude_srcs: [
254 "upstream-freebsd/lib/libc/string/wmemmove.c",
255 ],
256 },
257 x86: {
258 exclude_srcs: [
259 "upstream-freebsd/lib/libc/string/wcschr.c",
260 "upstream-freebsd/lib/libc/string/wcscmp.c",
261 "upstream-freebsd/lib/libc/string/wcslen.c",
262 "upstream-freebsd/lib/libc/string/wcsrchr.c",
263 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800264 atom: {
265 exclude_srcs: [
266 "upstream-freebsd/lib/libc/string/wmemcmp.c",
267 ],
268 },
269 ssse3: {
270 exclude_srcs: [
271 "upstream-freebsd/lib/libc/string/wcscat.c",
272 "upstream-freebsd/lib/libc/string/wcscpy.c",
273 ],
274 },
275 sse4: {
276 exclude_srcs: [
277 "upstream-freebsd/lib/libc/string/wmemcmp.c",
278 ],
279 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700280 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700281 },
282
Colin Cross50c21ab2015-10-31 23:03:05 -0700283 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700284 "-Wno-sign-compare",
285 "-Wno-uninitialized",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700286 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700287 "-include freebsd-compat.h",
288 ],
289
Dan Willemsen208ae172015-09-16 16:33:27 -0700290 local_include_dirs: [
291 "upstream-freebsd/android/include",
292 ],
293
294 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700295}
296
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700297cc_library_static {
298 defaults: ["libc_defaults"],
299 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700300 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700301 "upstream-freebsd/lib/libc/stdlib/realpath.c",
302 ],
303
304 cflags: [
305 "-Wno-sign-compare",
306 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700307 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700308 ],
309
310 local_include_dirs: [
311 "upstream-freebsd/android/include",
312 ],
313
314 name: "libc_freebsd_large_stack",
315}
316
Dan Willemsen208ae172015-09-16 16:33:27 -0700317// ========================================================
318// libc_netbsd.a - upstream NetBSD C library code
319// ========================================================
320//
321// These files are built with the netbsd-compat.h header file
322// automatically included.
323
324cc_library_static {
325
Colin Cross50c21ab2015-10-31 23:03:05 -0700326 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700327 srcs: [
328 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700329 "upstream-netbsd/lib/libc/gen/nice.c",
330 "upstream-netbsd/lib/libc/gen/popen.c",
331 "upstream-netbsd/lib/libc/gen/psignal.c",
332 "upstream-netbsd/lib/libc/gen/utime.c",
333 "upstream-netbsd/lib/libc/gen/utmp.c",
334 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
335 "upstream-netbsd/lib/libc/regex/regcomp.c",
336 "upstream-netbsd/lib/libc/regex/regerror.c",
337 "upstream-netbsd/lib/libc/regex/regexec.c",
338 "upstream-netbsd/lib/libc/regex/regfree.c",
339 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
340 "upstream-netbsd/lib/libc/stdlib/div.c",
341 "upstream-netbsd/lib/libc/stdlib/drand48.c",
342 "upstream-netbsd/lib/libc/stdlib/erand48.c",
343 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
344 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
345 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
346 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
347 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
348 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
349 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
350 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
351 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
352 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
353 "upstream-netbsd/lib/libc/stdlib/seed48.c",
354 "upstream-netbsd/lib/libc/stdlib/srand48.c",
355 "upstream-netbsd/lib/libc/string/memccpy.c",
356 "upstream-netbsd/lib/libc/string/strcasestr.c",
357 "upstream-netbsd/lib/libc/string/strcoll.c",
358 "upstream-netbsd/lib/libc/string/strxfrm.c",
359 ],
360 multilib: {
361 lib32: {
362 // LP32 cruft
363 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
364 },
365 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700366 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700367 "-Wno-sign-compare",
368 "-Wno-uninitialized",
Dan Willemsen879cec22016-02-29 10:37:56 -0800369 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700370 "-DPOSIX_MISTAKE",
371 "-include netbsd-compat.h",
372 ],
373
Dan Willemsen208ae172015-09-16 16:33:27 -0700374 local_include_dirs: [
375 "upstream-netbsd/android/include",
376 "upstream-netbsd/lib/libc/include",
377 ],
378
379 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700380}
381
382// ========================================================
383// libc_openbsd_ndk.a - upstream OpenBSD C library code
384// that can be safely included in the libc_ndk.a (doesn't
385// contain any troublesome global data or constructors).
386// ========================================================
387//
388// These files are built with the openbsd-compat.h header file
389// automatically included.
390
391cc_library_static {
392 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700393 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700394 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700395 "upstream-openbsd/lib/libc/gen/alarm.c",
396 "upstream-openbsd/lib/libc/gen/ctype_.c",
397 "upstream-openbsd/lib/libc/gen/daemon.c",
398 "upstream-openbsd/lib/libc/gen/err.c",
399 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700400 "upstream-openbsd/lib/libc/gen/fnmatch.c",
401 "upstream-openbsd/lib/libc/gen/ftok.c",
402 "upstream-openbsd/lib/libc/gen/getprogname.c",
403 "upstream-openbsd/lib/libc/gen/isctype.c",
404 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700405 "upstream-openbsd/lib/libc/gen/tolower_.c",
406 "upstream-openbsd/lib/libc/gen/toupper_.c",
407 "upstream-openbsd/lib/libc/gen/verr.c",
408 "upstream-openbsd/lib/libc/gen/verrx.c",
409 "upstream-openbsd/lib/libc/gen/vwarn.c",
410 "upstream-openbsd/lib/libc/gen/vwarnx.c",
411 "upstream-openbsd/lib/libc/gen/warn.c",
412 "upstream-openbsd/lib/libc/gen/warnx.c",
413 "upstream-openbsd/lib/libc/locale/btowc.c",
414 "upstream-openbsd/lib/libc/locale/mbrlen.c",
415 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
416 "upstream-openbsd/lib/libc/locale/mbtowc.c",
417 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700418 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
419 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700420 "upstream-openbsd/lib/libc/locale/wcstoll.c",
421 "upstream-openbsd/lib/libc/locale/wcstombs.c",
422 "upstream-openbsd/lib/libc/locale/wcstoul.c",
423 "upstream-openbsd/lib/libc/locale/wcstoull.c",
424 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
425 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
426 "upstream-openbsd/lib/libc/locale/wctob.c",
427 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700428 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700429 "upstream-openbsd/lib/libc/net/htonl.c",
430 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700431 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
432 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
433 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700434 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
435 "upstream-openbsd/lib/libc/net/inet_ntop.c",
436 "upstream-openbsd/lib/libc/net/inet_pton.c",
437 "upstream-openbsd/lib/libc/net/ntohl.c",
438 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800439 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700440 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700441 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
442 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700444 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700445 "upstream-openbsd/lib/libc/stdio/fputwc.c",
446 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700447 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
448 "upstream-openbsd/lib/libc/stdio/fwalk.c",
449 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700450 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700451 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700452 "upstream-openbsd/lib/libc/stdio/makebuf.c",
453 "upstream-openbsd/lib/libc/stdio/mktemp.c",
454 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
455 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700456 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700457 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700458 "upstream-openbsd/lib/libc/stdio/tempnam.c",
459 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
460 "upstream-openbsd/lib/libc/stdio/ungetc.c",
461 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
462 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
463 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700464 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
465 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
466 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700468 "upstream-openbsd/lib/libc/stdio/wsetup.c",
469 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700471 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700472 "upstream-openbsd/lib/libc/stdlib/insque.c",
473 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
474 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
475 "upstream-openbsd/lib/libc/stdlib/labs.c",
476 "upstream-openbsd/lib/libc/stdlib/llabs.c",
477 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
478 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
479 "upstream-openbsd/lib/libc/stdlib/remque.c",
480 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700481 "upstream-openbsd/lib/libc/stdlib/system.c",
482 "upstream-openbsd/lib/libc/stdlib/tfind.c",
483 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
484 "upstream-openbsd/lib/libc/string/strcasecmp.c",
485 "upstream-openbsd/lib/libc/string/strcspn.c",
486 "upstream-openbsd/lib/libc/string/strdup.c",
487 "upstream-openbsd/lib/libc/string/strndup.c",
488 "upstream-openbsd/lib/libc/string/strpbrk.c",
489 "upstream-openbsd/lib/libc/string/strsep.c",
490 "upstream-openbsd/lib/libc/string/strspn.c",
491 "upstream-openbsd/lib/libc/string/strstr.c",
492 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700493 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700494 "upstream-openbsd/lib/libc/string/wcswidth.c",
495 ],
496
Colin Cross50c21ab2015-10-31 23:03:05 -0700497 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700498 "-Wno-sign-compare",
499 "-Wno-uninitialized",
500 "-Wno-unused-parameter",
501 "-include openbsd-compat.h",
502 ],
503
Dan Willemsen208ae172015-09-16 16:33:27 -0700504 local_include_dirs: [
505 "private",
506 "stdio",
507 "upstream-openbsd/android/include",
508 "upstream-openbsd/lib/libc/include",
509 "upstream-openbsd/lib/libc/gdtoa/",
510 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700511}
512
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700513cc_library_static {
514 name: "libc_openbsd_large_stack",
515 defaults: ["libc_defaults"],
516 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700517 "stdio/vfprintf.cpp",
518 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700519 ],
520 cflags: [
521 "-include openbsd-compat.h",
522 "-Wno-sign-compare",
523 "-Wframe-larger-than=5000",
524 ],
525
526 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700527 "upstream-openbsd/android/include/",
528 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700529 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700530 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700531 ],
532}
533
Dan Willemsen208ae172015-09-16 16:33:27 -0700534// ========================================================
535// libc_openbsd.a - upstream OpenBSD C library code
536// ========================================================
537//
538// These files are built with the openbsd-compat.h header file
539// automatically included.
540cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700541 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700542 srcs: [
Dan Willemsen35e91a12015-09-17 15:28:45 -0700543 // These two depend on getentropy_linux.c, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700544 "upstream-openbsd/lib/libc/crypt/arc4random.c",
545 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
546
547 // May be overriden by per-arch optimized versions
548 "upstream-openbsd/lib/libc/string/memchr.c",
549 "upstream-openbsd/lib/libc/string/memmove.c",
550 "upstream-openbsd/lib/libc/string/memrchr.c",
551 "upstream-openbsd/lib/libc/string/stpcpy.c",
552 "upstream-openbsd/lib/libc/string/stpncpy.c",
553 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700554 "upstream-openbsd/lib/libc/string/strcpy.c",
555 "upstream-openbsd/lib/libc/string/strlcat.c",
556 "upstream-openbsd/lib/libc/string/strlcpy.c",
557 "upstream-openbsd/lib/libc/string/strncat.c",
558 "upstream-openbsd/lib/libc/string/strncmp.c",
559 "upstream-openbsd/lib/libc/string/strncpy.c",
560 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700561
562 arch: {
563 arm: {
564 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700565 "upstream-openbsd/lib/libc/string/strcpy.c",
566 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800567 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700568 exclude_srcs: [
569 "upstream-openbsd/lib/libc/string/memmove.c",
570 "upstream-openbsd/lib/libc/string/stpcpy.c",
571 "upstream-openbsd/lib/libc/string/strcat.c",
572 ],
573 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700574 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700575 arm64: {
576 exclude_srcs: [
577 "upstream-openbsd/lib/libc/string/memchr.c",
578 "upstream-openbsd/lib/libc/string/memmove.c",
579 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700580 "upstream-openbsd/lib/libc/string/strcpy.c",
581 "upstream-openbsd/lib/libc/string/strncmp.c",
582 ],
583 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530584 mips: {
585 exclude_srcs: [
586 "upstream-openbsd/lib/libc/string/memchr.c",
587 "upstream-openbsd/lib/libc/string/memmove.c",
588 "upstream-openbsd/lib/libc/string/strcpy.c",
589 "upstream-openbsd/lib/libc/string/strncmp.c",
590 ],
591 },
592 mips64: {
593 exclude_srcs: [
594 "upstream-openbsd/lib/libc/string/memchr.c",
595 "upstream-openbsd/lib/libc/string/memmove.c",
596 "upstream-openbsd/lib/libc/string/strcpy.c",
597 "upstream-openbsd/lib/libc/string/strncmp.c",
598 ],
599 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700600 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800601 exclude_srcs: [
602 "upstream-openbsd/lib/libc/string/memchr.c",
603 "upstream-openbsd/lib/libc/string/memmove.c",
604 "upstream-openbsd/lib/libc/string/memrchr.c",
605 "upstream-openbsd/lib/libc/string/stpcpy.c",
606 "upstream-openbsd/lib/libc/string/stpncpy.c",
607 "upstream-openbsd/lib/libc/string/strcat.c",
608 "upstream-openbsd/lib/libc/string/strcpy.c",
609 "upstream-openbsd/lib/libc/string/strncmp.c",
610 "upstream-openbsd/lib/libc/string/strncpy.c",
611 ],
612 ssse3: {
613 exclude_srcs: [
614 "upstream-openbsd/lib/libc/string/strlcat.c",
615 "upstream-openbsd/lib/libc/string/strlcpy.c",
616 "upstream-openbsd/lib/libc/string/strncat.c",
617 ],
618 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700619 },
620
621 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800622 exclude_srcs: [
623 "upstream-openbsd/lib/libc/string/memmove.c",
624 "upstream-openbsd/lib/libc/string/stpcpy.c",
625 "upstream-openbsd/lib/libc/string/stpncpy.c",
626 "upstream-openbsd/lib/libc/string/strcat.c",
627 "upstream-openbsd/lib/libc/string/strcpy.c",
628 "upstream-openbsd/lib/libc/string/strlcat.c",
629 "upstream-openbsd/lib/libc/string/strlcpy.c",
630 "upstream-openbsd/lib/libc/string/strncat.c",
631 "upstream-openbsd/lib/libc/string/strncmp.c",
632 "upstream-openbsd/lib/libc/string/strncpy.c",
633 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700634 },
635 },
636
Colin Cross50c21ab2015-10-31 23:03:05 -0700637 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700638 "-Wno-sign-compare",
639 "-Wno-uninitialized",
640 "-Wno-unused-parameter",
641 "-include openbsd-compat.h",
642 ],
643
Dan Willemsen208ae172015-09-16 16:33:27 -0700644 local_include_dirs: [
645 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700646 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700647 ],
648
649 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700650}
651
652// ========================================================
653// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
654// ========================================================
655//
656// These files are built with the openbsd-compat.h header file
657// automatically included.
658
659cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700660 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700661 srcs: [
662 "upstream-openbsd/android/gdtoa_support.cpp",
663 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
664 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
665 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
666 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
667 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
668 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
669 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
670 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
671 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
672 "upstream-openbsd/lib/libc/gdtoa/misc.c",
673 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
674 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
675 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
676 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
677 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
678 "upstream-openbsd/lib/libc/gdtoa/sum.c",
679 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
680 ],
681 multilib: {
682 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800683 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700684 },
685 },
686
Colin Cross50c21ab2015-10-31 23:03:05 -0700687 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700688 "-Wno-sign-compare",
689 "-Wno-uninitialized",
Dan Willemsen208ae172015-09-16 16:33:27 -0700690 "-include openbsd-compat.h",
691 ],
692
Dan Willemsen208ae172015-09-16 16:33:27 -0700693 local_include_dirs: [
694 "private",
695 "upstream-openbsd/android/include",
696 "upstream-openbsd/lib/libc/include",
697 ],
698
699 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700700}
701
702// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700703// libc_fortify.a - container for our FORITFY
704// implementation details
705// ========================================================
706cc_library_static {
707 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700708 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700709
710 name: "libc_fortify",
711
712 // Disable FORTIFY for the compilation of these, so we don't end up having
713 // FORTIFY silently call itself.
George Burgess IVb97049c2017-07-24 15:05:05 -0700714 cflags: ["-U_FORTIFY_SOURCE", "-D__BIONIC_DECLARE_FORTIFY_HELPERS"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700715
716 arch: {
717 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700718 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700719 srcs: [
720 "arch-arm/generic/bionic/__memcpy_chk.S",
721 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800722 neon: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700723 cflags: ["-DNO___STRCAT_CHK", "-DNO___STRCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700724 srcs: [
725 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
726 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
727 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700728 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800729 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700730 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800731 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
732 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
733 ],
734 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700735 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
736 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
737 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700738 },
739 cortex_a9: {
740 srcs: [
741 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
742 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
743 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800744 exclude_srcs: [
745 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
746 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
747 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700748 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800749 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700750 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800751 "arch-arm/krait/bionic/__strcat_chk.S",
752 "arch-arm/krait/bionic/__strcpy_chk.S",
753 ],
754 exclude_srcs: [
755 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
756 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
757 ],
758 },
759 cortex_a53: {
760 srcs: [
761 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
762 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
763 ],
764 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700765 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
766 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
767 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700768 },
769 cortex_a73: {
770 srcs: [
771 "arch-arm/denver/bionic/__strcat_chk.S",
772 "arch-arm/denver/bionic/__strcpy_chk.S",
773 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800774 exclude_srcs: [
775 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
776 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
777 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700778 },
779 denver: {
780 srcs: [
781 "arch-arm/denver/bionic/__strcat_chk.S",
782 "arch-arm/denver/bionic/__strcpy_chk.S",
783 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800784 exclude_srcs: [
785 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
786 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
787 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700788 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800789 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700790 srcs: [
791 "arch-arm/krait/bionic/__strcat_chk.S",
792 "arch-arm/krait/bionic/__strcpy_chk.S",
793 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800794 exclude_srcs: [
795 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
796 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700797 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700798 },
799 },
800 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700801 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700802 srcs: [
803 "arch-arm64/generic/bionic/__memcpy_chk.S",
804 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700805 },
806 },
807}
808
809// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700810// libc_bionic.a - home-grown C library code
811// ========================================================
812
813cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700814 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700815 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700816 // The data that backs getauxval is initialized in the libc init
817 // functions which are invoked by the linker. If this file is included
818 // in libc_ndk.a, only one of the copies of the global data will be
819 // initialized, resulting in nullptr dereferences.
820 "bionic/getauxval.cpp",
821
Dan Willemsen35e91a12015-09-17 15:28:45 -0700822 // These four require getauxval, which isn't available on older
Dan Willemsen208ae172015-09-16 16:33:27 -0700823 // platforms.
824 "bionic/getentropy_linux.c",
825 "bionic/sysconf.cpp",
826 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700827 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700828
Josh Gao10ec9282017-04-03 15:13:29 -0700829 // The following must not be statically linked into libc_ndk.a, because
830 // debuggerd will look for the abort message in libc.so's copy.
831 "bionic/android_set_abort_message.cpp",
832
Dan Willemsen208ae172015-09-16 16:33:27 -0700833 "bionic/strchr.cpp",
834 "bionic/strnlen.c",
835 "bionic/strrchr.cpp",
836 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700837
838 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700839 arm: {
840 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800841 "arch-arm/generic/bionic/memcmp.S",
842 "arch-arm/generic/bionic/memcpy.S",
843 "arch-arm/generic/bionic/memset.S",
844 "arch-arm/generic/bionic/strcmp.S",
845 "arch-arm/generic/bionic/strcpy.S",
846 "arch-arm/generic/bionic/strlen.c",
847
Dan Willemsen208ae172015-09-16 16:33:27 -0700848 "arch-arm/bionic/atomics_arm.c",
849 "arch-arm/bionic/__bionic_clone.S",
850 "arch-arm/bionic/_exit_with_stack_teardown.S",
851 "arch-arm/bionic/libgcc_compat.c",
852 "arch-arm/bionic/popcount_tab.c",
853 "arch-arm/bionic/__restore.S",
854 "arch-arm/bionic/setjmp.S",
855 "arch-arm/bionic/syscall.S",
856 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700857 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800858 cortex_a7: {
859 srcs: [
860 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800861 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800862 ],
863 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800864 "arch-arm/cortex-a15/bionic/memcpy.S",
865 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800866 ],
867 },
868 cortex_a9: {
869 srcs: [
870 "arch-arm/cortex-a9/bionic/memcpy.S",
871 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800872
Colin Cross6ab8f892015-11-23 14:12:15 -0800873 "arch-arm/cortex-a9/bionic/stpcpy.S",
874 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800875 "arch-arm/cortex-a9/bionic/strcmp.S",
876 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800877 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800878 ],
879 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800880 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800881 "arch-arm/cortex-a15/bionic/memcpy.S",
882
Colin Cross6ab8f892015-11-23 14:12:15 -0800883 "arch-arm/cortex-a15/bionic/stpcpy.S",
884 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800885 "arch-arm/cortex-a15/bionic/strcmp.S",
886 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800887 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800888 ],
889 },
890 krait: {
891 srcs: [
892 "arch-arm/krait/bionic/memcpy.S",
893 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800894
Colin Cross6ab8f892015-11-23 14:12:15 -0800895 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800896 ],
897 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800898 "arch-arm/cortex-a15/bionic/memset.S",
899 "arch-arm/cortex-a15/bionic/memcpy.S",
900
901 "arch-arm/cortex-a15/bionic/strcmp.S",
902 ],
903 },
904 cortex_a53: {
905 srcs: [
906 "arch-arm/cortex-a53/bionic/memcpy.S",
907 "arch-arm/cortex-a7/bionic/memset.S",
908 ],
909 exclude_srcs: [
910 "arch-arm/cortex-a15/bionic/memset.S",
911 "arch-arm/cortex-a15/bionic/memcpy.S",
912 ],
913 },
914 cortex_a73: {
915 srcs: [
916 "arch-arm/cortex-a7/bionic/memset.S",
917 "arch-arm/denver/bionic/memcpy.S",
918
919 "arch-arm/krait/bionic/strcmp.S",
920 ],
921 exclude_srcs: [
922 "arch-arm/cortex-a15/bionic/memset.S",
923 "arch-arm/cortex-a15/bionic/memcpy.S",
924 "arch-arm/cortex-a15/bionic/strcmp.S",
925 ],
926 },
927 denver: {
928 srcs: [
929 "arch-arm/denver/bionic/memcpy.S",
930 "arch-arm/denver/bionic/memset.S",
931 ],
932 exclude_srcs: [
933 "arch-arm/cortex-a15/bionic/memset.S",
934 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800935 ],
936 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700937 kryo: {
938 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400939 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400940 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800941
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800942 "arch-arm/krait/bionic/strcmp.S",
943 ],
944 exclude_srcs: [
945 "arch-arm/cortex-a15/bionic/memset.S",
946 "arch-arm/cortex-a15/bionic/memcpy.S",
947 "arch-arm/cortex-a15/bionic/strcmp.S",
948 ],
949 },
950 // Cores not listed above (like cortex-a8, cortex-a15) or
951 // "generic" core will use the following implementation.
952 neon: {
953 srcs: [
954 "arch-arm/cortex-a15/bionic/memcpy.S",
955 "arch-arm/cortex-a15/bionic/memset.S",
956
Christopher Ferris950a9582017-03-29 13:10:56 -0700957 "arch-arm/cortex-a15/bionic/stpcpy.S",
958 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800959 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -0700960 "arch-arm/cortex-a15/bionic/strcpy.S",
961 "arch-arm/cortex-a15/bionic/strlen.S",
962
963 "arch-arm/denver/bionic/memmove.S",
964 ],
965 exclude_srcs: [
966 "arch-arm/generic/bionic/memcpy.S",
967 "arch-arm/generic/bionic/memset.S",
968 "arch-arm/generic/bionic/strcmp.S",
969 "arch-arm/generic/bionic/strcpy.S",
970 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -0700971 ],
972 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700973 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700974 arm64: {
975 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700976 "arch-arm64/generic/bionic/memchr.S",
977 "arch-arm64/generic/bionic/memcmp.S",
978 "arch-arm64/generic/bionic/memcpy.S",
979 "arch-arm64/generic/bionic/memmove.S",
980 "arch-arm64/generic/bionic/memset.S",
981 "arch-arm64/generic/bionic/stpcpy.S",
982 "arch-arm64/generic/bionic/strchr.S",
983 "arch-arm64/generic/bionic/strcmp.S",
984 "arch-arm64/generic/bionic/strcpy.S",
985 "arch-arm64/generic/bionic/strlen.S",
986 "arch-arm64/generic/bionic/strncmp.S",
987 "arch-arm64/generic/bionic/strnlen.S",
988 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800989
990 "arch-arm64/bionic/__bionic_clone.S",
991 "arch-arm64/bionic/_exit_with_stack_teardown.S",
992 "arch-arm64/bionic/setjmp.S",
993 "arch-arm64/bionic/syscall.S",
994 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700995 ],
996 exclude_srcs: [
997 "bionic/__memcpy_chk.cpp",
998 "bionic/strchr.cpp",
999 "bionic/strnlen.c",
1000 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001001 denver64: {
1002 srcs: [
1003 "arch-arm64/denver64/bionic/memcpy.S",
1004 "arch-arm64/denver64/bionic/memset.S",
1005 ],
1006 exclude_srcs: [
1007 "arch-arm64/generic/bionic/memcpy.S",
1008 "arch-arm64/generic/bionic/memset.S",
1009 ],
1010 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001011 cortex_a53: {
1012 srcs: [
1013 "arch-arm64/cortex-a53/bionic/memmove.S",
1014 ],
1015 exclude_srcs: [
1016 "arch-arm64/generic/bionic/memmove.S",
1017 ],
1018 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001019 cortex_a73: {
1020 srcs: [
1021 "arch-arm64/cortex-a53/bionic/memmove.S",
1022 ],
1023 exclude_srcs: [
1024 "arch-arm64/generic/bionic/memmove.S",
1025 ],
1026 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001027 },
1028
1029 mips: {
1030 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001031 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301032 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001033 "arch-mips/string/memset.S",
1034 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301035 "arch-mips/string/strncmp.S",
1036 "arch-mips/string/strlen.c",
1037 "arch-mips/string/strnlen.c",
1038 "arch-mips/string/strchr.c",
1039 "arch-mips/string/strcpy.c",
1040 "arch-mips/string/memchr.c",
1041 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001042
Dan Willemsen208ae172015-09-16 16:33:27 -07001043 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001044 "arch-mips/bionic/cacheflush.cpp",
1045 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001046 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001047 "arch-mips/bionic/setjmp.S",
1048 "arch-mips/bionic/syscall.S",
1049 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001050 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301051 exclude_srcs: [
1052 "bionic/strchr.cpp",
1053 "bionic/strnlen.c",
1054 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001055 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001056 mips64: {
1057 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001058 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301059 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001060 "arch-mips/string/memset.S",
1061 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301062 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001063 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301064 "arch-mips/string/strnlen.c",
1065 "arch-mips/string/strchr.c",
1066 "arch-mips/string/strcpy.c",
1067 "arch-mips/string/memchr.c",
1068 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001069
Dan Willemsen208ae172015-09-16 16:33:27 -07001070 "arch-mips64/bionic/__bionic_clone.S",
1071 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1072 "arch-mips64/bionic/setjmp.S",
1073 "arch-mips64/bionic/syscall.S",
1074 "arch-mips64/bionic/vfork.S",
1075 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001076 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301077 exclude_srcs: [
1078 "bionic/strchr.cpp",
1079 "bionic/strnlen.c",
1080 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001081 },
1082
1083 x86: {
1084 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001085 "arch-x86/generic/string/memcmp.S",
1086 "arch-x86/generic/string/strcmp.S",
1087 "arch-x86/generic/string/strncmp.S",
1088 "arch-x86/generic/string/strcat.S",
1089 "arch-x86/atom/string/sse2-memchr-atom.S",
1090 "arch-x86/atom/string/sse2-memrchr-atom.S",
1091 "arch-x86/atom/string/sse2-strchr-atom.S",
1092 "arch-x86/atom/string/sse2-strnlen-atom.S",
1093 "arch-x86/atom/string/sse2-strrchr-atom.S",
1094 "arch-x86/atom/string/sse2-wcschr-atom.S",
1095 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1096 "arch-x86/atom/string/sse2-wcslen-atom.S",
1097 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001098 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1099 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1100 "arch-x86/silvermont/string/sse2-memset-slm.S",
1101 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1102 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1103 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1104 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1105 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001106
1107 "arch-x86/bionic/__bionic_clone.S",
1108 "arch-x86/bionic/_exit_with_stack_teardown.S",
1109 "arch-x86/bionic/libgcc_compat.c",
1110 "arch-x86/bionic/__restore.S",
1111 "arch-x86/bionic/setjmp.S",
1112 "arch-x86/bionic/syscall.S",
1113 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001114 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001115
1116 exclude_srcs: [
1117 "bionic/strchr.cpp",
1118 "bionic/strnlen.c",
1119 "bionic/strrchr.cpp",
1120 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001121 atom: {
1122 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001123 "arch-x86/atom/string/sse2-memset-atom.S",
1124 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001125 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001126 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001127 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001128 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001129 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1130 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1131 ],
1132 exclude_srcs: [
1133 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001134 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1135 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1136 "arch-x86/silvermont/string/sse2-memset-slm.S",
1137 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1138 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1139 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1140 ],
1141 },
1142 ssse3: {
1143 srcs: [
1144 "arch-x86/atom/string/ssse3-strncat-atom.S",
1145 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1146 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1147 "arch-x86/atom/string/ssse3-strcat-atom.S",
1148 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1149 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1150 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1151 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1152 ],
1153 exclude_srcs: [
1154 "arch-x86/generic/string/strcmp.S",
1155 "arch-x86/generic/string/strncmp.S",
1156 "arch-x86/generic/string/strcat.S",
1157 ],
1158 },
1159 sse4: {
1160 srcs: [
1161 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1162 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1163 ],
1164 exclude_srcs: [
1165 "arch-x86/generic/string/memcmp.S",
1166 ],
1167 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001168 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001169 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001170 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001171 "arch-x86_64/string/sse2-memcpy-slm.S",
1172 "arch-x86_64/string/sse2-memmove-slm.S",
1173 "arch-x86_64/string/sse2-memset-slm.S",
1174 "arch-x86_64/string/sse2-stpcpy-slm.S",
1175 "arch-x86_64/string/sse2-stpncpy-slm.S",
1176 "arch-x86_64/string/sse2-strcat-slm.S",
1177 "arch-x86_64/string/sse2-strcpy-slm.S",
1178 "arch-x86_64/string/sse2-strlcat-slm.S",
1179 "arch-x86_64/string/sse2-strlcpy-slm.S",
1180 "arch-x86_64/string/sse2-strlen-slm.S",
1181 "arch-x86_64/string/sse2-strncat-slm.S",
1182 "arch-x86_64/string/sse2-strncpy-slm.S",
1183 "arch-x86_64/string/sse4-memcmp-slm.S",
1184 "arch-x86_64/string/ssse3-strcmp-slm.S",
1185 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001186
1187 "arch-x86_64/bionic/__bionic_clone.S",
1188 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1189 "arch-x86_64/bionic/__restore_rt.S",
1190 "arch-x86_64/bionic/setjmp.S",
1191 "arch-x86_64/bionic/syscall.S",
1192 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001193 ],
1194 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001195 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001196
Colin Cross50c21ab2015-10-31 23:03:05 -07001197 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001198 include_dirs: ["bionic/libstdc++/include"],
1199 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001200}
1201
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001202genrule {
1203 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001204 out: ["generated_android_ids.h"],
1205 srcs: [":android_filesystem_config_header"],
1206 tool_files: ["fs_config_generator.py"],
1207 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001208}
1209
Dan Willemsen268a6732015-10-15 14:49:45 -07001210// ========================================================
1211// libc_bionic_ndk.a- The portions of libc_bionic that can
1212// be safely used in libc_ndk.a (no troublesome global data
1213// or constructors).
1214// ========================================================
1215cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001216 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001217 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001218 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001219 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001220 "bionic/__cmsg_nxthdr.cpp",
1221 "bionic/__errno.cpp",
1222 "bionic/__gnu_basename.cpp",
1223 "bionic/__libc_current_sigrtmax.cpp",
1224 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001225 "bionic/abort.cpp",
1226 "bionic/accept.cpp",
1227 "bionic/accept4.cpp",
1228 "bionic/access.cpp",
1229 "bionic/arpa_inet.cpp",
1230 "bionic/assert.cpp",
1231 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001232 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001233 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001234 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001235 "bionic/bionic_systrace.cpp",
1236 "bionic/bionic_time_conversions.cpp",
1237 "bionic/brk.cpp",
1238 "bionic/c16rtomb.cpp",
1239 "bionic/c32rtomb.cpp",
1240 "bionic/chmod.cpp",
1241 "bionic/chown.cpp",
1242 "bionic/clearenv.cpp",
1243 "bionic/clock.cpp",
1244 "bionic/clock_getcpuclockid.cpp",
1245 "bionic/clock_nanosleep.cpp",
1246 "bionic/clone.cpp",
1247 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001248 "bionic/connect.cpp",
1249 "bionic/ctype.cpp",
1250 "bionic/dirent.cpp",
1251 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001252 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001253 "bionic/epoll_create.cpp",
1254 "bionic/epoll_pwait.cpp",
1255 "bionic/epoll_wait.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001256 "bionic/error.cpp",
1257 "bionic/eventfd_read.cpp",
1258 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001259 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001260 "bionic/faccessat.cpp",
1261 "bionic/fchmod.cpp",
1262 "bionic/fchmodat.cpp",
1263 "bionic/ffs.cpp",
1264 "bionic/fgetxattr.cpp",
1265 "bionic/flistxattr.cpp",
1266 "bionic/flockfile.cpp",
1267 "bionic/fpclassify.cpp",
1268 "bionic/fsetxattr.cpp",
1269 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001270 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001271 "bionic/futimens.cpp",
1272 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001273 "bionic/getdomainname.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001274 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001275 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001276 "bionic/getpgrp.cpp",
1277 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001278 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001279 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001280 "bionic/grp_pwd.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001281 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001282 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001283 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001284 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001285 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001286 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001287 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001288 "bionic/lchown.cpp",
1289 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001290 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001291 "bionic/libgen.cpp",
1292 "bionic/link.cpp",
1293 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001294 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001295 "bionic/lstat.cpp",
1296 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001297 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001298 "bionic/mbrtoc16.cpp",
1299 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001300 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001301 "bionic/mempcpy.cpp",
1302 "bionic/mkdir.cpp",
1303 "bionic/mkfifo.cpp",
1304 "bionic/mknod.cpp",
1305 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001306 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001307 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001308 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001309 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001310 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001311 "bionic/open.cpp",
1312 "bionic/pathconf.cpp",
1313 "bionic/pause.cpp",
1314 "bionic/pipe.cpp",
1315 "bionic/poll.cpp",
1316 "bionic/posix_fadvise.cpp",
1317 "bionic/posix_fallocate.cpp",
1318 "bionic/posix_madvise.cpp",
1319 "bionic/posix_timers.cpp",
1320 "bionic/ptrace.cpp",
1321 "bionic/pty.cpp",
1322 "bionic/raise.cpp",
1323 "bionic/rand.cpp",
1324 "bionic/readlink.cpp",
1325 "bionic/reboot.cpp",
1326 "bionic/recv.cpp",
1327 "bionic/rename.cpp",
1328 "bionic/rmdir.cpp",
1329 "bionic/scandir.cpp",
1330 "bionic/sched_getaffinity.cpp",
1331 "bionic/sched_getcpu.cpp",
1332 "bionic/semaphore.cpp",
1333 "bionic/send.cpp",
1334 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001335 "bionic/seteuid.cpp",
1336 "bionic/setpgrp.cpp",
1337 "bionic/sigaction.cpp",
1338 "bionic/sigaddset.cpp",
1339 "bionic/sigdelset.cpp",
1340 "bionic/sigemptyset.cpp",
1341 "bionic/sigfillset.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001342 "bionic/sighold.cpp",
1343 "bionic/sigignore.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001344 "bionic/sigismember.cpp",
1345 "bionic/signal.cpp",
1346 "bionic/signalfd.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001347 "bionic/sigpause.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001348 "bionic/sigpending.cpp",
1349 "bionic/sigprocmask.cpp",
1350 "bionic/sigqueue.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001351 "bionic/sigrelse.cpp",
1352 "bionic/sigset.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001353 "bionic/sigsuspend.cpp",
1354 "bionic/sigtimedwait.cpp",
1355 "bionic/sigwait.cpp",
1356 "bionic/sigwaitinfo.cpp",
1357 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001358 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001359 "bionic/stat.cpp",
1360 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001361 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001362 "bionic/strchrnul.cpp",
1363 "bionic/strerror.cpp",
1364 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001365 "bionic/string_l.cpp",
1366 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001367 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001368 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001369 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001370 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001371 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001372 "bionic/sync_file_range.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001373 "bionic/sys_msg.cpp",
1374 "bionic/sys_sem.cpp",
1375 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001376 "bionic/sys_siglist.c",
1377 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001378 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001379 "bionic/sysinfo.cpp",
1380 "bionic/syslog.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001381 "bionic/system_property_api.cpp",
1382 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001383 "bionic/tdestroy.cpp",
1384 "bionic/termios.cpp",
1385 "bionic/thread_private.cpp",
1386 "bionic/tmpfile.cpp",
1387 "bionic/umount.cpp",
1388 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001389 "bionic/wait.cpp",
1390 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001391 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001392 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001393 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001394 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001395 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001396
1397 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1398 // which will be overridden by the actual one in libc.so.
1399 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001400 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001401
Dan Willemsen208ae172015-09-16 16:33:27 -07001402 multilib: {
1403 lib32: {
1404 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001405 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001406 },
1407 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001408 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001409 treble_linker_namespaces: {
1410 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001411 },
1412 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001413 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001414 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001415 local_include_dirs: ["stdio"],
1416 include_dirs: ["bionic/libstdc++/include"],
1417 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001418 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001419}
1420
Dan Willemsen208ae172015-09-16 16:33:27 -07001421// ========================================================
1422// libc_pthread.a - pthreads parts that previously lived in
1423// libc_bionic.a. Relocated to their own library because
1424// they can't be included in libc_ndk.a (as they layout of
1425// pthread_t has changed over the years and has ABI
1426// compatibility issues).
1427// ========================================================
1428
1429cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001430 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001431 srcs: [
1432 "bionic/pthread_atfork.cpp",
1433 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001434 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001435 "bionic/pthread_cond.cpp",
1436 "bionic/pthread_create.cpp",
1437 "bionic/pthread_detach.cpp",
1438 "bionic/pthread_equal.cpp",
1439 "bionic/pthread_exit.cpp",
1440 "bionic/pthread_getcpuclockid.cpp",
1441 "bionic/pthread_getschedparam.cpp",
1442 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001443 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001444 "bionic/pthread_join.cpp",
1445 "bionic/pthread_key.cpp",
1446 "bionic/pthread_kill.cpp",
1447 "bionic/pthread_mutex.cpp",
1448 "bionic/pthread_once.cpp",
1449 "bionic/pthread_rwlock.cpp",
1450 "bionic/pthread_self.cpp",
1451 "bionic/pthread_setname_np.cpp",
1452 "bionic/pthread_setschedparam.cpp",
1453 "bionic/pthread_sigmask.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001454 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001455
1456 // The following implementations depend on pthread data or implementation,
1457 // so we can't include them in libc_ndk.a.
1458 "bionic/__cxa_thread_atexit_impl.cpp",
1459 "stdlib/atexit.c",
1460 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001461 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001462
Colin Cross50c21ab2015-10-31 23:03:05 -07001463 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001464 include_dirs: ["bionic/libstdc++/include"],
1465 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001466}
1467
1468// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001469// libc_syscalls.a
1470// ========================================================
1471
1472cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001473 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001474 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001475 arch: {
1476 arm: {
1477 srcs: ["arch-arm/syscalls/**/*.S"],
1478 },
1479 arm64: {
1480 srcs: ["arch-arm64/syscalls/**/*.S"],
1481 },
1482 mips: {
1483 srcs: ["arch-mips/syscalls/**/*.S"],
1484 },
1485 mips64: {
1486 srcs: ["arch-mips64/syscalls/**/*.S"],
1487 },
1488 x86: {
1489 srcs: ["arch-x86/syscalls/**/*.S"],
1490 },
1491 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001492 srcs: ["arch-x86_64/syscalls/**/*.S"],
1493 },
1494 },
1495 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001496}
1497
1498// ========================================================
1499// libc_aeabi.a
1500// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1501// to avoid infinite recursion. For the other architectures we just build an
1502// empty library to keep this makefile simple.
1503// ========================================================
1504
1505cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001506 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001507 arch: {
1508 arm: {
1509 srcs: ["arch-arm/bionic/__aeabi.c"],
1510 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001511 },
1512 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001513 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001514}
1515
1516// ========================================================
1517// libc_ndk.a
1518// Compatibility library for the NDK. This library contains
1519// all the parts of libc that are safe to statically link.
1520// We can't safely statically link things that can only run
1521// on a certain version of the OS. Examples include
1522// anything that talks to netd (a large portion of the DNS
1523// code) and anything that is dependent on the layout of a
1524// data structure that has changed across releases (such as
1525// pthread_t).
1526// ========================================================
1527
1528cc_library_static {
1529 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001530 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001531 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001532 multilib: {
1533 lib32: {
1534 srcs: libc_common_src_files_32,
1535 },
1536 },
1537 arch: {
1538 arm: {
1539 srcs: [
1540 "arch-arm/bionic/exidx_dynamic.c",
1541 "arch-common/bionic/crtbegin_so.c",
1542 "arch-arm/bionic/atexit_legacy.c",
1543 "arch-common/bionic/crtend_so.S",
1544 ],
1545 whole_static_libs: ["libc_aeabi"],
1546 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001547 },
1548
Colin Cross50c21ab2015-10-31 23:03:05 -07001549 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001550 "-fvisibility=hidden",
1551 "-DLIBC_STATIC",
1552 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001553
1554 whole_static_libs: [
1555 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001556 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001557 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001558 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001559 "libc_gdtoa",
1560 "libc_malloc",
1561 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001562 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001563 "libc_openbsd_ndk",
1564 "libc_stack_protector",
1565 "libc_syscalls",
1566 "libc_tzcode",
1567 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001568 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001569 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001570 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001571}
1572
1573// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001574// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001575// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001576cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001577 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001578 srcs: libc_common_src_files,
1579 multilib: {
1580 lib32: {
1581 srcs: libc_common_src_files_32,
1582 },
1583 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001584 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001585
1586 whole_static_libs: [
1587 "libc_bionic",
1588 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001589 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001590 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001591 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001592 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001593 "libc_gdtoa",
1594 "libc_malloc",
1595 "libc_netbsd",
1596 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001597 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001598 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001599 "libc_stack_protector",
1600 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001601 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001602 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001603 ],
1604
1605 arch: {
1606 arm: {
1607 whole_static_libs: ["libc_aeabi"],
1608 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001609 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001610}
1611
1612// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001613// libc_common.a
1614// ========================================================
1615
1616cc_library_static {
1617 defaults: ["libc_defaults"],
1618 name: "libc_common",
1619
1620 whole_static_libs: [
1621 "libc_nopthread",
1622 "libc_pthread",
1623 ],
1624}
1625
1626// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001627// libc_nomalloc.a
1628// ========================================================
1629//
1630// This is a version of the static C library that does not
1631// include malloc. It's useful in situations when the user wants
1632// to provide their own malloc implementation, or wants to
1633// explicitly disallow the use of malloc, such as in the
1634// dynamic linker.
1635
1636cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001637 name: "libc_nomalloc",
1638
Colin Cross50c21ab2015-10-31 23:03:05 -07001639 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001640
1641 arch: {
1642 arm: {
1643 srcs: ["arch-arm/bionic/exidx_static.c"],
1644 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001645 },
1646
Colin Cross50c21ab2015-10-31 23:03:05 -07001647 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001648
Colin Crossa3f9fca2016-01-11 13:20:55 -08001649 whole_static_libs: [
1650 "libc_common",
1651 "libc_init_static",
1652 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001653}
1654
1655// ========================================================
1656// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1657// ========================================================
1658cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001659 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001660 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001661 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001662
Dan Willemsen208ae172015-09-16 16:33:27 -07001663 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001664}
1665
1666// ========================================================
1667// libc.a + libc.so
1668// ========================================================
1669cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001670 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001671 name: "libc",
Colin Cross50c21ab2015-10-31 23:03:05 -07001672 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001673 platform_sdk_version: {
1674 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1675 },
1676 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001677 static: {
1678 srcs: [
1679 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001680 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001681 ],
1682 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001683 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001684 },
1685 shared: {
1686 srcs: [
1687 "arch-common/bionic/crtbegin_so.c",
1688 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001689 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001690 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001691 "bionic/NetdClient.cpp",
1692 "arch-common/bionic/crtend_so.S",
1693 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001694 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001695 },
1696
1697 required: ["tzdata"],
1698
1699 // Leave the symbols in the shared library so that stack unwinders can produce
1700 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001701 strip: {
1702 keep_symbols: true,
1703 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001704
Colin Cross4ce94d22016-11-15 13:15:43 -08001705 // Do not pack libc.so relocations; see http://b/20645321 for details.
1706 pack_relocations: false,
1707
dimitry06016f22018-01-05 11:39:28 +01001708 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1709 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1710 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1711 // those new libraries from libgcc.a are not declared external; if that were the case,
1712 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1713 // on the external symbols from the dependent libraries. That would create a "cloaked"
1714 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001715
dimitry06016f22018-01-05 11:39:28 +01001716 shared_libs: [
1717 "ld-android",
1718 "libdl",
1719 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001720 whole_static_libs: ["libc_common", "libjemalloc"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001721
1722 nocrt: true,
1723
Dan Willemsen208ae172015-09-16 16:33:27 -07001724 arch: {
1725 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001726 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1727 ldflags: ["-Wl,--hash-style=both"],
1728
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001729 // Don't re-export new/delete and friends, even if the compiler really wants to.
1730 version_script: "libc.arm.map",
1731
Dan Willemsen208ae172015-09-16 16:33:27 -07001732 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001733 srcs: [
1734 "arch-arm/bionic/exidx_dynamic.c",
1735
1736 // special for arm
1737 "arch-arm/bionic/atexit_legacy.c",
1738 ],
1739 // special for arm
1740 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001741 },
1742 static: {
1743 srcs: ["arch-arm/bionic/exidx_static.c"],
1744 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001745 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001746 arm64: {
1747 // Don't re-export new/delete and friends, even if the compiler really wants to.
1748 version_script: "libc.arm64.map",
1749 },
1750 mips: {
1751 // Don't re-export new/delete and friends, even if the compiler really wants to.
1752 version_script: "libc.mips.map",
1753 },
1754 mips64: {
1755 // Don't re-export new/delete and friends, even if the compiler really wants to.
1756 version_script: "libc.mips64.map",
1757 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001758 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001759 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1760 ldflags: ["-Wl,--hash-style=both"],
1761
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001762 // Don't re-export new/delete and friends, even if the compiler really wants to.
1763 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001764 },
1765 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001766 // Don't re-export new/delete and friends, even if the compiler really wants to.
1767 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001768 },
1769 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001770}
1771
Dan Willemsen208ae172015-09-16 16:33:27 -07001772// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001773// libstdc++.so + libstdc++.a
1774// ========================================================
1775cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001776 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001777 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001778 srcs: [
1779 "bionic/__cxa_guard.cpp",
1780 "bionic/__cxa_pure_virtual.cpp",
1781 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001782 ],
1783 name: "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001784 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001785 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001786
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001787 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001788 arch: {
1789 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001790 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001791 version_script: "libstdc++.arm.map",
1792 },
1793 arm64: {
1794 version_script: "libstdc++.arm64.map",
1795 },
1796 mips: {
1797 version_script: "libstdc++.mips.map",
1798 },
1799 mips64: {
1800 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001801 },
1802 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001803 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001804 version_script: "libstdc++.x86.map",
1805 },
1806 x86_64: {
1807 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001808 },
1809 },
1810}
1811
Colin Cross50c21ab2015-10-31 23:03:05 -07001812cc_defaults {
1813 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001814 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001815 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001816
Colin Cross7d7b3682017-11-03 13:38:40 -07001817 cflags: ["-Wno-gcc-compat", "-Wall", "-Werror"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001818}
1819
Colin Cross50c21ab2015-10-31 23:03:05 -07001820cc_defaults {
1821 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001822 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001823
1824 arch: {
1825 mips: {
1826 cflags: ["-fPIC"],
1827 },
1828 mips64: {
1829 cflags: ["-fPIC"],
1830 },
1831 x86: {
1832 cflags: ["-fPIC"],
1833 },
1834 x86_64: {
1835 cflags: ["-fPIC"],
1836 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001837 },
1838}
1839
Dan Willemsena3ed9012017-04-04 15:51:26 -07001840// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001841cc_object {
1842 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001843 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001844 local_include_dirs: ["include"],
1845 product_variables: {
1846 platform_sdk_version: {
1847 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1848 },
1849 },
1850 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001851
Colin Cross7d7b3682017-11-03 13:38:40 -07001852 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001853}
1854
Dan Willemsen208ae172015-09-16 16:33:27 -07001855cc_object {
1856 name: "crtbegin_so1",
1857 local_include_dirs: ["include"],
1858 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001859
Colin Cross7d7b3682017-11-03 13:38:40 -07001860 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001861}
1862
Dan Willemsen208ae172015-09-16 16:33:27 -07001863cc_object {
1864 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001865
Colin Cross7d7b3682017-11-03 13:38:40 -07001866 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001867 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001868 "crtbegin_so1",
1869 "crtbrand",
1870 ],
1871}
1872
Dan Willemsen208ae172015-09-16 16:33:27 -07001873cc_object {
1874 name: "crtend_so",
1875 local_include_dirs: ["include"],
1876 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001877
Colin Cross7d7b3682017-11-03 13:38:40 -07001878 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001879}
1880
Dan Willemsen208ae172015-09-16 16:33:27 -07001881cc_object {
1882 name: "crtbegin_static1",
1883 local_include_dirs: ["include"],
1884 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001885
Colin Cross50c21ab2015-10-31 23:03:05 -07001886 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001887 mips: {
1888 srcs: [
1889 "arch-mips/bionic/crtbegin.c",
1890 ],
1891 exclude_srcs: [
1892 "arch-common/bionic/crtbegin.c",
1893 ],
1894 },
1895 mips64: {
1896 srcs: [
1897 "arch-mips64/bionic/crtbegin.c",
1898 ],
1899 exclude_srcs: [
1900 "arch-common/bionic/crtbegin.c",
1901 ],
1902 },
1903 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001904
1905 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001906}
1907
Dan Willemsen208ae172015-09-16 16:33:27 -07001908cc_object {
1909 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001910
Colin Cross77d57bf2016-04-11 14:34:18 -07001911 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001912 "crtbegin_static1",
1913 "crtbrand",
1914 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001915 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001916}
1917
Dan Willemsen208ae172015-09-16 16:33:27 -07001918cc_object {
1919 name: "crtbegin_dynamic1",
1920 local_include_dirs: ["include"],
1921 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001922
Colin Cross50c21ab2015-10-31 23:03:05 -07001923 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001924 mips: {
1925 srcs: [
1926 "arch-mips/bionic/crtbegin.c",
1927 ],
1928 exclude_srcs: [
1929 "arch-common/bionic/crtbegin.c",
1930 ],
1931 },
1932 mips64: {
1933 srcs: [
1934 "arch-mips64/bionic/crtbegin.c",
1935 ],
1936 exclude_srcs: [
1937 "arch-common/bionic/crtbegin.c",
1938 ],
1939 },
1940 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001941 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001942}
1943
Dan Willemsen208ae172015-09-16 16:33:27 -07001944cc_object {
1945 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001946
Colin Cross77d57bf2016-04-11 14:34:18 -07001947 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001948 "crtbegin_dynamic1",
1949 "crtbrand",
1950 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001951 target: {
1952 linux_bionic: {
1953 generated_sources: ["host_bionic_linker_asm"],
1954 objs: [
1955 "linker_wrapper",
1956 ],
1957 },
1958 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001959 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001960}
1961
Dan Willemsen208ae172015-09-16 16:33:27 -07001962cc_object {
1963 // We rename crtend.o to crtend_android.o to avoid a
1964 // name clash between gcc and bionic.
1965 name: "crtend_android",
1966 local_include_dirs: ["include"],
1967 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001968
Colin Cross50c21ab2015-10-31 23:03:05 -07001969 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001970}
Colin Crossbaa48992016-07-13 11:15:21 -07001971
Dan Albert22805ea2017-03-22 15:28:05 -07001972preprocessed_ndk_headers {
1973 name: "common_libc",
1974 from: "include",
1975 to: "",
1976 license: "NOTICE",
1977}
Dan Albert4238a352016-06-28 11:18:05 -07001978
1979ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08001980 name: "libc_uapi",
1981 from: "kernel/uapi",
1982 to: "",
1983 srcs: [
1984 "kernel/uapi/asm-generic/**/*.h",
1985 "kernel/uapi/drm/**/*.h",
1986 "kernel/uapi/linux/**/*.h",
1987 "kernel/uapi/misc/**/*.h",
1988 "kernel/uapi/mtd/**/*.h",
1989 "kernel/uapi/rdma/**/*.h",
1990 "kernel/uapi/scsi/**/*.h",
1991 "kernel/uapi/sound/**/*.h",
1992 "kernel/uapi/video/**/*.h",
1993 "kernel/uapi/xen/**/*.h",
1994 ],
Dan Albert92592652016-10-20 01:42:54 -07001995 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07001996}
1997
1998ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001999 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002000 from: "kernel/android/uapi/linux",
2001 to: "linux",
2002 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002003 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002004}
2005
2006ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002007 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002008 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002009 to: "scsi",
2010 srcs: ["kernel/android/scsi/**/*.h"],
2011 license: "NOTICE",
2012}
2013
2014ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002015 name: "libc_asm_arm",
2016 from: "kernel/uapi/asm-arm",
2017 to: "arm-linux-androideabi",
2018 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002019 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002020}
2021
2022ndk_headers {
2023 name: "libc_asm_arm64",
2024 from: "kernel/uapi/asm-arm64",
2025 to: "aarch64-linux-android",
2026 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002027 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002028}
2029
Elliott Hughesee291c02017-12-11 11:32:34 -08002030// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002031ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002032 name: "libc_asm_mips",
2033 from: "kernel/uapi/asm-mips",
2034 to: "mipsel-linux-android",
2035 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2036 license: "NOTICE",
2037}
2038
Elliott Hughesee291c02017-12-11 11:32:34 -08002039// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002040ndk_headers {
2041 name: "libc_asm_mips64",
2042 from: "kernel/uapi/asm-mips",
2043 to: "mips64el-linux-android",
2044 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2045 license: "NOTICE",
2046}
2047
2048ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002049 name: "libc_asm_x86",
2050 from: "kernel/uapi/asm-x86",
2051 to: "i686-linux-android",
2052 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002053 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002054}
2055
2056ndk_headers {
2057 name: "libc_asm_x86_64",
2058 from: "kernel/uapi/asm-x86",
2059 to: "x86_64-linux-android",
2060 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002061 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002062}
2063
Dan Albert4238a352016-06-28 11:18:05 -07002064ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002065 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002066 symbol_file: "libc.map.txt",
2067 first_version: "9",
2068}
2069
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002070llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002071 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002072 symbol_file: "libc.map.txt",
2073 export_headers_as_system: true,
2074 export_preprocessed_headers: ["include"],
2075 arch: {
2076 arm: {
2077 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002078 "kernel/uapi",
2079 "kernel/uapi/asm-arm",
2080 "kernel/android/uapi",
2081 ],
2082 },
2083 arm64: {
2084 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002085 "kernel/uapi",
2086 "kernel/uapi/asm-arm64",
2087 "kernel/android/uapi",
2088 ],
2089 },
2090 mips: {
2091 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002092 "kernel/uapi",
2093 "kernel/uapi/asm-mips",
2094 "kernel/android/uapi",
2095 ],
2096 },
2097 mips64: {
2098 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002099 "kernel/uapi",
2100 "kernel/uapi/asm-mips",
2101 "kernel/android/uapi",
2102 ],
2103 },
2104 x86: {
2105 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002106 "kernel/uapi",
2107 "kernel/uapi/asm-x86",
2108 "kernel/android/uapi",
2109 ],
2110 },
2111 x86_64: {
2112 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002113 "kernel/uapi",
2114 "kernel/uapi/asm-x86",
2115 "kernel/android/uapi",
2116 ],
2117 },
2118 },
2119}
2120
Dan Albertdf31aff2016-10-06 15:50:41 -07002121ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002122 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002123 symbol_file: "libstdc++.map.txt",
2124 first_version: "9",
2125}
2126
Dan Willemsenca056d72018-01-08 14:00:24 -08002127// Export these headers for toolbox to process
2128filegroup {
2129 name: "kernel_input_headers",
2130 srcs: [
2131 "kernel/uapi/linux/input.h",
2132 "kernel/uapi/linux/input-event-codes.h",
2133 ],
2134}