blob: 579c63c50b74b099d8fbb6c34a5590ced4cd7c5b [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",
Ryan Prichard8f419572018-02-20 17:09:05 -080050
51 // Clang's exit-time destructor registration hides __dso_handle, but
52 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
53 "-Wexit-time-destructors",
Elliott Hughes53cf3482016-08-09 13:06:41 -070054]
55
Dan Willemsen208ae172015-09-16 16:33:27 -070056// Define some common cflags
57// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070058cc_defaults {
59 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080060 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070061 cflags: libc_common_flags,
62 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070063 conlyflags: ["-std=gnu99"],
64 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070065 include_dirs: [
66 "bionic/libc/async_safe/include",
67 "external/jemalloc/include",
68 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070069
Colin Cross50c21ab2015-10-31 23:03:05 -070070 stl: "none",
71 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070072 sanitize: {
73 never: true,
74 },
Colin Cross50c21ab2015-10-31 23:03:05 -070075 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070076}
77
Dan Willemsen208ae172015-09-16 16:33:27 -070078// ANDROIDMK TRANSLATION ERROR: unsupported directive
79// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
80//libc_common_cflags += ["-DDEBUG"]
81// ANDROIDMK TRANSLATION ERROR: unsupported directive
82// endif
83
Dan Willemsen208ae172015-09-16 16:33:27 -070084// ========================================================
85// libc_stack_protector.a - stack protector code
86// ========================================================
87//
Colin Crossa3f9fca2016-01-11 13:20:55 -080088// Code that implements the stack protector (or that runs
89// before TLS has been set up) needs to be compiled with
90// -fno-stack-protector, since it accesses the stack canary
91// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070092
93cc_library_static {
94
Colin Crossa3f9fca2016-01-11 13:20:55 -080095 srcs: [
96 "bionic/__libc_init_main_thread.cpp",
97 "bionic/__stack_chk_fail.cpp",
98 ],
99 arch: {
100 arm64: {
101 srcs: ["arch-arm64/bionic/__set_tls.c"],
102 },
103 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800104 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800105 },
106 x86_64: {
107 srcs: ["arch-x86_64/bionic/__set_tls.c"],
108 },
109 },
110
Colin Cross50c21ab2015-10-31 23:03:05 -0700111 defaults: ["libc_defaults"],
112 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700113 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700114}
115
Colin Crossa3f9fca2016-01-11 13:20:55 -0800116// libc_init_static.cpp also needs to be built without stack protector,
117// because it's responsible for setting up TLS for static executables.
118// This isn't the case for dynamic executables because the dynamic linker
119// has already set up the main thread's TLS.
120
121cc_library_static {
122 name: "libc_init_static",
123 defaults: ["libc_defaults"],
124 srcs: ["bionic/libc_init_static.cpp"],
125 cflags: ["-fno-stack-protector"],
126}
127
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700128cc_library_static {
129 name: "libc_init_dynamic",
130 defaults: ["libc_defaults"],
131 srcs: ["bionic/libc_init_dynamic.cpp"],
132 cflags: ["-fno-stack-protector"],
133}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800134
Dan Willemsen208ae172015-09-16 16:33:27 -0700135// ========================================================
136// libc_tzcode.a - upstream 'tzcode' code
137// ========================================================
138
139cc_library_static {
140
Colin Cross50c21ab2015-10-31 23:03:05 -0700141 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700142 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800143 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700144 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700145 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
146 ],
147
Colin Cross50c21ab2015-10-31 23:03:05 -0700148 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700149 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700150 // Don't use ridiculous amounts of stack.
151 "-DALL_STATE",
152 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
153 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800154 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700155 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700156 // The name of the tm_gmtoff field in our struct tm.
157 "-DTM_GMTOFF=tm_gmtoff",
158 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700159 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700160 // Include `tzname`, `timezone`, and `daylight` globals.
161 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700162 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800163 // Use the empty string (instead of " ") as the timezone abbreviation
164 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700165 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700166 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
167 "-Dlint",
168 ],
169
Dan Willemsen208ae172015-09-16 16:33:27 -0700170 local_include_dirs: ["tzcode/"],
171 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700172}
173
174// ========================================================
175// libc_dns.a - modified NetBSD DNS code
176// ========================================================
177
178cc_library_static {
179
Colin Cross50c21ab2015-10-31 23:03:05 -0700180 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700181 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800182 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700183
184 "upstream-netbsd/lib/libc/isc/ev_streams.c",
185 "upstream-netbsd/lib/libc/isc/ev_timers.c",
186 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700187 ],
188
Colin Cross50c21ab2015-10-31 23:03:05 -0700189 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700190 "-DANDROID_CHANGES",
191 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700192 "-Wno-unused-parameter",
193 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700194 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700195 ],
196
Dan Willemsen208ae172015-09-16 16:33:27 -0700197 local_include_dirs: [
198 "dns/include",
199 "private",
200 "upstream-netbsd/lib/libc/include",
201 "upstream-netbsd/android/include",
202 ],
203
204 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700205}
206
207// ========================================================
208// libc_freebsd.a - upstream FreeBSD C library code
209// ========================================================
210//
211// These files are built with the freebsd-compat.h header file
212// automatically included.
213
214cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700215 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700216 srcs: [
217 "upstream-freebsd/lib/libc/gen/ldexp.c",
218 "upstream-freebsd/lib/libc/gen/sleep.c",
219 "upstream-freebsd/lib/libc/gen/usleep.c",
220 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700221 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
222 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
223 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
224 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700225 "upstream-freebsd/lib/libc/stdlib/qsort.c",
226 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 "upstream-freebsd/lib/libc/string/wcpcpy.c",
228 "upstream-freebsd/lib/libc/string/wcpncpy.c",
229 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700230 "upstream-freebsd/lib/libc/string/wcscat.c",
231 "upstream-freebsd/lib/libc/string/wcschr.c",
232 "upstream-freebsd/lib/libc/string/wcscmp.c",
233 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700234 "upstream-freebsd/lib/libc/string/wcscspn.c",
235 "upstream-freebsd/lib/libc/string/wcsdup.c",
236 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700237 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
239 "upstream-freebsd/lib/libc/string/wcsncat.c",
240 "upstream-freebsd/lib/libc/string/wcsncmp.c",
241 "upstream-freebsd/lib/libc/string/wcsncpy.c",
242 "upstream-freebsd/lib/libc/string/wcsnlen.c",
243 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700244 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700245 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700246 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700247 "upstream-freebsd/lib/libc/string/wcstok.c",
248 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700249 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700250 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800252 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700253 ],
254 arch: {
255 arm64: {
256 exclude_srcs: [
257 "upstream-freebsd/lib/libc/string/wmemmove.c",
258 ],
259 },
260 x86: {
261 exclude_srcs: [
262 "upstream-freebsd/lib/libc/string/wcschr.c",
263 "upstream-freebsd/lib/libc/string/wcscmp.c",
264 "upstream-freebsd/lib/libc/string/wcslen.c",
265 "upstream-freebsd/lib/libc/string/wcsrchr.c",
266 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800267 atom: {
268 exclude_srcs: [
269 "upstream-freebsd/lib/libc/string/wmemcmp.c",
270 ],
271 },
272 ssse3: {
273 exclude_srcs: [
274 "upstream-freebsd/lib/libc/string/wcscat.c",
275 "upstream-freebsd/lib/libc/string/wcscpy.c",
276 ],
277 },
278 sse4: {
279 exclude_srcs: [
280 "upstream-freebsd/lib/libc/string/wmemcmp.c",
281 ],
282 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700284 },
285
Colin Cross50c21ab2015-10-31 23:03:05 -0700286 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700287 "-Wno-sign-compare",
288 "-Wno-uninitialized",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700289 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700290 "-include freebsd-compat.h",
291 ],
292
Dan Willemsen208ae172015-09-16 16:33:27 -0700293 local_include_dirs: [
294 "upstream-freebsd/android/include",
295 ],
296
297 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700298}
299
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700300cc_library_static {
301 defaults: ["libc_defaults"],
302 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700303 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700304 "upstream-freebsd/lib/libc/stdlib/realpath.c",
305 ],
306
307 cflags: [
308 "-Wno-sign-compare",
309 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700310 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700311 ],
312
313 local_include_dirs: [
314 "upstream-freebsd/android/include",
315 ],
316
317 name: "libc_freebsd_large_stack",
318}
319
Dan Willemsen208ae172015-09-16 16:33:27 -0700320// ========================================================
321// libc_netbsd.a - upstream NetBSD C library code
322// ========================================================
323//
324// These files are built with the netbsd-compat.h header file
325// automatically included.
326
327cc_library_static {
328
Colin Cross50c21ab2015-10-31 23:03:05 -0700329 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700330 srcs: [
331 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700332 "upstream-netbsd/lib/libc/gen/nice.c",
333 "upstream-netbsd/lib/libc/gen/popen.c",
334 "upstream-netbsd/lib/libc/gen/psignal.c",
335 "upstream-netbsd/lib/libc/gen/utime.c",
336 "upstream-netbsd/lib/libc/gen/utmp.c",
337 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
338 "upstream-netbsd/lib/libc/regex/regcomp.c",
339 "upstream-netbsd/lib/libc/regex/regerror.c",
340 "upstream-netbsd/lib/libc/regex/regexec.c",
341 "upstream-netbsd/lib/libc/regex/regfree.c",
342 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
343 "upstream-netbsd/lib/libc/stdlib/div.c",
344 "upstream-netbsd/lib/libc/stdlib/drand48.c",
345 "upstream-netbsd/lib/libc/stdlib/erand48.c",
346 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
347 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
348 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
349 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
350 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
351 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
352 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
353 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
354 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
355 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
356 "upstream-netbsd/lib/libc/stdlib/seed48.c",
357 "upstream-netbsd/lib/libc/stdlib/srand48.c",
358 "upstream-netbsd/lib/libc/string/memccpy.c",
359 "upstream-netbsd/lib/libc/string/strcasestr.c",
360 "upstream-netbsd/lib/libc/string/strcoll.c",
361 "upstream-netbsd/lib/libc/string/strxfrm.c",
362 ],
363 multilib: {
364 lib32: {
365 // LP32 cruft
366 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
367 },
368 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700369 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700370 "-Wno-sign-compare",
371 "-Wno-uninitialized",
Dan Willemsen879cec22016-02-29 10:37:56 -0800372 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700373 "-DPOSIX_MISTAKE",
374 "-include netbsd-compat.h",
375 ],
376
Dan Willemsen208ae172015-09-16 16:33:27 -0700377 local_include_dirs: [
378 "upstream-netbsd/android/include",
379 "upstream-netbsd/lib/libc/include",
380 ],
381
382 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700383}
384
385// ========================================================
386// libc_openbsd_ndk.a - upstream OpenBSD C library code
387// that can be safely included in the libc_ndk.a (doesn't
388// contain any troublesome global data or constructors).
389// ========================================================
390//
391// These files are built with the openbsd-compat.h header file
392// automatically included.
393
394cc_library_static {
395 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700396 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700397 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700398 "upstream-openbsd/lib/libc/gen/alarm.c",
399 "upstream-openbsd/lib/libc/gen/ctype_.c",
400 "upstream-openbsd/lib/libc/gen/daemon.c",
401 "upstream-openbsd/lib/libc/gen/err.c",
402 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700403 "upstream-openbsd/lib/libc/gen/fnmatch.c",
404 "upstream-openbsd/lib/libc/gen/ftok.c",
405 "upstream-openbsd/lib/libc/gen/getprogname.c",
406 "upstream-openbsd/lib/libc/gen/isctype.c",
407 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700408 "upstream-openbsd/lib/libc/gen/tolower_.c",
409 "upstream-openbsd/lib/libc/gen/toupper_.c",
410 "upstream-openbsd/lib/libc/gen/verr.c",
411 "upstream-openbsd/lib/libc/gen/verrx.c",
412 "upstream-openbsd/lib/libc/gen/vwarn.c",
413 "upstream-openbsd/lib/libc/gen/vwarnx.c",
414 "upstream-openbsd/lib/libc/gen/warn.c",
415 "upstream-openbsd/lib/libc/gen/warnx.c",
416 "upstream-openbsd/lib/libc/locale/btowc.c",
417 "upstream-openbsd/lib/libc/locale/mbrlen.c",
418 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
419 "upstream-openbsd/lib/libc/locale/mbtowc.c",
420 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700421 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
422 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700423 "upstream-openbsd/lib/libc/locale/wcstoll.c",
424 "upstream-openbsd/lib/libc/locale/wcstombs.c",
425 "upstream-openbsd/lib/libc/locale/wcstoul.c",
426 "upstream-openbsd/lib/libc/locale/wcstoull.c",
427 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
428 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
429 "upstream-openbsd/lib/libc/locale/wctob.c",
430 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700431 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700432 "upstream-openbsd/lib/libc/net/htonl.c",
433 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700434 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
435 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
436 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700437 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
438 "upstream-openbsd/lib/libc/net/inet_ntop.c",
439 "upstream-openbsd/lib/libc/net/inet_pton.c",
440 "upstream-openbsd/lib/libc/net/ntohl.c",
441 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800442 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700444 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
445 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700447 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700448 "upstream-openbsd/lib/libc/stdio/fputwc.c",
449 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700450 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
451 "upstream-openbsd/lib/libc/stdio/fwalk.c",
452 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700454 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-openbsd/lib/libc/stdio/makebuf.c",
456 "upstream-openbsd/lib/libc/stdio/mktemp.c",
457 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
458 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700459 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700460 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700461 "upstream-openbsd/lib/libc/stdio/tempnam.c",
462 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
463 "upstream-openbsd/lib/libc/stdio/ungetc.c",
464 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
465 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
466 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
468 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
469 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700471 "upstream-openbsd/lib/libc/stdio/wsetup.c",
472 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700473 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700474 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700475 "upstream-openbsd/lib/libc/stdlib/insque.c",
476 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
477 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
478 "upstream-openbsd/lib/libc/stdlib/labs.c",
479 "upstream-openbsd/lib/libc/stdlib/llabs.c",
480 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
481 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
482 "upstream-openbsd/lib/libc/stdlib/remque.c",
483 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700484 "upstream-openbsd/lib/libc/stdlib/system.c",
485 "upstream-openbsd/lib/libc/stdlib/tfind.c",
486 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
487 "upstream-openbsd/lib/libc/string/strcasecmp.c",
488 "upstream-openbsd/lib/libc/string/strcspn.c",
489 "upstream-openbsd/lib/libc/string/strdup.c",
490 "upstream-openbsd/lib/libc/string/strndup.c",
491 "upstream-openbsd/lib/libc/string/strpbrk.c",
492 "upstream-openbsd/lib/libc/string/strsep.c",
493 "upstream-openbsd/lib/libc/string/strspn.c",
494 "upstream-openbsd/lib/libc/string/strstr.c",
495 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700496 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700497 "upstream-openbsd/lib/libc/string/wcswidth.c",
498 ],
499
Colin Cross50c21ab2015-10-31 23:03:05 -0700500 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700501 "-Wno-sign-compare",
502 "-Wno-uninitialized",
503 "-Wno-unused-parameter",
504 "-include openbsd-compat.h",
505 ],
506
Dan Willemsen208ae172015-09-16 16:33:27 -0700507 local_include_dirs: [
508 "private",
509 "stdio",
510 "upstream-openbsd/android/include",
511 "upstream-openbsd/lib/libc/include",
512 "upstream-openbsd/lib/libc/gdtoa/",
513 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700514}
515
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700516cc_library_static {
517 name: "libc_openbsd_large_stack",
518 defaults: ["libc_defaults"],
519 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700520 "stdio/vfprintf.cpp",
521 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700522 ],
523 cflags: [
524 "-include openbsd-compat.h",
525 "-Wno-sign-compare",
526 "-Wframe-larger-than=5000",
527 ],
528
529 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700530 "upstream-openbsd/android/include/",
531 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700532 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700533 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700534 ],
535}
536
Dan Willemsen208ae172015-09-16 16:33:27 -0700537// ========================================================
538// libc_openbsd.a - upstream OpenBSD C library code
539// ========================================================
540//
541// These files are built with the openbsd-compat.h header file
542// automatically included.
543cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700544 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700545 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800546 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700547 "upstream-openbsd/lib/libc/crypt/arc4random.c",
548 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
549
550 // May be overriden by per-arch optimized versions
551 "upstream-openbsd/lib/libc/string/memchr.c",
552 "upstream-openbsd/lib/libc/string/memmove.c",
553 "upstream-openbsd/lib/libc/string/memrchr.c",
554 "upstream-openbsd/lib/libc/string/stpcpy.c",
555 "upstream-openbsd/lib/libc/string/stpncpy.c",
556 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700557 "upstream-openbsd/lib/libc/string/strcpy.c",
558 "upstream-openbsd/lib/libc/string/strlcat.c",
559 "upstream-openbsd/lib/libc/string/strlcpy.c",
560 "upstream-openbsd/lib/libc/string/strncat.c",
561 "upstream-openbsd/lib/libc/string/strncmp.c",
562 "upstream-openbsd/lib/libc/string/strncpy.c",
563 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700564
565 arch: {
566 arm: {
567 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700568 "upstream-openbsd/lib/libc/string/strcpy.c",
569 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800570 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700571 exclude_srcs: [
572 "upstream-openbsd/lib/libc/string/memmove.c",
573 "upstream-openbsd/lib/libc/string/stpcpy.c",
574 "upstream-openbsd/lib/libc/string/strcat.c",
575 ],
576 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700577 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700578 arm64: {
579 exclude_srcs: [
580 "upstream-openbsd/lib/libc/string/memchr.c",
581 "upstream-openbsd/lib/libc/string/memmove.c",
582 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700583 "upstream-openbsd/lib/libc/string/strcpy.c",
584 "upstream-openbsd/lib/libc/string/strncmp.c",
585 ],
586 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530587 mips: {
588 exclude_srcs: [
589 "upstream-openbsd/lib/libc/string/memchr.c",
590 "upstream-openbsd/lib/libc/string/memmove.c",
591 "upstream-openbsd/lib/libc/string/strcpy.c",
592 "upstream-openbsd/lib/libc/string/strncmp.c",
593 ],
594 },
595 mips64: {
596 exclude_srcs: [
597 "upstream-openbsd/lib/libc/string/memchr.c",
598 "upstream-openbsd/lib/libc/string/memmove.c",
599 "upstream-openbsd/lib/libc/string/strcpy.c",
600 "upstream-openbsd/lib/libc/string/strncmp.c",
601 ],
602 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700603 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800604 exclude_srcs: [
605 "upstream-openbsd/lib/libc/string/memchr.c",
606 "upstream-openbsd/lib/libc/string/memmove.c",
607 "upstream-openbsd/lib/libc/string/memrchr.c",
608 "upstream-openbsd/lib/libc/string/stpcpy.c",
609 "upstream-openbsd/lib/libc/string/stpncpy.c",
610 "upstream-openbsd/lib/libc/string/strcat.c",
611 "upstream-openbsd/lib/libc/string/strcpy.c",
612 "upstream-openbsd/lib/libc/string/strncmp.c",
613 "upstream-openbsd/lib/libc/string/strncpy.c",
614 ],
615 ssse3: {
616 exclude_srcs: [
617 "upstream-openbsd/lib/libc/string/strlcat.c",
618 "upstream-openbsd/lib/libc/string/strlcpy.c",
619 "upstream-openbsd/lib/libc/string/strncat.c",
620 ],
621 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700622 },
623
624 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800625 exclude_srcs: [
626 "upstream-openbsd/lib/libc/string/memmove.c",
627 "upstream-openbsd/lib/libc/string/stpcpy.c",
628 "upstream-openbsd/lib/libc/string/stpncpy.c",
629 "upstream-openbsd/lib/libc/string/strcat.c",
630 "upstream-openbsd/lib/libc/string/strcpy.c",
631 "upstream-openbsd/lib/libc/string/strlcat.c",
632 "upstream-openbsd/lib/libc/string/strlcpy.c",
633 "upstream-openbsd/lib/libc/string/strncat.c",
634 "upstream-openbsd/lib/libc/string/strncmp.c",
635 "upstream-openbsd/lib/libc/string/strncpy.c",
636 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700637 },
638 },
639
Colin Cross50c21ab2015-10-31 23:03:05 -0700640 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700641 "-Wno-sign-compare",
642 "-Wno-uninitialized",
643 "-Wno-unused-parameter",
644 "-include openbsd-compat.h",
645 ],
646
Dan Willemsen208ae172015-09-16 16:33:27 -0700647 local_include_dirs: [
648 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700649 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700650 ],
651
652 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700653}
654
655// ========================================================
656// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
657// ========================================================
658//
659// These files are built with the openbsd-compat.h header file
660// automatically included.
661
662cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700663 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700664 srcs: [
665 "upstream-openbsd/android/gdtoa_support.cpp",
666 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
667 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
668 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
669 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
670 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
671 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
672 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
673 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
674 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
675 "upstream-openbsd/lib/libc/gdtoa/misc.c",
676 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
677 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
678 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
679 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
680 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
681 "upstream-openbsd/lib/libc/gdtoa/sum.c",
682 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
683 ],
684 multilib: {
685 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800686 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700687 },
688 },
689
Colin Cross50c21ab2015-10-31 23:03:05 -0700690 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700691 "-Wno-sign-compare",
692 "-Wno-uninitialized",
Dan Willemsen208ae172015-09-16 16:33:27 -0700693 "-include openbsd-compat.h",
694 ],
695
Dan Willemsen208ae172015-09-16 16:33:27 -0700696 local_include_dirs: [
697 "private",
698 "upstream-openbsd/android/include",
699 "upstream-openbsd/lib/libc/include",
700 ],
701
702 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700703}
704
705// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700706// libc_fortify.a - container for our FORITFY
707// implementation details
708// ========================================================
709cc_library_static {
710 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700711 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700712
713 name: "libc_fortify",
714
715 // Disable FORTIFY for the compilation of these, so we don't end up having
716 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800717 cflags: [
718 "-U_FORTIFY_SOURCE",
719 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
720 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700721
722 arch: {
723 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700724 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700725 srcs: [
726 "arch-arm/generic/bionic/__memcpy_chk.S",
727 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800728 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800729 cflags: [
730 "-DNO___STRCAT_CHK",
731 "-DNO___STRCPY_CHK",
732 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700733 srcs: [
734 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
735 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
736 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700737 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800738 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700739 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800740 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
741 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
742 ],
743 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700744 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
745 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
746 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700747 },
748 cortex_a9: {
749 srcs: [
750 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
751 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
752 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800753 exclude_srcs: [
754 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
755 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
756 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700757 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800758 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700759 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800760 "arch-arm/krait/bionic/__strcat_chk.S",
761 "arch-arm/krait/bionic/__strcpy_chk.S",
762 ],
763 exclude_srcs: [
764 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
765 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
766 ],
767 },
768 cortex_a53: {
769 srcs: [
770 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
771 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
772 ],
773 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700774 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
775 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
776 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700777 },
778 cortex_a73: {
779 srcs: [
780 "arch-arm/denver/bionic/__strcat_chk.S",
781 "arch-arm/denver/bionic/__strcpy_chk.S",
782 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800783 exclude_srcs: [
784 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
785 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
786 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700787 },
788 denver: {
789 srcs: [
790 "arch-arm/denver/bionic/__strcat_chk.S",
791 "arch-arm/denver/bionic/__strcpy_chk.S",
792 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800793 exclude_srcs: [
794 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
795 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
796 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700797 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800798 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700799 srcs: [
800 "arch-arm/krait/bionic/__strcat_chk.S",
801 "arch-arm/krait/bionic/__strcpy_chk.S",
802 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800803 exclude_srcs: [
804 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
805 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700806 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700807 },
808 },
809 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700810 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700811 srcs: [
812 "arch-arm64/generic/bionic/__memcpy_chk.S",
813 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700814 },
815 },
816}
817
818// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700819// libc_bionic.a - home-grown C library code
820// ========================================================
821
822cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700823 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700824 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700825 // The data that backs getauxval is initialized in the libc init
826 // functions which are invoked by the linker. If this file is included
827 // in libc_ndk.a, only one of the copies of the global data will be
828 // initialized, resulting in nullptr dereferences.
829 "bionic/getauxval.cpp",
830
Elliott Hughes211c4d32018-02-02 15:10:32 -0800831 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700832 "bionic/sysconf.cpp",
833 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700834 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700835
Josh Gao10ec9282017-04-03 15:13:29 -0700836 // The following must not be statically linked into libc_ndk.a, because
837 // debuggerd will look for the abort message in libc.so's copy.
838 "bionic/android_set_abort_message.cpp",
839
Dan Willemsen208ae172015-09-16 16:33:27 -0700840 "bionic/strchr.cpp",
841 "bionic/strnlen.c",
842 "bionic/strrchr.cpp",
843 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700844
845 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700846 arm: {
847 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800848 "arch-arm/generic/bionic/memcmp.S",
849 "arch-arm/generic/bionic/memcpy.S",
850 "arch-arm/generic/bionic/memset.S",
851 "arch-arm/generic/bionic/strcmp.S",
852 "arch-arm/generic/bionic/strcpy.S",
853 "arch-arm/generic/bionic/strlen.c",
854
Dan Willemsen208ae172015-09-16 16:33:27 -0700855 "arch-arm/bionic/atomics_arm.c",
856 "arch-arm/bionic/__bionic_clone.S",
857 "arch-arm/bionic/_exit_with_stack_teardown.S",
858 "arch-arm/bionic/libgcc_compat.c",
859 "arch-arm/bionic/popcount_tab.c",
860 "arch-arm/bionic/__restore.S",
861 "arch-arm/bionic/setjmp.S",
862 "arch-arm/bionic/syscall.S",
863 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700864 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800865 cortex_a7: {
866 srcs: [
867 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800868 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800869 ],
870 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800871 "arch-arm/cortex-a15/bionic/memcpy.S",
872 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800873 ],
874 },
875 cortex_a9: {
876 srcs: [
877 "arch-arm/cortex-a9/bionic/memcpy.S",
878 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800879
Colin Cross6ab8f892015-11-23 14:12:15 -0800880 "arch-arm/cortex-a9/bionic/stpcpy.S",
881 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800882 "arch-arm/cortex-a9/bionic/strcmp.S",
883 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800884 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800885 ],
886 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800887 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800888 "arch-arm/cortex-a15/bionic/memcpy.S",
889
Colin Cross6ab8f892015-11-23 14:12:15 -0800890 "arch-arm/cortex-a15/bionic/stpcpy.S",
891 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800892 "arch-arm/cortex-a15/bionic/strcmp.S",
893 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800894 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800895 ],
896 },
897 krait: {
898 srcs: [
899 "arch-arm/krait/bionic/memcpy.S",
900 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800901
Colin Cross6ab8f892015-11-23 14:12:15 -0800902 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800903 ],
904 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800905 "arch-arm/cortex-a15/bionic/memset.S",
906 "arch-arm/cortex-a15/bionic/memcpy.S",
907
908 "arch-arm/cortex-a15/bionic/strcmp.S",
909 ],
910 },
911 cortex_a53: {
912 srcs: [
913 "arch-arm/cortex-a53/bionic/memcpy.S",
914 "arch-arm/cortex-a7/bionic/memset.S",
915 ],
916 exclude_srcs: [
917 "arch-arm/cortex-a15/bionic/memset.S",
918 "arch-arm/cortex-a15/bionic/memcpy.S",
919 ],
920 },
921 cortex_a73: {
922 srcs: [
923 "arch-arm/cortex-a7/bionic/memset.S",
924 "arch-arm/denver/bionic/memcpy.S",
925
926 "arch-arm/krait/bionic/strcmp.S",
927 ],
928 exclude_srcs: [
929 "arch-arm/cortex-a15/bionic/memset.S",
930 "arch-arm/cortex-a15/bionic/memcpy.S",
931 "arch-arm/cortex-a15/bionic/strcmp.S",
932 ],
933 },
934 denver: {
935 srcs: [
936 "arch-arm/denver/bionic/memcpy.S",
937 "arch-arm/denver/bionic/memset.S",
938 ],
939 exclude_srcs: [
940 "arch-arm/cortex-a15/bionic/memset.S",
941 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800942 ],
943 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700944 kryo: {
945 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400946 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400947 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800948
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800949 "arch-arm/krait/bionic/strcmp.S",
950 ],
951 exclude_srcs: [
952 "arch-arm/cortex-a15/bionic/memset.S",
953 "arch-arm/cortex-a15/bionic/memcpy.S",
954 "arch-arm/cortex-a15/bionic/strcmp.S",
955 ],
956 },
957 // Cores not listed above (like cortex-a8, cortex-a15) or
958 // "generic" core will use the following implementation.
959 neon: {
960 srcs: [
961 "arch-arm/cortex-a15/bionic/memcpy.S",
962 "arch-arm/cortex-a15/bionic/memset.S",
963
Christopher Ferris950a9582017-03-29 13:10:56 -0700964 "arch-arm/cortex-a15/bionic/stpcpy.S",
965 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800966 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -0700967 "arch-arm/cortex-a15/bionic/strcpy.S",
968 "arch-arm/cortex-a15/bionic/strlen.S",
969
970 "arch-arm/denver/bionic/memmove.S",
971 ],
972 exclude_srcs: [
973 "arch-arm/generic/bionic/memcpy.S",
974 "arch-arm/generic/bionic/memset.S",
975 "arch-arm/generic/bionic/strcmp.S",
976 "arch-arm/generic/bionic/strcpy.S",
977 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -0700978 ],
979 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700980 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700981 arm64: {
982 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700983 "arch-arm64/generic/bionic/memchr.S",
984 "arch-arm64/generic/bionic/memcmp.S",
985 "arch-arm64/generic/bionic/memcpy.S",
986 "arch-arm64/generic/bionic/memmove.S",
987 "arch-arm64/generic/bionic/memset.S",
988 "arch-arm64/generic/bionic/stpcpy.S",
989 "arch-arm64/generic/bionic/strchr.S",
990 "arch-arm64/generic/bionic/strcmp.S",
991 "arch-arm64/generic/bionic/strcpy.S",
992 "arch-arm64/generic/bionic/strlen.S",
993 "arch-arm64/generic/bionic/strncmp.S",
994 "arch-arm64/generic/bionic/strnlen.S",
995 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800996
997 "arch-arm64/bionic/__bionic_clone.S",
998 "arch-arm64/bionic/_exit_with_stack_teardown.S",
999 "arch-arm64/bionic/setjmp.S",
1000 "arch-arm64/bionic/syscall.S",
1001 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001002 ],
1003 exclude_srcs: [
1004 "bionic/__memcpy_chk.cpp",
1005 "bionic/strchr.cpp",
1006 "bionic/strnlen.c",
1007 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001008 denver64: {
1009 srcs: [
1010 "arch-arm64/denver64/bionic/memcpy.S",
1011 "arch-arm64/denver64/bionic/memset.S",
1012 ],
1013 exclude_srcs: [
1014 "arch-arm64/generic/bionic/memcpy.S",
1015 "arch-arm64/generic/bionic/memset.S",
1016 ],
1017 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001018 cortex_a53: {
1019 srcs: [
1020 "arch-arm64/cortex-a53/bionic/memmove.S",
1021 ],
1022 exclude_srcs: [
1023 "arch-arm64/generic/bionic/memmove.S",
1024 ],
1025 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001026 cortex_a73: {
1027 srcs: [
1028 "arch-arm64/cortex-a53/bionic/memmove.S",
1029 ],
1030 exclude_srcs: [
1031 "arch-arm64/generic/bionic/memmove.S",
1032 ],
1033 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001034 },
1035
1036 mips: {
1037 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001038 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301039 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001040 "arch-mips/string/memset.S",
1041 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301042 "arch-mips/string/strncmp.S",
1043 "arch-mips/string/strlen.c",
1044 "arch-mips/string/strnlen.c",
1045 "arch-mips/string/strchr.c",
1046 "arch-mips/string/strcpy.c",
1047 "arch-mips/string/memchr.c",
1048 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001049
Dan Willemsen208ae172015-09-16 16:33:27 -07001050 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001051 "arch-mips/bionic/cacheflush.cpp",
1052 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001053 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001054 "arch-mips/bionic/setjmp.S",
1055 "arch-mips/bionic/syscall.S",
1056 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001057 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301058 exclude_srcs: [
1059 "bionic/strchr.cpp",
1060 "bionic/strnlen.c",
1061 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001062 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001063 mips64: {
1064 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001065 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301066 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001067 "arch-mips/string/memset.S",
1068 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301069 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001070 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301071 "arch-mips/string/strnlen.c",
1072 "arch-mips/string/strchr.c",
1073 "arch-mips/string/strcpy.c",
1074 "arch-mips/string/memchr.c",
1075 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001076
Dan Willemsen208ae172015-09-16 16:33:27 -07001077 "arch-mips64/bionic/__bionic_clone.S",
1078 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1079 "arch-mips64/bionic/setjmp.S",
1080 "arch-mips64/bionic/syscall.S",
1081 "arch-mips64/bionic/vfork.S",
1082 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001083 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301084 exclude_srcs: [
1085 "bionic/strchr.cpp",
1086 "bionic/strnlen.c",
1087 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001088 },
1089
1090 x86: {
1091 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001092 "arch-x86/generic/string/memcmp.S",
1093 "arch-x86/generic/string/strcmp.S",
1094 "arch-x86/generic/string/strncmp.S",
1095 "arch-x86/generic/string/strcat.S",
1096 "arch-x86/atom/string/sse2-memchr-atom.S",
1097 "arch-x86/atom/string/sse2-memrchr-atom.S",
1098 "arch-x86/atom/string/sse2-strchr-atom.S",
1099 "arch-x86/atom/string/sse2-strnlen-atom.S",
1100 "arch-x86/atom/string/sse2-strrchr-atom.S",
1101 "arch-x86/atom/string/sse2-wcschr-atom.S",
1102 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1103 "arch-x86/atom/string/sse2-wcslen-atom.S",
1104 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001105 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1106 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1107 "arch-x86/silvermont/string/sse2-memset-slm.S",
1108 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1109 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1110 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1111 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1112 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001113
1114 "arch-x86/bionic/__bionic_clone.S",
1115 "arch-x86/bionic/_exit_with_stack_teardown.S",
1116 "arch-x86/bionic/libgcc_compat.c",
1117 "arch-x86/bionic/__restore.S",
1118 "arch-x86/bionic/setjmp.S",
1119 "arch-x86/bionic/syscall.S",
1120 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001121 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001122
1123 exclude_srcs: [
1124 "bionic/strchr.cpp",
1125 "bionic/strnlen.c",
1126 "bionic/strrchr.cpp",
1127 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001128 atom: {
1129 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001130 "arch-x86/atom/string/sse2-memset-atom.S",
1131 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001132 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001133 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001134 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001135 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001136 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1137 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1138 ],
1139 exclude_srcs: [
1140 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001141 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1142 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1143 "arch-x86/silvermont/string/sse2-memset-slm.S",
1144 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1145 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1146 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1147 ],
1148 },
1149 ssse3: {
1150 srcs: [
1151 "arch-x86/atom/string/ssse3-strncat-atom.S",
1152 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1153 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1154 "arch-x86/atom/string/ssse3-strcat-atom.S",
1155 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1156 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1157 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1158 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1159 ],
1160 exclude_srcs: [
1161 "arch-x86/generic/string/strcmp.S",
1162 "arch-x86/generic/string/strncmp.S",
1163 "arch-x86/generic/string/strcat.S",
1164 ],
1165 },
1166 sse4: {
1167 srcs: [
1168 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1169 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1170 ],
1171 exclude_srcs: [
1172 "arch-x86/generic/string/memcmp.S",
1173 ],
1174 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001175 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001176 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001177 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001178 "arch-x86_64/string/sse2-memcpy-slm.S",
1179 "arch-x86_64/string/sse2-memmove-slm.S",
1180 "arch-x86_64/string/sse2-memset-slm.S",
1181 "arch-x86_64/string/sse2-stpcpy-slm.S",
1182 "arch-x86_64/string/sse2-stpncpy-slm.S",
1183 "arch-x86_64/string/sse2-strcat-slm.S",
1184 "arch-x86_64/string/sse2-strcpy-slm.S",
1185 "arch-x86_64/string/sse2-strlcat-slm.S",
1186 "arch-x86_64/string/sse2-strlcpy-slm.S",
1187 "arch-x86_64/string/sse2-strlen-slm.S",
1188 "arch-x86_64/string/sse2-strncat-slm.S",
1189 "arch-x86_64/string/sse2-strncpy-slm.S",
1190 "arch-x86_64/string/sse4-memcmp-slm.S",
1191 "arch-x86_64/string/ssse3-strcmp-slm.S",
1192 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001193
1194 "arch-x86_64/bionic/__bionic_clone.S",
1195 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1196 "arch-x86_64/bionic/__restore_rt.S",
1197 "arch-x86_64/bionic/setjmp.S",
1198 "arch-x86_64/bionic/syscall.S",
1199 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001200 ],
1201 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001202 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001203
Colin Cross50c21ab2015-10-31 23:03:05 -07001204 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001205 include_dirs: ["bionic/libstdc++/include"],
1206 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001207}
1208
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001209genrule {
1210 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001211 out: ["generated_android_ids.h"],
1212 srcs: [":android_filesystem_config_header"],
1213 tool_files: ["fs_config_generator.py"],
1214 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001215}
1216
Dan Willemsen268a6732015-10-15 14:49:45 -07001217// ========================================================
1218// libc_bionic_ndk.a- The portions of libc_bionic that can
1219// be safely used in libc_ndk.a (no troublesome global data
1220// or constructors).
1221// ========================================================
1222cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001223 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001224 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001225 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001226 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001227 "bionic/__cmsg_nxthdr.cpp",
1228 "bionic/__errno.cpp",
1229 "bionic/__gnu_basename.cpp",
1230 "bionic/__libc_current_sigrtmax.cpp",
1231 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001232 "bionic/abort.cpp",
1233 "bionic/accept.cpp",
1234 "bionic/accept4.cpp",
1235 "bionic/access.cpp",
1236 "bionic/arpa_inet.cpp",
1237 "bionic/assert.cpp",
1238 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001239 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001240 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001241 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001242 "bionic/bionic_systrace.cpp",
1243 "bionic/bionic_time_conversions.cpp",
1244 "bionic/brk.cpp",
1245 "bionic/c16rtomb.cpp",
1246 "bionic/c32rtomb.cpp",
1247 "bionic/chmod.cpp",
1248 "bionic/chown.cpp",
1249 "bionic/clearenv.cpp",
1250 "bionic/clock.cpp",
1251 "bionic/clock_getcpuclockid.cpp",
1252 "bionic/clock_nanosleep.cpp",
1253 "bionic/clone.cpp",
1254 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001255 "bionic/connect.cpp",
1256 "bionic/ctype.cpp",
1257 "bionic/dirent.cpp",
1258 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001259 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001260 "bionic/error.cpp",
1261 "bionic/eventfd_read.cpp",
1262 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001263 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001264 "bionic/faccessat.cpp",
1265 "bionic/fchmod.cpp",
1266 "bionic/fchmodat.cpp",
1267 "bionic/ffs.cpp",
1268 "bionic/fgetxattr.cpp",
1269 "bionic/flistxattr.cpp",
1270 "bionic/flockfile.cpp",
1271 "bionic/fpclassify.cpp",
1272 "bionic/fsetxattr.cpp",
1273 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001274 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001275 "bionic/futimens.cpp",
1276 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001277 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001278 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001279 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001280 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001281 "bionic/getpgrp.cpp",
1282 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001283 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001284 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001285 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001286 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001287 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001288 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001289 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001290 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001291 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001292 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001293 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001294 "bionic/lchown.cpp",
1295 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001296 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001297 "bionic/libgen.cpp",
1298 "bionic/link.cpp",
1299 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001300 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001301 "bionic/lstat.cpp",
1302 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001303 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001304 "bionic/mbrtoc16.cpp",
1305 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001306 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001307 "bionic/mempcpy.cpp",
1308 "bionic/mkdir.cpp",
1309 "bionic/mkfifo.cpp",
1310 "bionic/mknod.cpp",
1311 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001312 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001313 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001314 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001315 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001316 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001317 "bionic/open.cpp",
1318 "bionic/pathconf.cpp",
1319 "bionic/pause.cpp",
1320 "bionic/pipe.cpp",
1321 "bionic/poll.cpp",
1322 "bionic/posix_fadvise.cpp",
1323 "bionic/posix_fallocate.cpp",
1324 "bionic/posix_madvise.cpp",
1325 "bionic/posix_timers.cpp",
1326 "bionic/ptrace.cpp",
1327 "bionic/pty.cpp",
1328 "bionic/raise.cpp",
1329 "bionic/rand.cpp",
1330 "bionic/readlink.cpp",
1331 "bionic/reboot.cpp",
1332 "bionic/recv.cpp",
1333 "bionic/rename.cpp",
1334 "bionic/rmdir.cpp",
1335 "bionic/scandir.cpp",
1336 "bionic/sched_getaffinity.cpp",
1337 "bionic/sched_getcpu.cpp",
1338 "bionic/semaphore.cpp",
1339 "bionic/send.cpp",
1340 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001341 "bionic/seteuid.cpp",
1342 "bionic/setpgrp.cpp",
1343 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001344 "bionic/signal.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001345 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001346 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001347 "bionic/stat.cpp",
1348 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001349 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001350 "bionic/strchrnul.cpp",
1351 "bionic/strerror.cpp",
1352 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001353 "bionic/string_l.cpp",
1354 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001355 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001356 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001357 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001358 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001359 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001360 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001361 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001362 "bionic/sys_msg.cpp",
1363 "bionic/sys_sem.cpp",
1364 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001365 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001366 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001367 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001368 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001369 "bionic/sysinfo.cpp",
1370 "bionic/syslog.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001371 "bionic/system_property_api.cpp",
1372 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001373 "bionic/tdestroy.cpp",
1374 "bionic/termios.cpp",
1375 "bionic/thread_private.cpp",
1376 "bionic/tmpfile.cpp",
1377 "bionic/umount.cpp",
1378 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001379 "bionic/wait.cpp",
1380 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001381 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001382 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001383 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001384 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001385 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001386
1387 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1388 // which will be overridden by the actual one in libc.so.
1389 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001390 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001391
Dan Willemsen208ae172015-09-16 16:33:27 -07001392 multilib: {
1393 lib32: {
1394 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001395 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001396 },
1397 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001398 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001399 treble_linker_namespaces: {
1400 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001401 },
1402 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001403 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001404 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001405 local_include_dirs: ["stdio"],
1406 include_dirs: ["bionic/libstdc++/include"],
1407 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001408 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001409}
1410
Dan Willemsen208ae172015-09-16 16:33:27 -07001411// ========================================================
1412// libc_pthread.a - pthreads parts that previously lived in
1413// libc_bionic.a. Relocated to their own library because
1414// they can't be included in libc_ndk.a (as they layout of
1415// pthread_t has changed over the years and has ABI
1416// compatibility issues).
1417// ========================================================
1418
1419cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001420 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001421 srcs: [
1422 "bionic/pthread_atfork.cpp",
1423 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001424 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001425 "bionic/pthread_cond.cpp",
1426 "bionic/pthread_create.cpp",
1427 "bionic/pthread_detach.cpp",
1428 "bionic/pthread_equal.cpp",
1429 "bionic/pthread_exit.cpp",
1430 "bionic/pthread_getcpuclockid.cpp",
1431 "bionic/pthread_getschedparam.cpp",
1432 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001433 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001434 "bionic/pthread_join.cpp",
1435 "bionic/pthread_key.cpp",
1436 "bionic/pthread_kill.cpp",
1437 "bionic/pthread_mutex.cpp",
1438 "bionic/pthread_once.cpp",
1439 "bionic/pthread_rwlock.cpp",
1440 "bionic/pthread_self.cpp",
1441 "bionic/pthread_setname_np.cpp",
1442 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001443 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001444
1445 // The following implementations depend on pthread data or implementation,
1446 // so we can't include them in libc_ndk.a.
1447 "bionic/__cxa_thread_atexit_impl.cpp",
1448 "stdlib/atexit.c",
1449 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001450 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001451
Colin Cross50c21ab2015-10-31 23:03:05 -07001452 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001453 include_dirs: ["bionic/libstdc++/include"],
1454 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001455}
1456
1457// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001458// libc_syscalls.a
1459// ========================================================
1460
1461cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001462 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001463 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001464 arch: {
1465 arm: {
1466 srcs: ["arch-arm/syscalls/**/*.S"],
1467 },
1468 arm64: {
1469 srcs: ["arch-arm64/syscalls/**/*.S"],
1470 },
1471 mips: {
1472 srcs: ["arch-mips/syscalls/**/*.S"],
1473 },
1474 mips64: {
1475 srcs: ["arch-mips64/syscalls/**/*.S"],
1476 },
1477 x86: {
1478 srcs: ["arch-x86/syscalls/**/*.S"],
1479 },
1480 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001481 srcs: ["arch-x86_64/syscalls/**/*.S"],
1482 },
1483 },
1484 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001485}
1486
1487// ========================================================
1488// libc_aeabi.a
1489// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1490// to avoid infinite recursion. For the other architectures we just build an
1491// empty library to keep this makefile simple.
1492// ========================================================
1493
1494cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001495 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001496 arch: {
1497 arm: {
1498 srcs: ["arch-arm/bionic/__aeabi.c"],
1499 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001500 },
1501 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001502 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001503}
1504
1505// ========================================================
1506// libc_ndk.a
1507// Compatibility library for the NDK. This library contains
1508// all the parts of libc that are safe to statically link.
1509// We can't safely statically link things that can only run
1510// on a certain version of the OS. Examples include
1511// anything that talks to netd (a large portion of the DNS
1512// code) and anything that is dependent on the layout of a
1513// data structure that has changed across releases (such as
1514// pthread_t).
1515// ========================================================
1516
1517cc_library_static {
1518 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001519 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001520 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001521 multilib: {
1522 lib32: {
1523 srcs: libc_common_src_files_32,
1524 },
1525 },
1526 arch: {
1527 arm: {
1528 srcs: [
1529 "arch-arm/bionic/exidx_dynamic.c",
1530 "arch-common/bionic/crtbegin_so.c",
1531 "arch-arm/bionic/atexit_legacy.c",
1532 "arch-common/bionic/crtend_so.S",
1533 ],
1534 whole_static_libs: ["libc_aeabi"],
1535 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001536 },
1537
Colin Cross50c21ab2015-10-31 23:03:05 -07001538 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001539 "-fvisibility=hidden",
1540 "-DLIBC_STATIC",
1541 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001542
1543 whole_static_libs: [
1544 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001545 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001546 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001547 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001548 "libc_gdtoa",
1549 "libc_malloc",
1550 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001551 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001552 "libc_openbsd_ndk",
1553 "libc_stack_protector",
1554 "libc_syscalls",
1555 "libc_tzcode",
1556 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001557 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001558 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001559 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001560}
1561
1562// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001563// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001564// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001565cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001566 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001567 srcs: libc_common_src_files,
1568 multilib: {
1569 lib32: {
1570 srcs: libc_common_src_files_32,
1571 },
1572 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001573 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001574
1575 whole_static_libs: [
1576 "libc_bionic",
1577 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001578 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001579 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001580 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001581 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001582 "libc_gdtoa",
1583 "libc_malloc",
1584 "libc_netbsd",
1585 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001586 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001587 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001588 "libc_stack_protector",
1589 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001590 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001591 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001592 ],
1593
1594 arch: {
1595 arm: {
1596 whole_static_libs: ["libc_aeabi"],
1597 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001598 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001599}
1600
1601// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001602// libc_common.a
1603// ========================================================
1604
1605cc_library_static {
1606 defaults: ["libc_defaults"],
1607 name: "libc_common",
1608
1609 whole_static_libs: [
1610 "libc_nopthread",
1611 "libc_pthread",
1612 ],
1613}
1614
1615// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001616// libc_nomalloc.a
1617// ========================================================
1618//
1619// This is a version of the static C library that does not
1620// include malloc. It's useful in situations when the user wants
1621// to provide their own malloc implementation, or wants to
1622// explicitly disallow the use of malloc, such as in the
1623// dynamic linker.
1624
1625cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001626 name: "libc_nomalloc",
1627
Colin Cross50c21ab2015-10-31 23:03:05 -07001628 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001629
1630 arch: {
1631 arm: {
1632 srcs: ["arch-arm/bionic/exidx_static.c"],
1633 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001634 },
1635
Colin Cross50c21ab2015-10-31 23:03:05 -07001636 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001637
Colin Crossa3f9fca2016-01-11 13:20:55 -08001638 whole_static_libs: [
1639 "libc_common",
1640 "libc_init_static",
1641 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001642}
1643
1644// ========================================================
1645// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1646// ========================================================
1647cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001648 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001649 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001650 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001651
Dan Willemsen208ae172015-09-16 16:33:27 -07001652 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001653}
1654
1655// ========================================================
1656// libc.a + libc.so
1657// ========================================================
1658cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001659 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001660 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001661 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001662 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001663 platform_sdk_version: {
1664 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1665 },
1666 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001667 static: {
1668 srcs: [
1669 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001670 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001671 ],
1672 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001673 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001674 },
1675 shared: {
1676 srcs: [
1677 "arch-common/bionic/crtbegin_so.c",
1678 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001679 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001680 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001681 "bionic/NetdClient.cpp",
1682 "arch-common/bionic/crtend_so.S",
1683 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001684 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001685 },
1686
1687 required: ["tzdata"],
1688
1689 // Leave the symbols in the shared library so that stack unwinders can produce
1690 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001691 strip: {
1692 keep_symbols: true,
1693 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001694
Colin Cross4ce94d22016-11-15 13:15:43 -08001695 // Do not pack libc.so relocations; see http://b/20645321 for details.
1696 pack_relocations: false,
1697
dimitry06016f22018-01-05 11:39:28 +01001698 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1699 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1700 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1701 // those new libraries from libgcc.a are not declared external; if that were the case,
1702 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1703 // on the external symbols from the dependent libraries. That would create a "cloaked"
1704 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001705
dimitry06016f22018-01-05 11:39:28 +01001706 shared_libs: [
1707 "ld-android",
1708 "libdl",
1709 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001710 whole_static_libs: [
1711 "libc_common",
1712 "libjemalloc",
1713 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001714
1715 nocrt: true,
1716
Dan Willemsen208ae172015-09-16 16:33:27 -07001717 arch: {
1718 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001719 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1720 ldflags: ["-Wl,--hash-style=both"],
1721
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001722 // Don't re-export new/delete and friends, even if the compiler really wants to.
1723 version_script: "libc.arm.map",
1724
Dan Willemsen208ae172015-09-16 16:33:27 -07001725 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001726 srcs: [
1727 "arch-arm/bionic/exidx_dynamic.c",
1728
1729 // special for arm
1730 "arch-arm/bionic/atexit_legacy.c",
1731 ],
1732 // special for arm
1733 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001734 },
1735 static: {
1736 srcs: ["arch-arm/bionic/exidx_static.c"],
1737 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001738 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001739 arm64: {
1740 // Don't re-export new/delete and friends, even if the compiler really wants to.
1741 version_script: "libc.arm64.map",
1742 },
1743 mips: {
1744 // Don't re-export new/delete and friends, even if the compiler really wants to.
1745 version_script: "libc.mips.map",
1746 },
1747 mips64: {
1748 // Don't re-export new/delete and friends, even if the compiler really wants to.
1749 version_script: "libc.mips64.map",
1750 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001751 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001752 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1753 ldflags: ["-Wl,--hash-style=both"],
1754
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.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001757 },
1758 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001759 // Don't re-export new/delete and friends, even if the compiler really wants to.
1760 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001761 },
1762 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001763}
1764
Dan Willemsen208ae172015-09-16 16:33:27 -07001765// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001766// libstdc++.so + libstdc++.a
1767// ========================================================
1768cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001769 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001770 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001771 srcs: [
1772 "bionic/__cxa_guard.cpp",
1773 "bionic/__cxa_pure_virtual.cpp",
1774 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001775 ],
1776 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001777 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001778 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001779 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001780
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001781 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001782 arch: {
1783 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001784 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001785 version_script: "libstdc++.arm.map",
1786 },
1787 arm64: {
1788 version_script: "libstdc++.arm64.map",
1789 },
1790 mips: {
1791 version_script: "libstdc++.mips.map",
1792 },
1793 mips64: {
1794 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001795 },
1796 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001797 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001798 version_script: "libstdc++.x86.map",
1799 },
1800 x86_64: {
1801 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001802 },
1803 },
1804}
1805
Colin Cross50c21ab2015-10-31 23:03:05 -07001806cc_defaults {
1807 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001808 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001809 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001810
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001811 cflags: [
1812 "-Wno-gcc-compat",
1813 "-Wall",
1814 "-Werror",
1815 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001816}
1817
Colin Cross50c21ab2015-10-31 23:03:05 -07001818cc_defaults {
1819 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001820 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001821
1822 arch: {
1823 mips: {
1824 cflags: ["-fPIC"],
1825 },
1826 mips64: {
1827 cflags: ["-fPIC"],
1828 },
1829 x86: {
1830 cflags: ["-fPIC"],
1831 },
1832 x86_64: {
1833 cflags: ["-fPIC"],
1834 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001835 },
1836}
1837
Dan Willemsena3ed9012017-04-04 15:51:26 -07001838// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001839cc_object {
1840 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001841 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001842 local_include_dirs: ["include"],
1843 product_variables: {
1844 platform_sdk_version: {
1845 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1846 },
1847 },
1848 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001849
Colin Cross7d7b3682017-11-03 13:38:40 -07001850 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001851}
1852
Dan Willemsen208ae172015-09-16 16:33:27 -07001853cc_object {
1854 name: "crtbegin_so1",
1855 local_include_dirs: ["include"],
1856 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001857
Colin Cross7d7b3682017-11-03 13:38:40 -07001858 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001859}
1860
Dan Willemsen208ae172015-09-16 16:33:27 -07001861cc_object {
1862 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001863
Colin Cross7d7b3682017-11-03 13:38:40 -07001864 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001865 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001866 "crtbegin_so1",
1867 "crtbrand",
1868 ],
1869}
1870
Dan Willemsen208ae172015-09-16 16:33:27 -07001871cc_object {
1872 name: "crtend_so",
1873 local_include_dirs: ["include"],
1874 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001875
Colin Cross7d7b3682017-11-03 13:38:40 -07001876 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001877}
1878
Dan Willemsen208ae172015-09-16 16:33:27 -07001879cc_object {
1880 name: "crtbegin_static1",
1881 local_include_dirs: ["include"],
1882 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001883
Colin Cross50c21ab2015-10-31 23:03:05 -07001884 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001885 mips: {
1886 srcs: [
1887 "arch-mips/bionic/crtbegin.c",
1888 ],
1889 exclude_srcs: [
1890 "arch-common/bionic/crtbegin.c",
1891 ],
1892 },
1893 mips64: {
1894 srcs: [
1895 "arch-mips64/bionic/crtbegin.c",
1896 ],
1897 exclude_srcs: [
1898 "arch-common/bionic/crtbegin.c",
1899 ],
1900 },
1901 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001902
1903 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001904}
1905
Dan Willemsen208ae172015-09-16 16:33:27 -07001906cc_object {
1907 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001908
Colin Cross77d57bf2016-04-11 14:34:18 -07001909 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001910 "crtbegin_static1",
1911 "crtbrand",
1912 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001913 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001914}
1915
Dan Willemsen208ae172015-09-16 16:33:27 -07001916cc_object {
1917 name: "crtbegin_dynamic1",
1918 local_include_dirs: ["include"],
1919 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001920
Colin Cross50c21ab2015-10-31 23:03:05 -07001921 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001922 mips: {
1923 srcs: [
1924 "arch-mips/bionic/crtbegin.c",
1925 ],
1926 exclude_srcs: [
1927 "arch-common/bionic/crtbegin.c",
1928 ],
1929 },
1930 mips64: {
1931 srcs: [
1932 "arch-mips64/bionic/crtbegin.c",
1933 ],
1934 exclude_srcs: [
1935 "arch-common/bionic/crtbegin.c",
1936 ],
1937 },
1938 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001939 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001940}
1941
Dan Willemsen208ae172015-09-16 16:33:27 -07001942cc_object {
1943 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001944
Colin Cross77d57bf2016-04-11 14:34:18 -07001945 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001946 "crtbegin_dynamic1",
1947 "crtbrand",
1948 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001949 target: {
1950 linux_bionic: {
1951 generated_sources: ["host_bionic_linker_asm"],
1952 objs: [
1953 "linker_wrapper",
1954 ],
1955 },
1956 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001957 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001958}
1959
Dan Willemsen208ae172015-09-16 16:33:27 -07001960cc_object {
1961 // We rename crtend.o to crtend_android.o to avoid a
1962 // name clash between gcc and bionic.
1963 name: "crtend_android",
1964 local_include_dirs: ["include"],
1965 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001966
Colin Cross50c21ab2015-10-31 23:03:05 -07001967 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001968}
Colin Crossbaa48992016-07-13 11:15:21 -07001969
Dan Albert22805ea2017-03-22 15:28:05 -07001970preprocessed_ndk_headers {
1971 name: "common_libc",
1972 from: "include",
1973 to: "",
1974 license: "NOTICE",
1975}
Dan Albert4238a352016-06-28 11:18:05 -07001976
1977ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08001978 name: "libc_uapi",
1979 from: "kernel/uapi",
1980 to: "",
1981 srcs: [
1982 "kernel/uapi/asm-generic/**/*.h",
1983 "kernel/uapi/drm/**/*.h",
1984 "kernel/uapi/linux/**/*.h",
1985 "kernel/uapi/misc/**/*.h",
1986 "kernel/uapi/mtd/**/*.h",
1987 "kernel/uapi/rdma/**/*.h",
1988 "kernel/uapi/scsi/**/*.h",
1989 "kernel/uapi/sound/**/*.h",
1990 "kernel/uapi/video/**/*.h",
1991 "kernel/uapi/xen/**/*.h",
1992 ],
Dan Albert92592652016-10-20 01:42:54 -07001993 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07001994}
1995
1996ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001997 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07001998 from: "kernel/android/uapi/linux",
1999 to: "linux",
2000 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002001 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002002}
2003
2004ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002005 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002006 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002007 to: "scsi",
2008 srcs: ["kernel/android/scsi/**/*.h"],
2009 license: "NOTICE",
2010}
2011
2012ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002013 name: "libc_asm_arm",
2014 from: "kernel/uapi/asm-arm",
2015 to: "arm-linux-androideabi",
2016 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002017 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002018}
2019
2020ndk_headers {
2021 name: "libc_asm_arm64",
2022 from: "kernel/uapi/asm-arm64",
2023 to: "aarch64-linux-android",
2024 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002025 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002026}
2027
Elliott Hughesee291c02017-12-11 11:32:34 -08002028// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002029ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002030 name: "libc_asm_mips",
2031 from: "kernel/uapi/asm-mips",
2032 to: "mipsel-linux-android",
2033 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2034 license: "NOTICE",
2035}
2036
Elliott Hughesee291c02017-12-11 11:32:34 -08002037// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002038ndk_headers {
2039 name: "libc_asm_mips64",
2040 from: "kernel/uapi/asm-mips",
2041 to: "mips64el-linux-android",
2042 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2043 license: "NOTICE",
2044}
2045
2046ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002047 name: "libc_asm_x86",
2048 from: "kernel/uapi/asm-x86",
2049 to: "i686-linux-android",
2050 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002051 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002052}
2053
2054ndk_headers {
2055 name: "libc_asm_x86_64",
2056 from: "kernel/uapi/asm-x86",
2057 to: "x86_64-linux-android",
2058 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002059 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002060}
2061
Dan Albert4238a352016-06-28 11:18:05 -07002062ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002063 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002064 symbol_file: "libc.map.txt",
2065 first_version: "9",
2066}
2067
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002068llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002069 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002070 symbol_file: "libc.map.txt",
2071 export_headers_as_system: true,
2072 export_preprocessed_headers: ["include"],
2073 arch: {
2074 arm: {
2075 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002076 "kernel/uapi",
2077 "kernel/uapi/asm-arm",
2078 "kernel/android/uapi",
2079 ],
2080 },
2081 arm64: {
2082 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002083 "kernel/uapi",
2084 "kernel/uapi/asm-arm64",
2085 "kernel/android/uapi",
2086 ],
2087 },
2088 mips: {
2089 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002090 "kernel/uapi",
2091 "kernel/uapi/asm-mips",
2092 "kernel/android/uapi",
2093 ],
2094 },
2095 mips64: {
2096 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002097 "kernel/uapi",
2098 "kernel/uapi/asm-mips",
2099 "kernel/android/uapi",
2100 ],
2101 },
2102 x86: {
2103 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002104 "kernel/uapi",
2105 "kernel/uapi/asm-x86",
2106 "kernel/android/uapi",
2107 ],
2108 },
2109 x86_64: {
2110 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002111 "kernel/uapi",
2112 "kernel/uapi/asm-x86",
2113 "kernel/android/uapi",
2114 ],
2115 },
2116 },
2117}
2118
Dan Albertdf31aff2016-10-06 15:50:41 -07002119ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002120 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002121 symbol_file: "libstdc++.map.txt",
2122 first_version: "9",
2123}
2124
Dan Willemsenca056d72018-01-08 14:00:24 -08002125// Export these headers for toolbox to process
2126filegroup {
2127 name: "kernel_input_headers",
2128 srcs: [
2129 "kernel/uapi/linux/input.h",
2130 "kernel/uapi/linux/input-event-codes.h",
2131 ],
2132}