blob: f5491f5ac870481ed2d6dbf941631fc568783591 [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",
27]
28
29libc_common_src_files_32 = [
30 "bionic/legacy_32_bit_support.cpp",
31 "bionic/time64.c",
32]
33
Elliott Hughes53cf3482016-08-09 13:06:41 -070034libc_common_flags = [
35 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080036 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070037 "-Wall",
38 "-Wextra",
39 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080040 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070041 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070042 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070043 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070044
45 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
46 "-Werror=pointer-to-int-cast",
47 "-Werror=int-to-pointer-cast",
48 "-Werror=type-limits",
49 "-Werror",
50]
51
Dan Willemsen208ae172015-09-16 16:33:27 -070052// Define some common cflags
53// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070054cc_defaults {
55 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080056 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070057 cflags: libc_common_flags,
58 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070059 conlyflags: ["-std=gnu99"],
60 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070061 include_dirs: [
62 "bionic/libc/async_safe/include",
63 "external/jemalloc/include",
64 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070065
Colin Cross50c21ab2015-10-31 23:03:05 -070066 stl: "none",
67 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070068 sanitize: {
69 never: true,
70 },
Colin Cross50c21ab2015-10-31 23:03:05 -070071 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070072}
73
Dan Willemsen208ae172015-09-16 16:33:27 -070074// ANDROIDMK TRANSLATION ERROR: unsupported directive
75// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
76//libc_common_cflags += ["-DDEBUG"]
77// ANDROIDMK TRANSLATION ERROR: unsupported directive
78// endif
79
Dan Willemsen208ae172015-09-16 16:33:27 -070080// ========================================================
81// libc_stack_protector.a - stack protector code
82// ========================================================
83//
Colin Crossa3f9fca2016-01-11 13:20:55 -080084// Code that implements the stack protector (or that runs
85// before TLS has been set up) needs to be compiled with
86// -fno-stack-protector, since it accesses the stack canary
87// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070088
89cc_library_static {
90
Colin Crossa3f9fca2016-01-11 13:20:55 -080091 srcs: [
92 "bionic/__libc_init_main_thread.cpp",
93 "bionic/__stack_chk_fail.cpp",
94 ],
95 arch: {
96 arm64: {
97 srcs: ["arch-arm64/bionic/__set_tls.c"],
98 },
99 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800100 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800101 },
102 x86_64: {
103 srcs: ["arch-x86_64/bionic/__set_tls.c"],
104 },
105 },
106
Colin Cross50c21ab2015-10-31 23:03:05 -0700107 defaults: ["libc_defaults"],
108 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700109 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700110}
111
Colin Crossa3f9fca2016-01-11 13:20:55 -0800112// libc_init_static.cpp also needs to be built without stack protector,
113// because it's responsible for setting up TLS for static executables.
114// This isn't the case for dynamic executables because the dynamic linker
115// has already set up the main thread's TLS.
116
117cc_library_static {
118 name: "libc_init_static",
119 defaults: ["libc_defaults"],
120 srcs: ["bionic/libc_init_static.cpp"],
121 cflags: ["-fno-stack-protector"],
122}
123
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700124cc_library_static {
125 name: "libc_init_dynamic",
126 defaults: ["libc_defaults"],
127 srcs: ["bionic/libc_init_dynamic.cpp"],
128 cflags: ["-fno-stack-protector"],
129}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800130
Dan Willemsen208ae172015-09-16 16:33:27 -0700131// ========================================================
132// libc_tzcode.a - upstream 'tzcode' code
133// ========================================================
134
135cc_library_static {
136
Colin Cross50c21ab2015-10-31 23:03:05 -0700137 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700138 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800139 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700140 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700141 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
142 ],
143
Colin Cross50c21ab2015-10-31 23:03:05 -0700144 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700145 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700146 // Don't use ridiculous amounts of stack.
147 "-DALL_STATE",
148 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
149 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800150 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700151 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700152 // The name of the tm_gmtoff field in our struct tm.
153 "-DTM_GMTOFF=tm_gmtoff",
154 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700155 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700156 // Include `tzname`, `timezone`, and `daylight` globals.
157 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700158 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800159 // Use the empty string (instead of " ") as the timezone abbreviation
160 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700161 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700162 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
163 "-Dlint",
164 ],
165
Dan Willemsen208ae172015-09-16 16:33:27 -0700166 local_include_dirs: ["tzcode/"],
167 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700168}
169
170// ========================================================
171// libc_dns.a - modified NetBSD DNS code
172// ========================================================
173
174cc_library_static {
175
Colin Cross50c21ab2015-10-31 23:03:05 -0700176 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700177 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800178 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700179
180 "upstream-netbsd/lib/libc/isc/ev_streams.c",
181 "upstream-netbsd/lib/libc/isc/ev_timers.c",
182 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700183 ],
184
Colin Cross50c21ab2015-10-31 23:03:05 -0700185 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700186 "-DANDROID_CHANGES",
187 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700188 "-Wno-unused-parameter",
189 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700190 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700191 ],
192
Dan Willemsen208ae172015-09-16 16:33:27 -0700193 local_include_dirs: [
194 "dns/include",
195 "private",
196 "upstream-netbsd/lib/libc/include",
197 "upstream-netbsd/android/include",
198 ],
199
200 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700201}
202
203// ========================================================
204// libc_freebsd.a - upstream FreeBSD C library code
205// ========================================================
206//
207// These files are built with the freebsd-compat.h header file
208// automatically included.
209
210cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700211 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700212 srcs: [
213 "upstream-freebsd/lib/libc/gen/ldexp.c",
214 "upstream-freebsd/lib/libc/gen/sleep.c",
215 "upstream-freebsd/lib/libc/gen/usleep.c",
216 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700217 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
218 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
219 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
220 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700221 "upstream-freebsd/lib/libc/stdlib/qsort.c",
222 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700223 "upstream-freebsd/lib/libc/string/wcpcpy.c",
224 "upstream-freebsd/lib/libc/string/wcpncpy.c",
225 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700226 "upstream-freebsd/lib/libc/string/wcscat.c",
227 "upstream-freebsd/lib/libc/string/wcschr.c",
228 "upstream-freebsd/lib/libc/string/wcscmp.c",
229 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700230 "upstream-freebsd/lib/libc/string/wcscspn.c",
231 "upstream-freebsd/lib/libc/string/wcsdup.c",
232 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700233 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700234 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
235 "upstream-freebsd/lib/libc/string/wcsncat.c",
236 "upstream-freebsd/lib/libc/string/wcsncmp.c",
237 "upstream-freebsd/lib/libc/string/wcsncpy.c",
238 "upstream-freebsd/lib/libc/string/wcsnlen.c",
239 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700240 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700241 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700242 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700243 "upstream-freebsd/lib/libc/string/wcstok.c",
244 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700245 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700246 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700247 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800248 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700249 ],
250 arch: {
251 arm64: {
252 exclude_srcs: [
253 "upstream-freebsd/lib/libc/string/wmemmove.c",
254 ],
255 },
256 x86: {
257 exclude_srcs: [
258 "upstream-freebsd/lib/libc/string/wcschr.c",
259 "upstream-freebsd/lib/libc/string/wcscmp.c",
260 "upstream-freebsd/lib/libc/string/wcslen.c",
261 "upstream-freebsd/lib/libc/string/wcsrchr.c",
262 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800263 atom: {
264 exclude_srcs: [
265 "upstream-freebsd/lib/libc/string/wmemcmp.c",
266 ],
267 },
268 ssse3: {
269 exclude_srcs: [
270 "upstream-freebsd/lib/libc/string/wcscat.c",
271 "upstream-freebsd/lib/libc/string/wcscpy.c",
272 ],
273 },
274 sse4: {
275 exclude_srcs: [
276 "upstream-freebsd/lib/libc/string/wmemcmp.c",
277 ],
278 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700279 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700280 },
281
Colin Cross50c21ab2015-10-31 23:03:05 -0700282 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 "-Wno-sign-compare",
284 "-Wno-uninitialized",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700285 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700286 "-include freebsd-compat.h",
287 ],
288
Dan Willemsen208ae172015-09-16 16:33:27 -0700289 local_include_dirs: [
290 "upstream-freebsd/android/include",
291 ],
292
293 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700294}
295
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700296cc_library_static {
297 defaults: ["libc_defaults"],
298 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700299 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700300 "upstream-freebsd/lib/libc/stdlib/realpath.c",
301 ],
302
303 cflags: [
304 "-Wno-sign-compare",
305 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700306 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700307 ],
308
309 local_include_dirs: [
310 "upstream-freebsd/android/include",
311 ],
312
313 name: "libc_freebsd_large_stack",
314}
315
Dan Willemsen208ae172015-09-16 16:33:27 -0700316// ========================================================
317// libc_netbsd.a - upstream NetBSD C library code
318// ========================================================
319//
320// These files are built with the netbsd-compat.h header file
321// automatically included.
322
323cc_library_static {
324
Colin Cross50c21ab2015-10-31 23:03:05 -0700325 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700326 srcs: [
327 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700328 "upstream-netbsd/lib/libc/gen/nice.c",
329 "upstream-netbsd/lib/libc/gen/popen.c",
330 "upstream-netbsd/lib/libc/gen/psignal.c",
331 "upstream-netbsd/lib/libc/gen/utime.c",
332 "upstream-netbsd/lib/libc/gen/utmp.c",
333 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
334 "upstream-netbsd/lib/libc/regex/regcomp.c",
335 "upstream-netbsd/lib/libc/regex/regerror.c",
336 "upstream-netbsd/lib/libc/regex/regexec.c",
337 "upstream-netbsd/lib/libc/regex/regfree.c",
338 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
339 "upstream-netbsd/lib/libc/stdlib/div.c",
340 "upstream-netbsd/lib/libc/stdlib/drand48.c",
341 "upstream-netbsd/lib/libc/stdlib/erand48.c",
342 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
343 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
344 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
345 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
346 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
347 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
348 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
349 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
350 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
351 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
352 "upstream-netbsd/lib/libc/stdlib/seed48.c",
353 "upstream-netbsd/lib/libc/stdlib/srand48.c",
354 "upstream-netbsd/lib/libc/string/memccpy.c",
355 "upstream-netbsd/lib/libc/string/strcasestr.c",
356 "upstream-netbsd/lib/libc/string/strcoll.c",
357 "upstream-netbsd/lib/libc/string/strxfrm.c",
358 ],
359 multilib: {
360 lib32: {
361 // LP32 cruft
362 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
363 },
364 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700365 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700366 "-Wno-sign-compare",
367 "-Wno-uninitialized",
Dan Willemsen879cec22016-02-29 10:37:56 -0800368 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700369 "-DPOSIX_MISTAKE",
370 "-include netbsd-compat.h",
371 ],
372
Dan Willemsen208ae172015-09-16 16:33:27 -0700373 local_include_dirs: [
374 "upstream-netbsd/android/include",
375 "upstream-netbsd/lib/libc/include",
376 ],
377
378 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700379}
380
381// ========================================================
382// libc_openbsd_ndk.a - upstream OpenBSD C library code
383// that can be safely included in the libc_ndk.a (doesn't
384// contain any troublesome global data or constructors).
385// ========================================================
386//
387// These files are built with the openbsd-compat.h header file
388// automatically included.
389
390cc_library_static {
391 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700392 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700393 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700394 "upstream-openbsd/lib/libc/gen/alarm.c",
395 "upstream-openbsd/lib/libc/gen/ctype_.c",
396 "upstream-openbsd/lib/libc/gen/daemon.c",
397 "upstream-openbsd/lib/libc/gen/err.c",
398 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700399 "upstream-openbsd/lib/libc/gen/fnmatch.c",
400 "upstream-openbsd/lib/libc/gen/ftok.c",
401 "upstream-openbsd/lib/libc/gen/getprogname.c",
402 "upstream-openbsd/lib/libc/gen/isctype.c",
403 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700404 "upstream-openbsd/lib/libc/gen/tolower_.c",
405 "upstream-openbsd/lib/libc/gen/toupper_.c",
406 "upstream-openbsd/lib/libc/gen/verr.c",
407 "upstream-openbsd/lib/libc/gen/verrx.c",
408 "upstream-openbsd/lib/libc/gen/vwarn.c",
409 "upstream-openbsd/lib/libc/gen/vwarnx.c",
410 "upstream-openbsd/lib/libc/gen/warn.c",
411 "upstream-openbsd/lib/libc/gen/warnx.c",
412 "upstream-openbsd/lib/libc/locale/btowc.c",
413 "upstream-openbsd/lib/libc/locale/mbrlen.c",
414 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
415 "upstream-openbsd/lib/libc/locale/mbtowc.c",
416 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700417 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
418 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700419 "upstream-openbsd/lib/libc/locale/wcstoll.c",
420 "upstream-openbsd/lib/libc/locale/wcstombs.c",
421 "upstream-openbsd/lib/libc/locale/wcstoul.c",
422 "upstream-openbsd/lib/libc/locale/wcstoull.c",
423 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
424 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
425 "upstream-openbsd/lib/libc/locale/wctob.c",
426 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700427 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700428 "upstream-openbsd/lib/libc/net/htonl.c",
429 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700430 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
431 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
432 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700433 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
434 "upstream-openbsd/lib/libc/net/inet_ntop.c",
435 "upstream-openbsd/lib/libc/net/inet_pton.c",
436 "upstream-openbsd/lib/libc/net/ntohl.c",
437 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800438 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700439 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700440 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
441 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700444 "upstream-openbsd/lib/libc/stdio/fputwc.c",
445 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
447 "upstream-openbsd/lib/libc/stdio/fwalk.c",
448 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700449 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700450 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700451 "upstream-openbsd/lib/libc/stdio/makebuf.c",
452 "upstream-openbsd/lib/libc/stdio/mktemp.c",
453 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
454 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700456 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700457 "upstream-openbsd/lib/libc/stdio/tempnam.c",
458 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
459 "upstream-openbsd/lib/libc/stdio/ungetc.c",
460 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
461 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
462 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700463 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
464 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
465 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700466 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-openbsd/lib/libc/stdio/wsetup.c",
468 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700469 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700470 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700471 "upstream-openbsd/lib/libc/stdlib/insque.c",
472 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
473 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
474 "upstream-openbsd/lib/libc/stdlib/labs.c",
475 "upstream-openbsd/lib/libc/stdlib/llabs.c",
476 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
477 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
478 "upstream-openbsd/lib/libc/stdlib/remque.c",
479 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700480 "upstream-openbsd/lib/libc/stdlib/system.c",
481 "upstream-openbsd/lib/libc/stdlib/tfind.c",
482 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
483 "upstream-openbsd/lib/libc/string/strcasecmp.c",
484 "upstream-openbsd/lib/libc/string/strcspn.c",
485 "upstream-openbsd/lib/libc/string/strdup.c",
486 "upstream-openbsd/lib/libc/string/strndup.c",
487 "upstream-openbsd/lib/libc/string/strpbrk.c",
488 "upstream-openbsd/lib/libc/string/strsep.c",
489 "upstream-openbsd/lib/libc/string/strspn.c",
490 "upstream-openbsd/lib/libc/string/strstr.c",
491 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700492 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700493 "upstream-openbsd/lib/libc/string/wcswidth.c",
494 ],
495
Colin Cross50c21ab2015-10-31 23:03:05 -0700496 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700497 "-Wno-sign-compare",
498 "-Wno-uninitialized",
499 "-Wno-unused-parameter",
500 "-include openbsd-compat.h",
501 ],
502
Dan Willemsen208ae172015-09-16 16:33:27 -0700503 local_include_dirs: [
504 "private",
505 "stdio",
506 "upstream-openbsd/android/include",
507 "upstream-openbsd/lib/libc/include",
508 "upstream-openbsd/lib/libc/gdtoa/",
509 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700510}
511
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700512cc_library_static {
513 name: "libc_openbsd_large_stack",
514 defaults: ["libc_defaults"],
515 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700516 "stdio/vfprintf.cpp",
517 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700518 ],
519 cflags: [
520 "-include openbsd-compat.h",
521 "-Wno-sign-compare",
522 "-Wframe-larger-than=5000",
523 ],
524
525 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700526 "upstream-openbsd/android/include/",
527 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700528 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700529 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700530 ],
531}
532
Dan Willemsen208ae172015-09-16 16:33:27 -0700533// ========================================================
534// libc_openbsd.a - upstream OpenBSD C library code
535// ========================================================
536//
537// These files are built with the openbsd-compat.h header file
538// automatically included.
539cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700540 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700541 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800542 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700543 "upstream-openbsd/lib/libc/crypt/arc4random.c",
544 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
545
546 // May be overriden by per-arch optimized versions
547 "upstream-openbsd/lib/libc/string/memchr.c",
548 "upstream-openbsd/lib/libc/string/memmove.c",
549 "upstream-openbsd/lib/libc/string/memrchr.c",
550 "upstream-openbsd/lib/libc/string/stpcpy.c",
551 "upstream-openbsd/lib/libc/string/stpncpy.c",
552 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700553 "upstream-openbsd/lib/libc/string/strcpy.c",
554 "upstream-openbsd/lib/libc/string/strlcat.c",
555 "upstream-openbsd/lib/libc/string/strlcpy.c",
556 "upstream-openbsd/lib/libc/string/strncat.c",
557 "upstream-openbsd/lib/libc/string/strncmp.c",
558 "upstream-openbsd/lib/libc/string/strncpy.c",
559 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700560
561 arch: {
562 arm: {
563 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700564 "upstream-openbsd/lib/libc/string/strcpy.c",
565 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800566 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700567 exclude_srcs: [
568 "upstream-openbsd/lib/libc/string/memmove.c",
569 "upstream-openbsd/lib/libc/string/stpcpy.c",
570 "upstream-openbsd/lib/libc/string/strcat.c",
571 ],
572 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700573 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700574 arm64: {
575 exclude_srcs: [
576 "upstream-openbsd/lib/libc/string/memchr.c",
577 "upstream-openbsd/lib/libc/string/memmove.c",
578 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700579 "upstream-openbsd/lib/libc/string/strcpy.c",
580 "upstream-openbsd/lib/libc/string/strncmp.c",
581 ],
582 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530583 mips: {
584 exclude_srcs: [
585 "upstream-openbsd/lib/libc/string/memchr.c",
586 "upstream-openbsd/lib/libc/string/memmove.c",
587 "upstream-openbsd/lib/libc/string/strcpy.c",
588 "upstream-openbsd/lib/libc/string/strncmp.c",
589 ],
590 },
591 mips64: {
592 exclude_srcs: [
593 "upstream-openbsd/lib/libc/string/memchr.c",
594 "upstream-openbsd/lib/libc/string/memmove.c",
595 "upstream-openbsd/lib/libc/string/strcpy.c",
596 "upstream-openbsd/lib/libc/string/strncmp.c",
597 ],
598 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700599 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800600 exclude_srcs: [
601 "upstream-openbsd/lib/libc/string/memchr.c",
602 "upstream-openbsd/lib/libc/string/memmove.c",
603 "upstream-openbsd/lib/libc/string/memrchr.c",
604 "upstream-openbsd/lib/libc/string/stpcpy.c",
605 "upstream-openbsd/lib/libc/string/stpncpy.c",
606 "upstream-openbsd/lib/libc/string/strcat.c",
607 "upstream-openbsd/lib/libc/string/strcpy.c",
608 "upstream-openbsd/lib/libc/string/strncmp.c",
609 "upstream-openbsd/lib/libc/string/strncpy.c",
610 ],
611 ssse3: {
612 exclude_srcs: [
613 "upstream-openbsd/lib/libc/string/strlcat.c",
614 "upstream-openbsd/lib/libc/string/strlcpy.c",
615 "upstream-openbsd/lib/libc/string/strncat.c",
616 ],
617 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700618 },
619
620 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800621 exclude_srcs: [
622 "upstream-openbsd/lib/libc/string/memmove.c",
623 "upstream-openbsd/lib/libc/string/stpcpy.c",
624 "upstream-openbsd/lib/libc/string/stpncpy.c",
625 "upstream-openbsd/lib/libc/string/strcat.c",
626 "upstream-openbsd/lib/libc/string/strcpy.c",
627 "upstream-openbsd/lib/libc/string/strlcat.c",
628 "upstream-openbsd/lib/libc/string/strlcpy.c",
629 "upstream-openbsd/lib/libc/string/strncat.c",
630 "upstream-openbsd/lib/libc/string/strncmp.c",
631 "upstream-openbsd/lib/libc/string/strncpy.c",
632 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700633 },
634 },
635
Colin Cross50c21ab2015-10-31 23:03:05 -0700636 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700637 "-Wno-sign-compare",
638 "-Wno-uninitialized",
639 "-Wno-unused-parameter",
640 "-include openbsd-compat.h",
641 ],
642
Dan Willemsen208ae172015-09-16 16:33:27 -0700643 local_include_dirs: [
644 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700645 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700646 ],
647
648 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700649}
650
651// ========================================================
652// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
653// ========================================================
654//
655// These files are built with the openbsd-compat.h header file
656// automatically included.
657
658cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700659 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700660 srcs: [
661 "upstream-openbsd/android/gdtoa_support.cpp",
662 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
663 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
664 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
665 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
666 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
667 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
668 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
669 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
670 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
671 "upstream-openbsd/lib/libc/gdtoa/misc.c",
672 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
673 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
674 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
675 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
676 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
677 "upstream-openbsd/lib/libc/gdtoa/sum.c",
678 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
679 ],
680 multilib: {
681 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800682 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700683 },
684 },
685
Colin Cross50c21ab2015-10-31 23:03:05 -0700686 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700687 "-Wno-sign-compare",
688 "-Wno-uninitialized",
Dan Willemsen208ae172015-09-16 16:33:27 -0700689 "-include openbsd-compat.h",
690 ],
691
Dan Willemsen208ae172015-09-16 16:33:27 -0700692 local_include_dirs: [
693 "private",
694 "upstream-openbsd/android/include",
695 "upstream-openbsd/lib/libc/include",
696 ],
697
698 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700699}
700
701// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700702// libc_fortify.a - container for our FORITFY
703// implementation details
704// ========================================================
705cc_library_static {
706 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700707 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700708
709 name: "libc_fortify",
710
711 // Disable FORTIFY for the compilation of these, so we don't end up having
712 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800713 cflags: [
714 "-U_FORTIFY_SOURCE",
715 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
716 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700717
718 arch: {
719 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700720 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700721 srcs: [
722 "arch-arm/generic/bionic/__memcpy_chk.S",
723 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800724 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800725 cflags: [
726 "-DNO___STRCAT_CHK",
727 "-DNO___STRCPY_CHK",
728 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700729 srcs: [
730 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
731 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
732 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700733 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800734 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700735 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800736 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
737 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
738 ],
739 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700740 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
741 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
742 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700743 },
744 cortex_a9: {
745 srcs: [
746 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
747 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
748 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800749 exclude_srcs: [
750 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
751 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
752 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700753 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800754 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700755 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800756 "arch-arm/krait/bionic/__strcat_chk.S",
757 "arch-arm/krait/bionic/__strcpy_chk.S",
758 ],
759 exclude_srcs: [
760 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
761 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
762 ],
763 },
764 cortex_a53: {
765 srcs: [
766 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
767 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
768 ],
769 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700770 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
771 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
772 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700773 },
774 cortex_a73: {
775 srcs: [
776 "arch-arm/denver/bionic/__strcat_chk.S",
777 "arch-arm/denver/bionic/__strcpy_chk.S",
778 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800779 exclude_srcs: [
780 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
781 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
782 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700783 },
784 denver: {
785 srcs: [
786 "arch-arm/denver/bionic/__strcat_chk.S",
787 "arch-arm/denver/bionic/__strcpy_chk.S",
788 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800789 exclude_srcs: [
790 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
791 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
792 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700793 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800794 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700795 srcs: [
796 "arch-arm/krait/bionic/__strcat_chk.S",
797 "arch-arm/krait/bionic/__strcpy_chk.S",
798 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800799 exclude_srcs: [
800 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
801 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700802 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700803 },
804 },
805 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700806 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700807 srcs: [
808 "arch-arm64/generic/bionic/__memcpy_chk.S",
809 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700810 },
811 },
812}
813
814// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700815// libc_bionic.a - home-grown C library code
816// ========================================================
817
818cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700819 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700820 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700821 // The data that backs getauxval is initialized in the libc init
822 // functions which are invoked by the linker. If this file is included
823 // in libc_ndk.a, only one of the copies of the global data will be
824 // initialized, resulting in nullptr dereferences.
825 "bionic/getauxval.cpp",
826
Elliott Hughes211c4d32018-02-02 15:10:32 -0800827 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700828 "bionic/sysconf.cpp",
829 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700830 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700831
Josh Gao10ec9282017-04-03 15:13:29 -0700832 // The following must not be statically linked into libc_ndk.a, because
833 // debuggerd will look for the abort message in libc.so's copy.
834 "bionic/android_set_abort_message.cpp",
835
Dan Willemsen208ae172015-09-16 16:33:27 -0700836 "bionic/strchr.cpp",
837 "bionic/strnlen.c",
838 "bionic/strrchr.cpp",
839 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700840
841 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700842 arm: {
843 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800844 "arch-arm/generic/bionic/memcmp.S",
845 "arch-arm/generic/bionic/memcpy.S",
846 "arch-arm/generic/bionic/memset.S",
847 "arch-arm/generic/bionic/strcmp.S",
848 "arch-arm/generic/bionic/strcpy.S",
849 "arch-arm/generic/bionic/strlen.c",
850
Dan Willemsen208ae172015-09-16 16:33:27 -0700851 "arch-arm/bionic/atomics_arm.c",
852 "arch-arm/bionic/__bionic_clone.S",
853 "arch-arm/bionic/_exit_with_stack_teardown.S",
854 "arch-arm/bionic/libgcc_compat.c",
855 "arch-arm/bionic/popcount_tab.c",
856 "arch-arm/bionic/__restore.S",
857 "arch-arm/bionic/setjmp.S",
858 "arch-arm/bionic/syscall.S",
859 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700860 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800861 cortex_a7: {
862 srcs: [
863 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800864 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800865 ],
866 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800867 "arch-arm/cortex-a15/bionic/memcpy.S",
868 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800869 ],
870 },
871 cortex_a9: {
872 srcs: [
873 "arch-arm/cortex-a9/bionic/memcpy.S",
874 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800875
Colin Cross6ab8f892015-11-23 14:12:15 -0800876 "arch-arm/cortex-a9/bionic/stpcpy.S",
877 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800878 "arch-arm/cortex-a9/bionic/strcmp.S",
879 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800880 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800881 ],
882 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800883 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800884 "arch-arm/cortex-a15/bionic/memcpy.S",
885
Colin Cross6ab8f892015-11-23 14:12:15 -0800886 "arch-arm/cortex-a15/bionic/stpcpy.S",
887 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800888 "arch-arm/cortex-a15/bionic/strcmp.S",
889 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800890 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800891 ],
892 },
893 krait: {
894 srcs: [
895 "arch-arm/krait/bionic/memcpy.S",
896 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800897
Colin Cross6ab8f892015-11-23 14:12:15 -0800898 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800899 ],
900 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800901 "arch-arm/cortex-a15/bionic/memset.S",
902 "arch-arm/cortex-a15/bionic/memcpy.S",
903
904 "arch-arm/cortex-a15/bionic/strcmp.S",
905 ],
906 },
907 cortex_a53: {
908 srcs: [
909 "arch-arm/cortex-a53/bionic/memcpy.S",
910 "arch-arm/cortex-a7/bionic/memset.S",
911 ],
912 exclude_srcs: [
913 "arch-arm/cortex-a15/bionic/memset.S",
914 "arch-arm/cortex-a15/bionic/memcpy.S",
915 ],
916 },
917 cortex_a73: {
918 srcs: [
919 "arch-arm/cortex-a7/bionic/memset.S",
920 "arch-arm/denver/bionic/memcpy.S",
921
922 "arch-arm/krait/bionic/strcmp.S",
923 ],
924 exclude_srcs: [
925 "arch-arm/cortex-a15/bionic/memset.S",
926 "arch-arm/cortex-a15/bionic/memcpy.S",
927 "arch-arm/cortex-a15/bionic/strcmp.S",
928 ],
929 },
930 denver: {
931 srcs: [
932 "arch-arm/denver/bionic/memcpy.S",
933 "arch-arm/denver/bionic/memset.S",
934 ],
935 exclude_srcs: [
936 "arch-arm/cortex-a15/bionic/memset.S",
937 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800938 ],
939 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700940 kryo: {
941 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400942 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400943 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800944
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800945 "arch-arm/krait/bionic/strcmp.S",
946 ],
947 exclude_srcs: [
948 "arch-arm/cortex-a15/bionic/memset.S",
949 "arch-arm/cortex-a15/bionic/memcpy.S",
950 "arch-arm/cortex-a15/bionic/strcmp.S",
951 ],
952 },
953 // Cores not listed above (like cortex-a8, cortex-a15) or
954 // "generic" core will use the following implementation.
955 neon: {
956 srcs: [
957 "arch-arm/cortex-a15/bionic/memcpy.S",
958 "arch-arm/cortex-a15/bionic/memset.S",
959
Christopher Ferris950a9582017-03-29 13:10:56 -0700960 "arch-arm/cortex-a15/bionic/stpcpy.S",
961 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800962 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -0700963 "arch-arm/cortex-a15/bionic/strcpy.S",
964 "arch-arm/cortex-a15/bionic/strlen.S",
965
966 "arch-arm/denver/bionic/memmove.S",
967 ],
968 exclude_srcs: [
969 "arch-arm/generic/bionic/memcpy.S",
970 "arch-arm/generic/bionic/memset.S",
971 "arch-arm/generic/bionic/strcmp.S",
972 "arch-arm/generic/bionic/strcpy.S",
973 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -0700974 ],
975 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700976 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700977 arm64: {
978 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700979 "arch-arm64/generic/bionic/memchr.S",
980 "arch-arm64/generic/bionic/memcmp.S",
981 "arch-arm64/generic/bionic/memcpy.S",
982 "arch-arm64/generic/bionic/memmove.S",
983 "arch-arm64/generic/bionic/memset.S",
984 "arch-arm64/generic/bionic/stpcpy.S",
985 "arch-arm64/generic/bionic/strchr.S",
986 "arch-arm64/generic/bionic/strcmp.S",
987 "arch-arm64/generic/bionic/strcpy.S",
988 "arch-arm64/generic/bionic/strlen.S",
989 "arch-arm64/generic/bionic/strncmp.S",
990 "arch-arm64/generic/bionic/strnlen.S",
991 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800992
993 "arch-arm64/bionic/__bionic_clone.S",
994 "arch-arm64/bionic/_exit_with_stack_teardown.S",
995 "arch-arm64/bionic/setjmp.S",
996 "arch-arm64/bionic/syscall.S",
997 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700998 ],
999 exclude_srcs: [
1000 "bionic/__memcpy_chk.cpp",
1001 "bionic/strchr.cpp",
1002 "bionic/strnlen.c",
1003 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001004 denver64: {
1005 srcs: [
1006 "arch-arm64/denver64/bionic/memcpy.S",
1007 "arch-arm64/denver64/bionic/memset.S",
1008 ],
1009 exclude_srcs: [
1010 "arch-arm64/generic/bionic/memcpy.S",
1011 "arch-arm64/generic/bionic/memset.S",
1012 ],
1013 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001014 cortex_a53: {
1015 srcs: [
1016 "arch-arm64/cortex-a53/bionic/memmove.S",
1017 ],
1018 exclude_srcs: [
1019 "arch-arm64/generic/bionic/memmove.S",
1020 ],
1021 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001022 cortex_a73: {
1023 srcs: [
1024 "arch-arm64/cortex-a53/bionic/memmove.S",
1025 ],
1026 exclude_srcs: [
1027 "arch-arm64/generic/bionic/memmove.S",
1028 ],
1029 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001030 },
1031
1032 mips: {
1033 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001034 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301035 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001036 "arch-mips/string/memset.S",
1037 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301038 "arch-mips/string/strncmp.S",
1039 "arch-mips/string/strlen.c",
1040 "arch-mips/string/strnlen.c",
1041 "arch-mips/string/strchr.c",
1042 "arch-mips/string/strcpy.c",
1043 "arch-mips/string/memchr.c",
1044 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001045
Dan Willemsen208ae172015-09-16 16:33:27 -07001046 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001047 "arch-mips/bionic/cacheflush.cpp",
1048 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001049 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001050 "arch-mips/bionic/setjmp.S",
1051 "arch-mips/bionic/syscall.S",
1052 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001053 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301054 exclude_srcs: [
1055 "bionic/strchr.cpp",
1056 "bionic/strnlen.c",
1057 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001058 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001059 mips64: {
1060 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001061 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301062 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001063 "arch-mips/string/memset.S",
1064 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301065 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001066 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301067 "arch-mips/string/strnlen.c",
1068 "arch-mips/string/strchr.c",
1069 "arch-mips/string/strcpy.c",
1070 "arch-mips/string/memchr.c",
1071 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001072
Dan Willemsen208ae172015-09-16 16:33:27 -07001073 "arch-mips64/bionic/__bionic_clone.S",
1074 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1075 "arch-mips64/bionic/setjmp.S",
1076 "arch-mips64/bionic/syscall.S",
1077 "arch-mips64/bionic/vfork.S",
1078 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001079 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301080 exclude_srcs: [
1081 "bionic/strchr.cpp",
1082 "bionic/strnlen.c",
1083 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001084 },
1085
1086 x86: {
1087 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001088 "arch-x86/generic/string/memcmp.S",
1089 "arch-x86/generic/string/strcmp.S",
1090 "arch-x86/generic/string/strncmp.S",
1091 "arch-x86/generic/string/strcat.S",
1092 "arch-x86/atom/string/sse2-memchr-atom.S",
1093 "arch-x86/atom/string/sse2-memrchr-atom.S",
1094 "arch-x86/atom/string/sse2-strchr-atom.S",
1095 "arch-x86/atom/string/sse2-strnlen-atom.S",
1096 "arch-x86/atom/string/sse2-strrchr-atom.S",
1097 "arch-x86/atom/string/sse2-wcschr-atom.S",
1098 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1099 "arch-x86/atom/string/sse2-wcslen-atom.S",
1100 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001101 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1102 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1103 "arch-x86/silvermont/string/sse2-memset-slm.S",
1104 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1105 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1106 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1107 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1108 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001109
1110 "arch-x86/bionic/__bionic_clone.S",
1111 "arch-x86/bionic/_exit_with_stack_teardown.S",
1112 "arch-x86/bionic/libgcc_compat.c",
1113 "arch-x86/bionic/__restore.S",
1114 "arch-x86/bionic/setjmp.S",
1115 "arch-x86/bionic/syscall.S",
1116 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001117 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001118
1119 exclude_srcs: [
1120 "bionic/strchr.cpp",
1121 "bionic/strnlen.c",
1122 "bionic/strrchr.cpp",
1123 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001124 atom: {
1125 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001126 "arch-x86/atom/string/sse2-memset-atom.S",
1127 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001128 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001129 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001130 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001131 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001132 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1133 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1134 ],
1135 exclude_srcs: [
1136 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001137 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1138 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1139 "arch-x86/silvermont/string/sse2-memset-slm.S",
1140 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1141 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1142 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1143 ],
1144 },
1145 ssse3: {
1146 srcs: [
1147 "arch-x86/atom/string/ssse3-strncat-atom.S",
1148 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1149 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1150 "arch-x86/atom/string/ssse3-strcat-atom.S",
1151 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1152 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1153 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1154 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1155 ],
1156 exclude_srcs: [
1157 "arch-x86/generic/string/strcmp.S",
1158 "arch-x86/generic/string/strncmp.S",
1159 "arch-x86/generic/string/strcat.S",
1160 ],
1161 },
1162 sse4: {
1163 srcs: [
1164 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1165 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1166 ],
1167 exclude_srcs: [
1168 "arch-x86/generic/string/memcmp.S",
1169 ],
1170 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001171 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001172 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001173 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001174 "arch-x86_64/string/sse2-memcpy-slm.S",
1175 "arch-x86_64/string/sse2-memmove-slm.S",
1176 "arch-x86_64/string/sse2-memset-slm.S",
1177 "arch-x86_64/string/sse2-stpcpy-slm.S",
1178 "arch-x86_64/string/sse2-stpncpy-slm.S",
1179 "arch-x86_64/string/sse2-strcat-slm.S",
1180 "arch-x86_64/string/sse2-strcpy-slm.S",
1181 "arch-x86_64/string/sse2-strlcat-slm.S",
1182 "arch-x86_64/string/sse2-strlcpy-slm.S",
1183 "arch-x86_64/string/sse2-strlen-slm.S",
1184 "arch-x86_64/string/sse2-strncat-slm.S",
1185 "arch-x86_64/string/sse2-strncpy-slm.S",
1186 "arch-x86_64/string/sse4-memcmp-slm.S",
1187 "arch-x86_64/string/ssse3-strcmp-slm.S",
1188 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001189
1190 "arch-x86_64/bionic/__bionic_clone.S",
1191 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1192 "arch-x86_64/bionic/__restore_rt.S",
1193 "arch-x86_64/bionic/setjmp.S",
1194 "arch-x86_64/bionic/syscall.S",
1195 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001196 ],
1197 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001198 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001199
Colin Cross50c21ab2015-10-31 23:03:05 -07001200 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001201 include_dirs: ["bionic/libstdc++/include"],
1202 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001203}
1204
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001205genrule {
1206 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001207 out: ["generated_android_ids.h"],
1208 srcs: [":android_filesystem_config_header"],
1209 tool_files: ["fs_config_generator.py"],
1210 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001211}
1212
Dan Willemsen268a6732015-10-15 14:49:45 -07001213// ========================================================
1214// libc_bionic_ndk.a- The portions of libc_bionic that can
1215// be safely used in libc_ndk.a (no troublesome global data
1216// or constructors).
1217// ========================================================
1218cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001219 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001220 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001221 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001222 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001223 "bionic/__cmsg_nxthdr.cpp",
1224 "bionic/__errno.cpp",
1225 "bionic/__gnu_basename.cpp",
1226 "bionic/__libc_current_sigrtmax.cpp",
1227 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001228 "bionic/abort.cpp",
1229 "bionic/accept.cpp",
1230 "bionic/accept4.cpp",
1231 "bionic/access.cpp",
1232 "bionic/arpa_inet.cpp",
1233 "bionic/assert.cpp",
1234 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001235 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001236 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001237 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001238 "bionic/bionic_systrace.cpp",
1239 "bionic/bionic_time_conversions.cpp",
1240 "bionic/brk.cpp",
1241 "bionic/c16rtomb.cpp",
1242 "bionic/c32rtomb.cpp",
1243 "bionic/chmod.cpp",
1244 "bionic/chown.cpp",
1245 "bionic/clearenv.cpp",
1246 "bionic/clock.cpp",
1247 "bionic/clock_getcpuclockid.cpp",
1248 "bionic/clock_nanosleep.cpp",
1249 "bionic/clone.cpp",
1250 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001251 "bionic/connect.cpp",
1252 "bionic/ctype.cpp",
1253 "bionic/dirent.cpp",
1254 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001255 "bionic/environ.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",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001274 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001275 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001276 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001277 "bionic/getpgrp.cpp",
1278 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001279 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001280 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001281 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001282 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001283 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001284 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001285 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001286 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001287 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001288 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001289 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001290 "bionic/lchown.cpp",
1291 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001292 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001293 "bionic/libgen.cpp",
1294 "bionic/link.cpp",
1295 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001296 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001297 "bionic/lstat.cpp",
1298 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001299 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001300 "bionic/mbrtoc16.cpp",
1301 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001302 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001303 "bionic/mempcpy.cpp",
1304 "bionic/mkdir.cpp",
1305 "bionic/mkfifo.cpp",
1306 "bionic/mknod.cpp",
1307 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001308 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001309 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001310 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001311 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001312 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001313 "bionic/open.cpp",
1314 "bionic/pathconf.cpp",
1315 "bionic/pause.cpp",
1316 "bionic/pipe.cpp",
1317 "bionic/poll.cpp",
1318 "bionic/posix_fadvise.cpp",
1319 "bionic/posix_fallocate.cpp",
1320 "bionic/posix_madvise.cpp",
1321 "bionic/posix_timers.cpp",
1322 "bionic/ptrace.cpp",
1323 "bionic/pty.cpp",
1324 "bionic/raise.cpp",
1325 "bionic/rand.cpp",
1326 "bionic/readlink.cpp",
1327 "bionic/reboot.cpp",
1328 "bionic/recv.cpp",
1329 "bionic/rename.cpp",
1330 "bionic/rmdir.cpp",
1331 "bionic/scandir.cpp",
1332 "bionic/sched_getaffinity.cpp",
1333 "bionic/sched_getcpu.cpp",
1334 "bionic/semaphore.cpp",
1335 "bionic/send.cpp",
1336 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001337 "bionic/seteuid.cpp",
1338 "bionic/setpgrp.cpp",
1339 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001340 "bionic/signal.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001341 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001342 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001343 "bionic/stat.cpp",
1344 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001345 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001346 "bionic/strchrnul.cpp",
1347 "bionic/strerror.cpp",
1348 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001349 "bionic/string_l.cpp",
1350 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001351 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001352 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001353 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001354 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001355 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001356 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001357 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001358 "bionic/sys_msg.cpp",
1359 "bionic/sys_sem.cpp",
1360 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001361 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001362 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001363 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001364 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001365 "bionic/sysinfo.cpp",
1366 "bionic/syslog.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001367 "bionic/system_property_api.cpp",
1368 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001369 "bionic/tdestroy.cpp",
1370 "bionic/termios.cpp",
1371 "bionic/thread_private.cpp",
1372 "bionic/tmpfile.cpp",
1373 "bionic/umount.cpp",
1374 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001375 "bionic/wait.cpp",
1376 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001377 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001378 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001379 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001380 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001381 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001382
1383 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1384 // which will be overridden by the actual one in libc.so.
1385 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001386 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001387
Dan Willemsen208ae172015-09-16 16:33:27 -07001388 multilib: {
1389 lib32: {
1390 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001391 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001392 },
1393 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001394 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001395 treble_linker_namespaces: {
1396 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001397 },
1398 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001399 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001400 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001401 local_include_dirs: ["stdio"],
1402 include_dirs: ["bionic/libstdc++/include"],
1403 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001404 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001405}
1406
Dan Willemsen208ae172015-09-16 16:33:27 -07001407// ========================================================
1408// libc_pthread.a - pthreads parts that previously lived in
1409// libc_bionic.a. Relocated to their own library because
1410// they can't be included in libc_ndk.a (as they layout of
1411// pthread_t has changed over the years and has ABI
1412// compatibility issues).
1413// ========================================================
1414
1415cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001416 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001417 srcs: [
1418 "bionic/pthread_atfork.cpp",
1419 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001420 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001421 "bionic/pthread_cond.cpp",
1422 "bionic/pthread_create.cpp",
1423 "bionic/pthread_detach.cpp",
1424 "bionic/pthread_equal.cpp",
1425 "bionic/pthread_exit.cpp",
1426 "bionic/pthread_getcpuclockid.cpp",
1427 "bionic/pthread_getschedparam.cpp",
1428 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001429 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001430 "bionic/pthread_join.cpp",
1431 "bionic/pthread_key.cpp",
1432 "bionic/pthread_kill.cpp",
1433 "bionic/pthread_mutex.cpp",
1434 "bionic/pthread_once.cpp",
1435 "bionic/pthread_rwlock.cpp",
1436 "bionic/pthread_self.cpp",
1437 "bionic/pthread_setname_np.cpp",
1438 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001439 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001440
1441 // The following implementations depend on pthread data or implementation,
1442 // so we can't include them in libc_ndk.a.
1443 "bionic/__cxa_thread_atexit_impl.cpp",
1444 "stdlib/atexit.c",
1445 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001446 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001447
Colin Cross50c21ab2015-10-31 23:03:05 -07001448 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001449 include_dirs: ["bionic/libstdc++/include"],
1450 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001451}
1452
1453// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001454// libc_syscalls.a
1455// ========================================================
1456
1457cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001458 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001459 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001460 arch: {
1461 arm: {
1462 srcs: ["arch-arm/syscalls/**/*.S"],
1463 },
1464 arm64: {
1465 srcs: ["arch-arm64/syscalls/**/*.S"],
1466 },
1467 mips: {
1468 srcs: ["arch-mips/syscalls/**/*.S"],
1469 },
1470 mips64: {
1471 srcs: ["arch-mips64/syscalls/**/*.S"],
1472 },
1473 x86: {
1474 srcs: ["arch-x86/syscalls/**/*.S"],
1475 },
1476 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001477 srcs: ["arch-x86_64/syscalls/**/*.S"],
1478 },
1479 },
1480 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001481}
1482
1483// ========================================================
1484// libc_aeabi.a
1485// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1486// to avoid infinite recursion. For the other architectures we just build an
1487// empty library to keep this makefile simple.
1488// ========================================================
1489
1490cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001491 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001492 arch: {
1493 arm: {
1494 srcs: ["arch-arm/bionic/__aeabi.c"],
1495 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001496 },
1497 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001498 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001499}
1500
1501// ========================================================
1502// libc_ndk.a
1503// Compatibility library for the NDK. This library contains
1504// all the parts of libc that are safe to statically link.
1505// We can't safely statically link things that can only run
1506// on a certain version of the OS. Examples include
1507// anything that talks to netd (a large portion of the DNS
1508// code) and anything that is dependent on the layout of a
1509// data structure that has changed across releases (such as
1510// pthread_t).
1511// ========================================================
1512
1513cc_library_static {
1514 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001515 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001516 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001517 multilib: {
1518 lib32: {
1519 srcs: libc_common_src_files_32,
1520 },
1521 },
1522 arch: {
1523 arm: {
1524 srcs: [
1525 "arch-arm/bionic/exidx_dynamic.c",
1526 "arch-common/bionic/crtbegin_so.c",
1527 "arch-arm/bionic/atexit_legacy.c",
1528 "arch-common/bionic/crtend_so.S",
1529 ],
1530 whole_static_libs: ["libc_aeabi"],
1531 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001532 },
1533
Colin Cross50c21ab2015-10-31 23:03:05 -07001534 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001535 "-fvisibility=hidden",
1536 "-DLIBC_STATIC",
1537 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001538
1539 whole_static_libs: [
1540 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001541 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001542 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001543 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001544 "libc_gdtoa",
1545 "libc_malloc",
1546 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001547 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001548 "libc_openbsd_ndk",
1549 "libc_stack_protector",
1550 "libc_syscalls",
1551 "libc_tzcode",
1552 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001553 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001554 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001555 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001556}
1557
1558// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001559// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001560// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001561cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001562 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001563 srcs: libc_common_src_files,
1564 multilib: {
1565 lib32: {
1566 srcs: libc_common_src_files_32,
1567 },
1568 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001569 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001570
1571 whole_static_libs: [
1572 "libc_bionic",
1573 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001574 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001575 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001576 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001577 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001578 "libc_gdtoa",
1579 "libc_malloc",
1580 "libc_netbsd",
1581 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001582 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001583 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001584 "libc_stack_protector",
1585 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001586 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001587 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001588 ],
1589
1590 arch: {
1591 arm: {
1592 whole_static_libs: ["libc_aeabi"],
1593 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001594 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001595}
1596
1597// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001598// libc_common.a
1599// ========================================================
1600
1601cc_library_static {
1602 defaults: ["libc_defaults"],
1603 name: "libc_common",
1604
1605 whole_static_libs: [
1606 "libc_nopthread",
1607 "libc_pthread",
1608 ],
1609}
1610
1611// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001612// libc_nomalloc.a
1613// ========================================================
1614//
1615// This is a version of the static C library that does not
1616// include malloc. It's useful in situations when the user wants
1617// to provide their own malloc implementation, or wants to
1618// explicitly disallow the use of malloc, such as in the
1619// dynamic linker.
1620
1621cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001622 name: "libc_nomalloc",
1623
Colin Cross50c21ab2015-10-31 23:03:05 -07001624 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001625
1626 arch: {
1627 arm: {
1628 srcs: ["arch-arm/bionic/exidx_static.c"],
1629 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001630 },
1631
Colin Cross50c21ab2015-10-31 23:03:05 -07001632 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001633
Colin Crossa3f9fca2016-01-11 13:20:55 -08001634 whole_static_libs: [
1635 "libc_common",
1636 "libc_init_static",
1637 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001638}
1639
1640// ========================================================
1641// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1642// ========================================================
1643cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001644 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001645 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001646 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001647
Dan Willemsen208ae172015-09-16 16:33:27 -07001648 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001649}
1650
1651// ========================================================
1652// libc.a + libc.so
1653// ========================================================
1654cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001655 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001656 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001657 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001658 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001659 platform_sdk_version: {
1660 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1661 },
1662 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001663 static: {
1664 srcs: [
1665 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001666 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001667 ],
1668 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001669 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001670 },
1671 shared: {
1672 srcs: [
1673 "arch-common/bionic/crtbegin_so.c",
1674 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001675 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001676 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001677 "bionic/NetdClient.cpp",
1678 "arch-common/bionic/crtend_so.S",
1679 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001680 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001681 },
1682
1683 required: ["tzdata"],
1684
1685 // Leave the symbols in the shared library so that stack unwinders can produce
1686 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001687 strip: {
1688 keep_symbols: true,
1689 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001690
Colin Cross4ce94d22016-11-15 13:15:43 -08001691 // Do not pack libc.so relocations; see http://b/20645321 for details.
1692 pack_relocations: false,
1693
dimitry06016f22018-01-05 11:39:28 +01001694 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1695 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1696 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1697 // those new libraries from libgcc.a are not declared external; if that were the case,
1698 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1699 // on the external symbols from the dependent libraries. That would create a "cloaked"
1700 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001701
dimitry06016f22018-01-05 11:39:28 +01001702 shared_libs: [
1703 "ld-android",
1704 "libdl",
1705 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001706 whole_static_libs: [
1707 "libc_common",
1708 "libjemalloc",
1709 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001710
1711 nocrt: true,
1712
Dan Willemsen208ae172015-09-16 16:33:27 -07001713 arch: {
1714 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001715 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1716 ldflags: ["-Wl,--hash-style=both"],
1717
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001718 // Don't re-export new/delete and friends, even if the compiler really wants to.
1719 version_script: "libc.arm.map",
1720
Dan Willemsen208ae172015-09-16 16:33:27 -07001721 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001722 srcs: [
1723 "arch-arm/bionic/exidx_dynamic.c",
1724
1725 // special for arm
1726 "arch-arm/bionic/atexit_legacy.c",
1727 ],
1728 // special for arm
1729 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001730 },
1731 static: {
1732 srcs: ["arch-arm/bionic/exidx_static.c"],
1733 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001734 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001735 arm64: {
1736 // Don't re-export new/delete and friends, even if the compiler really wants to.
1737 version_script: "libc.arm64.map",
1738 },
1739 mips: {
1740 // Don't re-export new/delete and friends, even if the compiler really wants to.
1741 version_script: "libc.mips.map",
1742 },
1743 mips64: {
1744 // Don't re-export new/delete and friends, even if the compiler really wants to.
1745 version_script: "libc.mips64.map",
1746 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001747 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001748 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1749 ldflags: ["-Wl,--hash-style=both"],
1750
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001751 // Don't re-export new/delete and friends, even if the compiler really wants to.
1752 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001753 },
1754 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001755 // Don't re-export new/delete and friends, even if the compiler really wants to.
1756 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001757 },
1758 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001759}
1760
Dan Willemsen208ae172015-09-16 16:33:27 -07001761// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001762// libstdc++.so + libstdc++.a
1763// ========================================================
1764cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001765 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001766 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001767 srcs: [
1768 "bionic/__cxa_guard.cpp",
1769 "bionic/__cxa_pure_virtual.cpp",
1770 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001771 ],
1772 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001773 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001774 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001775 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001776
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001777 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001778 arch: {
1779 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001780 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001781 version_script: "libstdc++.arm.map",
1782 },
1783 arm64: {
1784 version_script: "libstdc++.arm64.map",
1785 },
1786 mips: {
1787 version_script: "libstdc++.mips.map",
1788 },
1789 mips64: {
1790 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001791 },
1792 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001793 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001794 version_script: "libstdc++.x86.map",
1795 },
1796 x86_64: {
1797 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001798 },
1799 },
1800}
1801
Colin Cross50c21ab2015-10-31 23:03:05 -07001802cc_defaults {
1803 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001804 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001805 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001806
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001807 cflags: [
1808 "-Wno-gcc-compat",
1809 "-Wall",
1810 "-Werror",
1811 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001812}
1813
Colin Cross50c21ab2015-10-31 23:03:05 -07001814cc_defaults {
1815 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001816 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001817
1818 arch: {
1819 mips: {
1820 cflags: ["-fPIC"],
1821 },
1822 mips64: {
1823 cflags: ["-fPIC"],
1824 },
1825 x86: {
1826 cflags: ["-fPIC"],
1827 },
1828 x86_64: {
1829 cflags: ["-fPIC"],
1830 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001831 },
1832}
1833
Dan Willemsena3ed9012017-04-04 15:51:26 -07001834// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001835cc_object {
1836 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001837 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001838 local_include_dirs: ["include"],
1839 product_variables: {
1840 platform_sdk_version: {
1841 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1842 },
1843 },
1844 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001845
Colin Cross7d7b3682017-11-03 13:38:40 -07001846 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001847}
1848
Dan Willemsen208ae172015-09-16 16:33:27 -07001849cc_object {
1850 name: "crtbegin_so1",
1851 local_include_dirs: ["include"],
1852 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001853
Colin Cross7d7b3682017-11-03 13:38:40 -07001854 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001855}
1856
Dan Willemsen208ae172015-09-16 16:33:27 -07001857cc_object {
1858 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001859
Colin Cross7d7b3682017-11-03 13:38:40 -07001860 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001861 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001862 "crtbegin_so1",
1863 "crtbrand",
1864 ],
1865}
1866
Dan Willemsen208ae172015-09-16 16:33:27 -07001867cc_object {
1868 name: "crtend_so",
1869 local_include_dirs: ["include"],
1870 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001871
Colin Cross7d7b3682017-11-03 13:38:40 -07001872 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001873}
1874
Dan Willemsen208ae172015-09-16 16:33:27 -07001875cc_object {
1876 name: "crtbegin_static1",
1877 local_include_dirs: ["include"],
1878 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001879
Colin Cross50c21ab2015-10-31 23:03:05 -07001880 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001881 mips: {
1882 srcs: [
1883 "arch-mips/bionic/crtbegin.c",
1884 ],
1885 exclude_srcs: [
1886 "arch-common/bionic/crtbegin.c",
1887 ],
1888 },
1889 mips64: {
1890 srcs: [
1891 "arch-mips64/bionic/crtbegin.c",
1892 ],
1893 exclude_srcs: [
1894 "arch-common/bionic/crtbegin.c",
1895 ],
1896 },
1897 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001898
1899 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001900}
1901
Dan Willemsen208ae172015-09-16 16:33:27 -07001902cc_object {
1903 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001904
Colin Cross77d57bf2016-04-11 14:34:18 -07001905 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001906 "crtbegin_static1",
1907 "crtbrand",
1908 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001909 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001910}
1911
Dan Willemsen208ae172015-09-16 16:33:27 -07001912cc_object {
1913 name: "crtbegin_dynamic1",
1914 local_include_dirs: ["include"],
1915 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001916
Colin Cross50c21ab2015-10-31 23:03:05 -07001917 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001918 mips: {
1919 srcs: [
1920 "arch-mips/bionic/crtbegin.c",
1921 ],
1922 exclude_srcs: [
1923 "arch-common/bionic/crtbegin.c",
1924 ],
1925 },
1926 mips64: {
1927 srcs: [
1928 "arch-mips64/bionic/crtbegin.c",
1929 ],
1930 exclude_srcs: [
1931 "arch-common/bionic/crtbegin.c",
1932 ],
1933 },
1934 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001935 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001936}
1937
Dan Willemsen208ae172015-09-16 16:33:27 -07001938cc_object {
1939 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001940
Colin Cross77d57bf2016-04-11 14:34:18 -07001941 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001942 "crtbegin_dynamic1",
1943 "crtbrand",
1944 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001945 target: {
1946 linux_bionic: {
1947 generated_sources: ["host_bionic_linker_asm"],
1948 objs: [
1949 "linker_wrapper",
1950 ],
1951 },
1952 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001953 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001954}
1955
Dan Willemsen208ae172015-09-16 16:33:27 -07001956cc_object {
1957 // We rename crtend.o to crtend_android.o to avoid a
1958 // name clash between gcc and bionic.
1959 name: "crtend_android",
1960 local_include_dirs: ["include"],
1961 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001962
Colin Cross50c21ab2015-10-31 23:03:05 -07001963 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001964}
Colin Crossbaa48992016-07-13 11:15:21 -07001965
Dan Albert22805ea2017-03-22 15:28:05 -07001966preprocessed_ndk_headers {
1967 name: "common_libc",
1968 from: "include",
1969 to: "",
1970 license: "NOTICE",
1971}
Dan Albert4238a352016-06-28 11:18:05 -07001972
1973ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08001974 name: "libc_uapi",
1975 from: "kernel/uapi",
1976 to: "",
1977 srcs: [
1978 "kernel/uapi/asm-generic/**/*.h",
1979 "kernel/uapi/drm/**/*.h",
1980 "kernel/uapi/linux/**/*.h",
1981 "kernel/uapi/misc/**/*.h",
1982 "kernel/uapi/mtd/**/*.h",
1983 "kernel/uapi/rdma/**/*.h",
1984 "kernel/uapi/scsi/**/*.h",
1985 "kernel/uapi/sound/**/*.h",
1986 "kernel/uapi/video/**/*.h",
1987 "kernel/uapi/xen/**/*.h",
1988 ],
Dan Albert92592652016-10-20 01:42:54 -07001989 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07001990}
1991
1992ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001993 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07001994 from: "kernel/android/uapi/linux",
1995 to: "linux",
1996 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07001997 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07001998}
1999
2000ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002001 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002002 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002003 to: "scsi",
2004 srcs: ["kernel/android/scsi/**/*.h"],
2005 license: "NOTICE",
2006}
2007
2008ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002009 name: "libc_asm_arm",
2010 from: "kernel/uapi/asm-arm",
2011 to: "arm-linux-androideabi",
2012 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002013 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002014}
2015
2016ndk_headers {
2017 name: "libc_asm_arm64",
2018 from: "kernel/uapi/asm-arm64",
2019 to: "aarch64-linux-android",
2020 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002021 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002022}
2023
Elliott Hughesee291c02017-12-11 11:32:34 -08002024// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002025ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002026 name: "libc_asm_mips",
2027 from: "kernel/uapi/asm-mips",
2028 to: "mipsel-linux-android",
2029 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2030 license: "NOTICE",
2031}
2032
Elliott Hughesee291c02017-12-11 11:32:34 -08002033// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002034ndk_headers {
2035 name: "libc_asm_mips64",
2036 from: "kernel/uapi/asm-mips",
2037 to: "mips64el-linux-android",
2038 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2039 license: "NOTICE",
2040}
2041
2042ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002043 name: "libc_asm_x86",
2044 from: "kernel/uapi/asm-x86",
2045 to: "i686-linux-android",
2046 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002047 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002048}
2049
2050ndk_headers {
2051 name: "libc_asm_x86_64",
2052 from: "kernel/uapi/asm-x86",
2053 to: "x86_64-linux-android",
2054 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002055 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002056}
2057
Dan Albert4238a352016-06-28 11:18:05 -07002058ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002059 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002060 symbol_file: "libc.map.txt",
2061 first_version: "9",
2062}
2063
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002064llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002065 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002066 symbol_file: "libc.map.txt",
2067 export_headers_as_system: true,
2068 export_preprocessed_headers: ["include"],
2069 arch: {
2070 arm: {
2071 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002072 "kernel/uapi",
2073 "kernel/uapi/asm-arm",
2074 "kernel/android/uapi",
2075 ],
2076 },
2077 arm64: {
2078 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002079 "kernel/uapi",
2080 "kernel/uapi/asm-arm64",
2081 "kernel/android/uapi",
2082 ],
2083 },
2084 mips: {
2085 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002086 "kernel/uapi",
2087 "kernel/uapi/asm-mips",
2088 "kernel/android/uapi",
2089 ],
2090 },
2091 mips64: {
2092 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002093 "kernel/uapi",
2094 "kernel/uapi/asm-mips",
2095 "kernel/android/uapi",
2096 ],
2097 },
2098 x86: {
2099 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002100 "kernel/uapi",
2101 "kernel/uapi/asm-x86",
2102 "kernel/android/uapi",
2103 ],
2104 },
2105 x86_64: {
2106 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002107 "kernel/uapi",
2108 "kernel/uapi/asm-x86",
2109 "kernel/android/uapi",
2110 ],
2111 },
2112 },
2113}
2114
Dan Albertdf31aff2016-10-06 15:50:41 -07002115ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002116 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002117 symbol_file: "libstdc++.map.txt",
2118 first_version: "9",
2119}
2120
Dan Willemsenca056d72018-01-08 14:00:24 -08002121// Export these headers for toolbox to process
2122filegroup {
2123 name: "kernel_input_headers",
2124 srcs: [
2125 "kernel/uapi/linux/input.h",
2126 "kernel/uapi/linux/input-event-codes.h",
2127 ],
2128}