blob: 89657d70f98564bd75c61baff3fb2a806e21f190 [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,
Jiyong Park5603c6e2018-04-27 21:53:11 +090076 recovery_available: true,
Dan Willemsen208ae172015-09-16 16:33:27 -070077}
78
Dan Willemsen208ae172015-09-16 16:33:27 -070079// ANDROIDMK TRANSLATION ERROR: unsupported directive
80// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
81//libc_common_cflags += ["-DDEBUG"]
82// ANDROIDMK TRANSLATION ERROR: unsupported directive
83// endif
84
Dan Willemsen208ae172015-09-16 16:33:27 -070085// ========================================================
86// libc_stack_protector.a - stack protector code
87// ========================================================
88//
Colin Crossa3f9fca2016-01-11 13:20:55 -080089// Code that implements the stack protector (or that runs
90// before TLS has been set up) needs to be compiled with
91// -fno-stack-protector, since it accesses the stack canary
92// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070093
94cc_library_static {
95
Colin Crossa3f9fca2016-01-11 13:20:55 -080096 srcs: [
97 "bionic/__libc_init_main_thread.cpp",
98 "bionic/__stack_chk_fail.cpp",
99 ],
100 arch: {
101 arm64: {
102 srcs: ["arch-arm64/bionic/__set_tls.c"],
103 },
104 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800105 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800106 },
107 x86_64: {
108 srcs: ["arch-x86_64/bionic/__set_tls.c"],
109 },
110 },
111
Colin Cross50c21ab2015-10-31 23:03:05 -0700112 defaults: ["libc_defaults"],
113 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700114 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700115}
116
Colin Crossa3f9fca2016-01-11 13:20:55 -0800117// libc_init_static.cpp also needs to be built without stack protector,
118// because it's responsible for setting up TLS for static executables.
119// This isn't the case for dynamic executables because the dynamic linker
120// has already set up the main thread's TLS.
121
122cc_library_static {
123 name: "libc_init_static",
124 defaults: ["libc_defaults"],
125 srcs: ["bionic/libc_init_static.cpp"],
126 cflags: ["-fno-stack-protector"],
127}
128
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700129cc_library_static {
130 name: "libc_init_dynamic",
131 defaults: ["libc_defaults"],
132 srcs: ["bionic/libc_init_dynamic.cpp"],
133 cflags: ["-fno-stack-protector"],
134}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800135
Dan Willemsen208ae172015-09-16 16:33:27 -0700136// ========================================================
137// libc_tzcode.a - upstream 'tzcode' code
138// ========================================================
139
140cc_library_static {
141
Colin Cross50c21ab2015-10-31 23:03:05 -0700142 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700143 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800144 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700145 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700146 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
147 ],
148
Colin Cross50c21ab2015-10-31 23:03:05 -0700149 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700150 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700151 // Don't use ridiculous amounts of stack.
152 "-DALL_STATE",
153 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
154 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800155 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700156 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700157 // The name of the tm_gmtoff field in our struct tm.
158 "-DTM_GMTOFF=tm_gmtoff",
159 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700160 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700161 // Include `tzname`, `timezone`, and `daylight` globals.
162 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700163 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800164 // Use the empty string (instead of " ") as the timezone abbreviation
165 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700166 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700167 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
168 "-Dlint",
169 ],
170
Dan Willemsen208ae172015-09-16 16:33:27 -0700171 local_include_dirs: ["tzcode/"],
172 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700173}
174
175// ========================================================
176// libc_dns.a - modified NetBSD DNS code
177// ========================================================
178
179cc_library_static {
180
Colin Cross50c21ab2015-10-31 23:03:05 -0700181 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700182 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800183 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700184
185 "upstream-netbsd/lib/libc/isc/ev_streams.c",
186 "upstream-netbsd/lib/libc/isc/ev_timers.c",
187 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700188 ],
189
Colin Cross50c21ab2015-10-31 23:03:05 -0700190 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700191 "-DANDROID_CHANGES",
192 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700193 "-Wno-unused-parameter",
194 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700195 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700196 ],
197
Dan Willemsen208ae172015-09-16 16:33:27 -0700198 local_include_dirs: [
199 "dns/include",
200 "private",
201 "upstream-netbsd/lib/libc/include",
202 "upstream-netbsd/android/include",
203 ],
204
205 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700206}
207
208// ========================================================
209// libc_freebsd.a - upstream FreeBSD C library code
210// ========================================================
211//
212// These files are built with the freebsd-compat.h header file
213// automatically included.
214
215cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700216 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700217 srcs: [
218 "upstream-freebsd/lib/libc/gen/ldexp.c",
219 "upstream-freebsd/lib/libc/gen/sleep.c",
220 "upstream-freebsd/lib/libc/gen/usleep.c",
221 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700222 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
223 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
224 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
225 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700226 "upstream-freebsd/lib/libc/stdlib/qsort.c",
227 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700228 "upstream-freebsd/lib/libc/string/wcpcpy.c",
229 "upstream-freebsd/lib/libc/string/wcpncpy.c",
230 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700231 "upstream-freebsd/lib/libc/string/wcscat.c",
232 "upstream-freebsd/lib/libc/string/wcschr.c",
233 "upstream-freebsd/lib/libc/string/wcscmp.c",
234 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700235 "upstream-freebsd/lib/libc/string/wcscspn.c",
236 "upstream-freebsd/lib/libc/string/wcsdup.c",
237 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700238 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700239 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
240 "upstream-freebsd/lib/libc/string/wcsncat.c",
241 "upstream-freebsd/lib/libc/string/wcsncmp.c",
242 "upstream-freebsd/lib/libc/string/wcsncpy.c",
243 "upstream-freebsd/lib/libc/string/wcsnlen.c",
244 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700245 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700246 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700247 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700248 "upstream-freebsd/lib/libc/string/wcstok.c",
249 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700250 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700251 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700252 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800253 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700254 ],
255 arch: {
256 arm64: {
257 exclude_srcs: [
258 "upstream-freebsd/lib/libc/string/wmemmove.c",
259 ],
260 },
261 x86: {
262 exclude_srcs: [
263 "upstream-freebsd/lib/libc/string/wcschr.c",
264 "upstream-freebsd/lib/libc/string/wcscmp.c",
265 "upstream-freebsd/lib/libc/string/wcslen.c",
266 "upstream-freebsd/lib/libc/string/wcsrchr.c",
267 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800268 atom: {
269 exclude_srcs: [
270 "upstream-freebsd/lib/libc/string/wmemcmp.c",
271 ],
272 },
273 ssse3: {
274 exclude_srcs: [
275 "upstream-freebsd/lib/libc/string/wcscat.c",
276 "upstream-freebsd/lib/libc/string/wcscpy.c",
277 ],
278 },
279 sse4: {
280 exclude_srcs: [
281 "upstream-freebsd/lib/libc/string/wmemcmp.c",
282 ],
283 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700284 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700285 },
286
Colin Cross50c21ab2015-10-31 23:03:05 -0700287 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700288 "-Wno-sign-compare",
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",
Dan Willemsen879cec22016-02-29 10:37:56 -0800371 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700372 "-DPOSIX_MISTAKE",
373 "-include netbsd-compat.h",
374 ],
375
Dan Willemsen208ae172015-09-16 16:33:27 -0700376 local_include_dirs: [
377 "upstream-netbsd/android/include",
378 "upstream-netbsd/lib/libc/include",
379 ],
380
381 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700382}
383
384// ========================================================
385// libc_openbsd_ndk.a - upstream OpenBSD C library code
386// that can be safely included in the libc_ndk.a (doesn't
387// contain any troublesome global data or constructors).
388// ========================================================
389//
390// These files are built with the openbsd-compat.h header file
391// automatically included.
392
393cc_library_static {
394 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700395 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700396 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700397 "upstream-openbsd/lib/libc/gen/alarm.c",
398 "upstream-openbsd/lib/libc/gen/ctype_.c",
399 "upstream-openbsd/lib/libc/gen/daemon.c",
400 "upstream-openbsd/lib/libc/gen/err.c",
401 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700402 "upstream-openbsd/lib/libc/gen/fnmatch.c",
403 "upstream-openbsd/lib/libc/gen/ftok.c",
404 "upstream-openbsd/lib/libc/gen/getprogname.c",
405 "upstream-openbsd/lib/libc/gen/isctype.c",
406 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700407 "upstream-openbsd/lib/libc/gen/tolower_.c",
408 "upstream-openbsd/lib/libc/gen/toupper_.c",
409 "upstream-openbsd/lib/libc/gen/verr.c",
410 "upstream-openbsd/lib/libc/gen/verrx.c",
411 "upstream-openbsd/lib/libc/gen/vwarn.c",
412 "upstream-openbsd/lib/libc/gen/vwarnx.c",
413 "upstream-openbsd/lib/libc/gen/warn.c",
414 "upstream-openbsd/lib/libc/gen/warnx.c",
415 "upstream-openbsd/lib/libc/locale/btowc.c",
416 "upstream-openbsd/lib/libc/locale/mbrlen.c",
417 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
418 "upstream-openbsd/lib/libc/locale/mbtowc.c",
419 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700420 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
421 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700422 "upstream-openbsd/lib/libc/locale/wcstoll.c",
423 "upstream-openbsd/lib/libc/locale/wcstombs.c",
424 "upstream-openbsd/lib/libc/locale/wcstoul.c",
425 "upstream-openbsd/lib/libc/locale/wcstoull.c",
426 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
427 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
428 "upstream-openbsd/lib/libc/locale/wctob.c",
429 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700430 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700431 "upstream-openbsd/lib/libc/net/htonl.c",
432 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700433 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
434 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
435 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700436 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
437 "upstream-openbsd/lib/libc/net/inet_ntop.c",
438 "upstream-openbsd/lib/libc/net/inet_pton.c",
439 "upstream-openbsd/lib/libc/net/ntohl.c",
440 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800441 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
444 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700445 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700447 "upstream-openbsd/lib/libc/stdio/fputwc.c",
448 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700449 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
450 "upstream-openbsd/lib/libc/stdio/fwalk.c",
451 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700452 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700454 "upstream-openbsd/lib/libc/stdio/makebuf.c",
455 "upstream-openbsd/lib/libc/stdio/mktemp.c",
456 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
457 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700458 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700459 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700460 "upstream-openbsd/lib/libc/stdio/tempnam.c",
461 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
462 "upstream-openbsd/lib/libc/stdio/ungetc.c",
463 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
464 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
465 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700466 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
467 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
468 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700469 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/stdio/wsetup.c",
471 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700472 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700473 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700474 "upstream-openbsd/lib/libc/stdlib/insque.c",
475 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
476 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
477 "upstream-openbsd/lib/libc/stdlib/labs.c",
478 "upstream-openbsd/lib/libc/stdlib/llabs.c",
479 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
480 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
481 "upstream-openbsd/lib/libc/stdlib/remque.c",
482 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700483 "upstream-openbsd/lib/libc/stdlib/tfind.c",
484 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
485 "upstream-openbsd/lib/libc/string/strcasecmp.c",
486 "upstream-openbsd/lib/libc/string/strcspn.c",
487 "upstream-openbsd/lib/libc/string/strdup.c",
488 "upstream-openbsd/lib/libc/string/strndup.c",
489 "upstream-openbsd/lib/libc/string/strpbrk.c",
490 "upstream-openbsd/lib/libc/string/strsep.c",
491 "upstream-openbsd/lib/libc/string/strspn.c",
492 "upstream-openbsd/lib/libc/string/strstr.c",
493 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700494 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700495 "upstream-openbsd/lib/libc/string/wcswidth.c",
496 ],
497
Colin Cross50c21ab2015-10-31 23:03:05 -0700498 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700499 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700500 "-Wno-unused-parameter",
501 "-include openbsd-compat.h",
502 ],
503
Dan Willemsen208ae172015-09-16 16:33:27 -0700504 local_include_dirs: [
505 "private",
506 "stdio",
507 "upstream-openbsd/android/include",
508 "upstream-openbsd/lib/libc/include",
509 "upstream-openbsd/lib/libc/gdtoa/",
510 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700511}
512
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700513cc_library_static {
514 name: "libc_openbsd_large_stack",
515 defaults: ["libc_defaults"],
516 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700517 "stdio/vfprintf.cpp",
518 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700519 ],
520 cflags: [
521 "-include openbsd-compat.h",
522 "-Wno-sign-compare",
523 "-Wframe-larger-than=5000",
524 ],
525
526 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700527 "upstream-openbsd/android/include/",
528 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700529 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700530 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700531 ],
532}
533
Dan Willemsen208ae172015-09-16 16:33:27 -0700534// ========================================================
535// libc_openbsd.a - upstream OpenBSD C library code
536// ========================================================
537//
538// These files are built with the openbsd-compat.h header file
539// automatically included.
540cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700541 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700542 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800543 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700544 "upstream-openbsd/lib/libc/crypt/arc4random.c",
545 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
546
547 // May be overriden by per-arch optimized versions
548 "upstream-openbsd/lib/libc/string/memchr.c",
549 "upstream-openbsd/lib/libc/string/memmove.c",
550 "upstream-openbsd/lib/libc/string/memrchr.c",
551 "upstream-openbsd/lib/libc/string/stpcpy.c",
552 "upstream-openbsd/lib/libc/string/stpncpy.c",
553 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700554 "upstream-openbsd/lib/libc/string/strcpy.c",
555 "upstream-openbsd/lib/libc/string/strlcat.c",
556 "upstream-openbsd/lib/libc/string/strlcpy.c",
557 "upstream-openbsd/lib/libc/string/strncat.c",
558 "upstream-openbsd/lib/libc/string/strncmp.c",
559 "upstream-openbsd/lib/libc/string/strncpy.c",
560 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700561
562 arch: {
563 arm: {
564 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700565 "upstream-openbsd/lib/libc/string/strcpy.c",
566 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800567 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700568 exclude_srcs: [
569 "upstream-openbsd/lib/libc/string/memmove.c",
570 "upstream-openbsd/lib/libc/string/stpcpy.c",
571 "upstream-openbsd/lib/libc/string/strcat.c",
572 ],
573 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700574 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700575 arm64: {
576 exclude_srcs: [
577 "upstream-openbsd/lib/libc/string/memchr.c",
578 "upstream-openbsd/lib/libc/string/memmove.c",
579 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700580 "upstream-openbsd/lib/libc/string/strcpy.c",
581 "upstream-openbsd/lib/libc/string/strncmp.c",
582 ],
583 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530584 mips: {
585 exclude_srcs: [
586 "upstream-openbsd/lib/libc/string/memchr.c",
587 "upstream-openbsd/lib/libc/string/memmove.c",
588 "upstream-openbsd/lib/libc/string/strcpy.c",
589 "upstream-openbsd/lib/libc/string/strncmp.c",
590 ],
591 },
592 mips64: {
593 exclude_srcs: [
594 "upstream-openbsd/lib/libc/string/memchr.c",
595 "upstream-openbsd/lib/libc/string/memmove.c",
596 "upstream-openbsd/lib/libc/string/strcpy.c",
597 "upstream-openbsd/lib/libc/string/strncmp.c",
598 ],
599 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700600 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800601 exclude_srcs: [
602 "upstream-openbsd/lib/libc/string/memchr.c",
603 "upstream-openbsd/lib/libc/string/memmove.c",
604 "upstream-openbsd/lib/libc/string/memrchr.c",
605 "upstream-openbsd/lib/libc/string/stpcpy.c",
606 "upstream-openbsd/lib/libc/string/stpncpy.c",
607 "upstream-openbsd/lib/libc/string/strcat.c",
608 "upstream-openbsd/lib/libc/string/strcpy.c",
609 "upstream-openbsd/lib/libc/string/strncmp.c",
610 "upstream-openbsd/lib/libc/string/strncpy.c",
611 ],
612 ssse3: {
613 exclude_srcs: [
614 "upstream-openbsd/lib/libc/string/strlcat.c",
615 "upstream-openbsd/lib/libc/string/strlcpy.c",
616 "upstream-openbsd/lib/libc/string/strncat.c",
617 ],
618 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700619 },
620
621 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800622 exclude_srcs: [
623 "upstream-openbsd/lib/libc/string/memmove.c",
624 "upstream-openbsd/lib/libc/string/stpcpy.c",
625 "upstream-openbsd/lib/libc/string/stpncpy.c",
626 "upstream-openbsd/lib/libc/string/strcat.c",
627 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800628 "upstream-openbsd/lib/libc/string/strncat.c",
629 "upstream-openbsd/lib/libc/string/strncmp.c",
630 "upstream-openbsd/lib/libc/string/strncpy.c",
631 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700632 },
633 },
634
Colin Cross50c21ab2015-10-31 23:03:05 -0700635 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700636 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700637 "-Wno-unused-parameter",
638 "-include openbsd-compat.h",
639 ],
640
Dan Willemsen208ae172015-09-16 16:33:27 -0700641 local_include_dirs: [
642 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700643 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700644 ],
645
646 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700647}
648
649// ========================================================
650// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
651// ========================================================
652//
653// These files are built with the openbsd-compat.h header file
654// automatically included.
655
656cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700657 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700658 srcs: [
659 "upstream-openbsd/android/gdtoa_support.cpp",
660 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
661 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
662 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
663 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
664 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
665 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
666 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
667 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
668 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
669 "upstream-openbsd/lib/libc/gdtoa/misc.c",
670 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
671 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
672 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
673 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
674 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
675 "upstream-openbsd/lib/libc/gdtoa/sum.c",
676 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
677 ],
678 multilib: {
679 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800680 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700681 },
682 },
683
Colin Cross50c21ab2015-10-31 23:03:05 -0700684 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700685 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700686 "-include openbsd-compat.h",
687 ],
688
Dan Willemsen208ae172015-09-16 16:33:27 -0700689 local_include_dirs: [
690 "private",
691 "upstream-openbsd/android/include",
692 "upstream-openbsd/lib/libc/include",
693 ],
694
695 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700696}
697
698// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700699// libc_fortify.a - container for our FORITFY
700// implementation details
701// ========================================================
702cc_library_static {
703 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700704 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700705
706 name: "libc_fortify",
707
708 // Disable FORTIFY for the compilation of these, so we don't end up having
709 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800710 cflags: [
711 "-U_FORTIFY_SOURCE",
712 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
713 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700714
715 arch: {
716 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700717 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700718 srcs: [
719 "arch-arm/generic/bionic/__memcpy_chk.S",
720 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800721 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800722 cflags: [
723 "-DNO___STRCAT_CHK",
724 "-DNO___STRCPY_CHK",
725 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700726 srcs: [
727 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
728 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
729 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700730 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800731 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700732 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800733 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
734 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
735 ],
736 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700737 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
738 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
739 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700740 },
741 cortex_a9: {
742 srcs: [
743 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
744 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
745 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800746 exclude_srcs: [
747 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
748 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
749 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700750 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800751 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700752 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800753 "arch-arm/krait/bionic/__strcat_chk.S",
754 "arch-arm/krait/bionic/__strcpy_chk.S",
755 ],
756 exclude_srcs: [
757 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
758 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
759 ],
760 },
761 cortex_a53: {
762 srcs: [
763 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
764 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
765 ],
766 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700767 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
768 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
769 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700770 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700771 cortex_a55: {
772 srcs: [
773 "arch-arm/denver/bionic/__strcat_chk.S",
774 "arch-arm/denver/bionic/__strcpy_chk.S",
775 ],
776 exclude_srcs: [
777 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
778 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
779 ],
780 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700781 cortex_a73: {
782 srcs: [
783 "arch-arm/denver/bionic/__strcat_chk.S",
784 "arch-arm/denver/bionic/__strcpy_chk.S",
785 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800786 exclude_srcs: [
787 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
788 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
789 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700790 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700791 cortex_a75: {
792 srcs: [
793 "arch-arm/denver/bionic/__strcat_chk.S",
794 "arch-arm/denver/bionic/__strcpy_chk.S",
795 ],
796 exclude_srcs: [
797 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
798 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
799 ],
800 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700801 denver: {
802 srcs: [
803 "arch-arm/denver/bionic/__strcat_chk.S",
804 "arch-arm/denver/bionic/__strcpy_chk.S",
805 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800806 exclude_srcs: [
807 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
808 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
809 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700810 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800811 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700812 srcs: [
813 "arch-arm/krait/bionic/__strcat_chk.S",
814 "arch-arm/krait/bionic/__strcpy_chk.S",
815 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800816 exclude_srcs: [
817 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
818 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700819 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700820 },
821 },
822 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700823 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700824 srcs: [
825 "arch-arm64/generic/bionic/__memcpy_chk.S",
826 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700827 },
828 },
829}
830
831// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700832// libc_bionic.a - home-grown C library code
833// ========================================================
834
835cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700836 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700837 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700838 // The data that backs getauxval is initialized in the libc init
839 // functions which are invoked by the linker. If this file is included
840 // in libc_ndk.a, only one of the copies of the global data will be
841 // initialized, resulting in nullptr dereferences.
842 "bionic/getauxval.cpp",
843
Elliott Hughes211c4d32018-02-02 15:10:32 -0800844 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700845 "bionic/sysconf.cpp",
846 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700847 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700848
Josh Gao10ec9282017-04-03 15:13:29 -0700849 // The following must not be statically linked into libc_ndk.a, because
850 // debuggerd will look for the abort message in libc.so's copy.
851 "bionic/android_set_abort_message.cpp",
852
Dan Willemsen208ae172015-09-16 16:33:27 -0700853 "bionic/strchr.cpp",
854 "bionic/strnlen.c",
855 "bionic/strrchr.cpp",
856 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700857
858 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700859 arm: {
860 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800861 "arch-arm/generic/bionic/memcmp.S",
862 "arch-arm/generic/bionic/memcpy.S",
863 "arch-arm/generic/bionic/memset.S",
864 "arch-arm/generic/bionic/strcmp.S",
865 "arch-arm/generic/bionic/strcpy.S",
866 "arch-arm/generic/bionic/strlen.c",
867
Dan Willemsen208ae172015-09-16 16:33:27 -0700868 "arch-arm/bionic/atomics_arm.c",
869 "arch-arm/bionic/__bionic_clone.S",
870 "arch-arm/bionic/_exit_with_stack_teardown.S",
871 "arch-arm/bionic/libgcc_compat.c",
872 "arch-arm/bionic/popcount_tab.c",
873 "arch-arm/bionic/__restore.S",
874 "arch-arm/bionic/setjmp.S",
875 "arch-arm/bionic/syscall.S",
876 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700877 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800878 cortex_a7: {
879 srcs: [
880 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800881 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800882 ],
883 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800884 "arch-arm/cortex-a15/bionic/memcpy.S",
885 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800886 ],
887 },
888 cortex_a9: {
889 srcs: [
890 "arch-arm/cortex-a9/bionic/memcpy.S",
891 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800892
Colin Cross6ab8f892015-11-23 14:12:15 -0800893 "arch-arm/cortex-a9/bionic/stpcpy.S",
894 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800895 "arch-arm/cortex-a9/bionic/strcmp.S",
896 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800897 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800898 ],
899 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800900 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800901 "arch-arm/cortex-a15/bionic/memcpy.S",
902
Colin Cross6ab8f892015-11-23 14:12:15 -0800903 "arch-arm/cortex-a15/bionic/stpcpy.S",
904 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800905 "arch-arm/cortex-a15/bionic/strcmp.S",
906 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800907 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800908 ],
909 },
910 krait: {
911 srcs: [
912 "arch-arm/krait/bionic/memcpy.S",
913 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800914
Colin Cross6ab8f892015-11-23 14:12:15 -0800915 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800916 ],
917 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800918 "arch-arm/cortex-a15/bionic/memset.S",
919 "arch-arm/cortex-a15/bionic/memcpy.S",
920
921 "arch-arm/cortex-a15/bionic/strcmp.S",
922 ],
923 },
924 cortex_a53: {
925 srcs: [
926 "arch-arm/cortex-a53/bionic/memcpy.S",
927 "arch-arm/cortex-a7/bionic/memset.S",
928 ],
929 exclude_srcs: [
930 "arch-arm/cortex-a15/bionic/memset.S",
931 "arch-arm/cortex-a15/bionic/memcpy.S",
932 ],
933 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700934 cortex_a55: {
935 srcs: [
936 "arch-arm/cortex-a7/bionic/memset.S",
937 "arch-arm/denver/bionic/memcpy.S",
938
939 "arch-arm/krait/bionic/strcmp.S",
940 ],
941 exclude_srcs: [
942 "arch-arm/cortex-a15/bionic/memset.S",
943 "arch-arm/cortex-a15/bionic/memcpy.S",
944 "arch-arm/cortex-a15/bionic/strcmp.S",
945 ],
946 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800947 cortex_a73: {
948 srcs: [
949 "arch-arm/cortex-a7/bionic/memset.S",
950 "arch-arm/denver/bionic/memcpy.S",
951
952 "arch-arm/krait/bionic/strcmp.S",
953 ],
954 exclude_srcs: [
955 "arch-arm/cortex-a15/bionic/memset.S",
956 "arch-arm/cortex-a15/bionic/memcpy.S",
957 "arch-arm/cortex-a15/bionic/strcmp.S",
958 ],
959 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700960 cortex_a75: {
961 srcs: [
962 "arch-arm/cortex-a7/bionic/memset.S",
963 "arch-arm/denver/bionic/memcpy.S",
964
965 "arch-arm/krait/bionic/strcmp.S",
966 ],
967 exclude_srcs: [
968 "arch-arm/cortex-a15/bionic/memset.S",
969 "arch-arm/cortex-a15/bionic/memcpy.S",
970 "arch-arm/cortex-a15/bionic/strcmp.S",
971 ],
972 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800973 denver: {
974 srcs: [
975 "arch-arm/denver/bionic/memcpy.S",
976 "arch-arm/denver/bionic/memset.S",
977 ],
978 exclude_srcs: [
979 "arch-arm/cortex-a15/bionic/memset.S",
980 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800981 ],
982 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700983 kryo: {
984 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400985 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400986 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800987
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800988 "arch-arm/krait/bionic/strcmp.S",
989 ],
990 exclude_srcs: [
991 "arch-arm/cortex-a15/bionic/memset.S",
992 "arch-arm/cortex-a15/bionic/memcpy.S",
993 "arch-arm/cortex-a15/bionic/strcmp.S",
994 ],
995 },
996 // Cores not listed above (like cortex-a8, cortex-a15) or
997 // "generic" core will use the following implementation.
998 neon: {
999 srcs: [
1000 "arch-arm/cortex-a15/bionic/memcpy.S",
1001 "arch-arm/cortex-a15/bionic/memset.S",
1002
Christopher Ferris950a9582017-03-29 13:10:56 -07001003 "arch-arm/cortex-a15/bionic/stpcpy.S",
1004 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001005 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -07001006 "arch-arm/cortex-a15/bionic/strcpy.S",
1007 "arch-arm/cortex-a15/bionic/strlen.S",
1008
1009 "arch-arm/denver/bionic/memmove.S",
1010 ],
1011 exclude_srcs: [
1012 "arch-arm/generic/bionic/memcpy.S",
1013 "arch-arm/generic/bionic/memset.S",
1014 "arch-arm/generic/bionic/strcmp.S",
1015 "arch-arm/generic/bionic/strcpy.S",
1016 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -07001017 ],
1018 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001019 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001020 arm64: {
1021 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001022 "arch-arm64/generic/bionic/memchr.S",
1023 "arch-arm64/generic/bionic/memcmp.S",
1024 "arch-arm64/generic/bionic/memcpy.S",
1025 "arch-arm64/generic/bionic/memmove.S",
1026 "arch-arm64/generic/bionic/memset.S",
1027 "arch-arm64/generic/bionic/stpcpy.S",
1028 "arch-arm64/generic/bionic/strchr.S",
1029 "arch-arm64/generic/bionic/strcmp.S",
1030 "arch-arm64/generic/bionic/strcpy.S",
1031 "arch-arm64/generic/bionic/strlen.S",
1032 "arch-arm64/generic/bionic/strncmp.S",
1033 "arch-arm64/generic/bionic/strnlen.S",
1034 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001035
1036 "arch-arm64/bionic/__bionic_clone.S",
1037 "arch-arm64/bionic/_exit_with_stack_teardown.S",
1038 "arch-arm64/bionic/setjmp.S",
1039 "arch-arm64/bionic/syscall.S",
1040 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001041 ],
1042 exclude_srcs: [
1043 "bionic/__memcpy_chk.cpp",
1044 "bionic/strchr.cpp",
1045 "bionic/strnlen.c",
1046 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001047 denver64: {
1048 srcs: [
1049 "arch-arm64/denver64/bionic/memcpy.S",
1050 "arch-arm64/denver64/bionic/memset.S",
1051 ],
1052 exclude_srcs: [
1053 "arch-arm64/generic/bionic/memcpy.S",
1054 "arch-arm64/generic/bionic/memset.S",
1055 ],
1056 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001057 cortex_a53: {
1058 srcs: [
1059 "arch-arm64/cortex-a53/bionic/memmove.S",
1060 ],
1061 exclude_srcs: [
1062 "arch-arm64/generic/bionic/memmove.S",
1063 ],
1064 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -07001065 cortex_a55: {
1066 srcs: [
1067 "arch-arm64/cortex-a53/bionic/memmove.S",
1068 ],
1069 exclude_srcs: [
1070 "arch-arm64/generic/bionic/memmove.S",
1071 ],
1072 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001073 cortex_a73: {
1074 srcs: [
1075 "arch-arm64/cortex-a53/bionic/memmove.S",
1076 ],
1077 exclude_srcs: [
1078 "arch-arm64/generic/bionic/memmove.S",
1079 ],
1080 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -07001081 cortex_a75: {
1082 srcs: [
1083 "arch-arm64/cortex-a53/bionic/memmove.S",
1084 ],
1085 exclude_srcs: [
1086 "arch-arm64/generic/bionic/memmove.S",
1087 ],
1088 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001089 },
1090
1091 mips: {
1092 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001093 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301094 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001095 "arch-mips/string/memset.S",
1096 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301097 "arch-mips/string/strncmp.S",
1098 "arch-mips/string/strlen.c",
1099 "arch-mips/string/strnlen.c",
1100 "arch-mips/string/strchr.c",
1101 "arch-mips/string/strcpy.c",
1102 "arch-mips/string/memchr.c",
1103 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001104
Dan Willemsen208ae172015-09-16 16:33:27 -07001105 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001106 "arch-mips/bionic/cacheflush.cpp",
1107 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001108 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001109 "arch-mips/bionic/setjmp.S",
1110 "arch-mips/bionic/syscall.S",
1111 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001112 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301113 exclude_srcs: [
1114 "bionic/strchr.cpp",
1115 "bionic/strnlen.c",
1116 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001117 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001118 mips64: {
1119 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001120 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301121 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001122 "arch-mips/string/memset.S",
1123 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301124 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001125 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301126 "arch-mips/string/strnlen.c",
1127 "arch-mips/string/strchr.c",
1128 "arch-mips/string/strcpy.c",
1129 "arch-mips/string/memchr.c",
1130 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001131
Dan Willemsen208ae172015-09-16 16:33:27 -07001132 "arch-mips64/bionic/__bionic_clone.S",
1133 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1134 "arch-mips64/bionic/setjmp.S",
1135 "arch-mips64/bionic/syscall.S",
1136 "arch-mips64/bionic/vfork.S",
1137 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001138 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301139 exclude_srcs: [
1140 "bionic/strchr.cpp",
1141 "bionic/strnlen.c",
1142 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001143 },
1144
1145 x86: {
1146 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001147 "arch-x86/generic/string/memcmp.S",
1148 "arch-x86/generic/string/strcmp.S",
1149 "arch-x86/generic/string/strncmp.S",
1150 "arch-x86/generic/string/strcat.S",
1151 "arch-x86/atom/string/sse2-memchr-atom.S",
1152 "arch-x86/atom/string/sse2-memrchr-atom.S",
1153 "arch-x86/atom/string/sse2-strchr-atom.S",
1154 "arch-x86/atom/string/sse2-strnlen-atom.S",
1155 "arch-x86/atom/string/sse2-strrchr-atom.S",
1156 "arch-x86/atom/string/sse2-wcschr-atom.S",
1157 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1158 "arch-x86/atom/string/sse2-wcslen-atom.S",
1159 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001160 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1161 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1162 "arch-x86/silvermont/string/sse2-memset-slm.S",
1163 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1164 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1165 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1166 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1167 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001168
1169 "arch-x86/bionic/__bionic_clone.S",
1170 "arch-x86/bionic/_exit_with_stack_teardown.S",
1171 "arch-x86/bionic/libgcc_compat.c",
1172 "arch-x86/bionic/__restore.S",
1173 "arch-x86/bionic/setjmp.S",
1174 "arch-x86/bionic/syscall.S",
1175 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001176 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001177
1178 exclude_srcs: [
1179 "bionic/strchr.cpp",
1180 "bionic/strnlen.c",
1181 "bionic/strrchr.cpp",
1182 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001183 atom: {
1184 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001185 "arch-x86/atom/string/sse2-memset-atom.S",
1186 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001187 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001188 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001189 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001190 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001191 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1192 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1193 ],
1194 exclude_srcs: [
1195 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001196 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1197 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1198 "arch-x86/silvermont/string/sse2-memset-slm.S",
1199 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1200 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1201 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1202 ],
1203 },
1204 ssse3: {
1205 srcs: [
1206 "arch-x86/atom/string/ssse3-strncat-atom.S",
1207 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1208 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1209 "arch-x86/atom/string/ssse3-strcat-atom.S",
1210 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1211 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1212 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1213 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1214 ],
1215 exclude_srcs: [
1216 "arch-x86/generic/string/strcmp.S",
1217 "arch-x86/generic/string/strncmp.S",
1218 "arch-x86/generic/string/strcat.S",
1219 ],
1220 },
1221 sse4: {
1222 srcs: [
1223 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1224 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1225 ],
1226 exclude_srcs: [
1227 "arch-x86/generic/string/memcmp.S",
1228 ],
1229 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001230 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001231 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001232 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001233 "arch-x86_64/string/sse2-memcpy-slm.S",
1234 "arch-x86_64/string/sse2-memmove-slm.S",
1235 "arch-x86_64/string/sse2-memset-slm.S",
1236 "arch-x86_64/string/sse2-stpcpy-slm.S",
1237 "arch-x86_64/string/sse2-stpncpy-slm.S",
1238 "arch-x86_64/string/sse2-strcat-slm.S",
1239 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001240 "arch-x86_64/string/sse2-strlen-slm.S",
1241 "arch-x86_64/string/sse2-strncat-slm.S",
1242 "arch-x86_64/string/sse2-strncpy-slm.S",
1243 "arch-x86_64/string/sse4-memcmp-slm.S",
1244 "arch-x86_64/string/ssse3-strcmp-slm.S",
1245 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001246
1247 "arch-x86_64/bionic/__bionic_clone.S",
1248 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1249 "arch-x86_64/bionic/__restore_rt.S",
1250 "arch-x86_64/bionic/setjmp.S",
1251 "arch-x86_64/bionic/syscall.S",
1252 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001253 ],
1254 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001255 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001256
Colin Cross50c21ab2015-10-31 23:03:05 -07001257 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001258 include_dirs: ["bionic/libstdc++/include"],
1259 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001260}
1261
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001262genrule {
1263 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001264 out: ["generated_android_ids.h"],
1265 srcs: [":android_filesystem_config_header"],
1266 tool_files: ["fs_config_generator.py"],
1267 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001268}
1269
Dan Willemsen268a6732015-10-15 14:49:45 -07001270// ========================================================
1271// libc_bionic_ndk.a- The portions of libc_bionic that can
1272// be safely used in libc_ndk.a (no troublesome global data
1273// or constructors).
1274// ========================================================
1275cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001276 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001277 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001278 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001279 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001280 "bionic/__cmsg_nxthdr.cpp",
1281 "bionic/__errno.cpp",
1282 "bionic/__gnu_basename.cpp",
1283 "bionic/__libc_current_sigrtmax.cpp",
1284 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001285 "bionic/abort.cpp",
1286 "bionic/accept.cpp",
1287 "bionic/accept4.cpp",
1288 "bionic/access.cpp",
1289 "bionic/arpa_inet.cpp",
1290 "bionic/assert.cpp",
1291 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001292 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001293 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001294 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001295 "bionic/bionic_systrace.cpp",
1296 "bionic/bionic_time_conversions.cpp",
1297 "bionic/brk.cpp",
1298 "bionic/c16rtomb.cpp",
1299 "bionic/c32rtomb.cpp",
1300 "bionic/chmod.cpp",
1301 "bionic/chown.cpp",
1302 "bionic/clearenv.cpp",
1303 "bionic/clock.cpp",
1304 "bionic/clock_getcpuclockid.cpp",
1305 "bionic/clock_nanosleep.cpp",
1306 "bionic/clone.cpp",
1307 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001308 "bionic/connect.cpp",
1309 "bionic/ctype.cpp",
1310 "bionic/dirent.cpp",
1311 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001312 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001313 "bionic/error.cpp",
1314 "bionic/eventfd_read.cpp",
1315 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001316 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001317 "bionic/faccessat.cpp",
1318 "bionic/fchmod.cpp",
1319 "bionic/fchmodat.cpp",
1320 "bionic/ffs.cpp",
1321 "bionic/fgetxattr.cpp",
1322 "bionic/flistxattr.cpp",
1323 "bionic/flockfile.cpp",
1324 "bionic/fpclassify.cpp",
1325 "bionic/fsetxattr.cpp",
1326 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001327 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001328 "bionic/futimens.cpp",
1329 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001330 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001331 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001332 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001333 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001334 "bionic/getpgrp.cpp",
1335 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001336 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001337 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001338 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001339 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001340 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001341 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001342 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001343 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001344 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001345 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001346 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001347 "bionic/lchown.cpp",
1348 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001349 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001350 "bionic/libgen.cpp",
1351 "bionic/link.cpp",
1352 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001353 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001354 "bionic/lstat.cpp",
1355 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001356 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001357 "bionic/mbrtoc16.cpp",
1358 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001359 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001360 "bionic/mempcpy.cpp",
1361 "bionic/mkdir.cpp",
1362 "bionic/mkfifo.cpp",
1363 "bionic/mknod.cpp",
1364 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001365 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001366 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001367 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001368 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001369 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001370 "bionic/open.cpp",
1371 "bionic/pathconf.cpp",
1372 "bionic/pause.cpp",
1373 "bionic/pipe.cpp",
1374 "bionic/poll.cpp",
1375 "bionic/posix_fadvise.cpp",
1376 "bionic/posix_fallocate.cpp",
1377 "bionic/posix_madvise.cpp",
1378 "bionic/posix_timers.cpp",
1379 "bionic/ptrace.cpp",
1380 "bionic/pty.cpp",
1381 "bionic/raise.cpp",
1382 "bionic/rand.cpp",
1383 "bionic/readlink.cpp",
1384 "bionic/reboot.cpp",
1385 "bionic/recv.cpp",
1386 "bionic/rename.cpp",
1387 "bionic/rmdir.cpp",
1388 "bionic/scandir.cpp",
1389 "bionic/sched_getaffinity.cpp",
1390 "bionic/sched_getcpu.cpp",
1391 "bionic/semaphore.cpp",
1392 "bionic/send.cpp",
1393 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001394 "bionic/seteuid.cpp",
1395 "bionic/setpgrp.cpp",
1396 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001397 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001398 "bionic/sigprocmask.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001399 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001400 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001401 "bionic/stat.cpp",
1402 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001403 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001404 "bionic/strchrnul.cpp",
1405 "bionic/strerror.cpp",
1406 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001407 "bionic/string_l.cpp",
1408 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001409 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001410 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001411 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001412 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001413 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001414 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001415 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001416 "bionic/sys_msg.cpp",
1417 "bionic/sys_sem.cpp",
1418 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001419 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001420 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001421 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001422 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001423 "bionic/sysinfo.cpp",
1424 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001425 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001426 "bionic/system_property_api.cpp",
1427 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001428 "bionic/tdestroy.cpp",
1429 "bionic/termios.cpp",
1430 "bionic/thread_private.cpp",
1431 "bionic/tmpfile.cpp",
1432 "bionic/umount.cpp",
1433 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001434 "bionic/wait.cpp",
1435 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001436 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001437 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001438 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001439 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001440 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001441
1442 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1443 // which will be overridden by the actual one in libc.so.
1444 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001445 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001446
Dan Willemsen208ae172015-09-16 16:33:27 -07001447 multilib: {
1448 lib32: {
1449 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001450 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001451 },
1452 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001453 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001454 treble_linker_namespaces: {
1455 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001456 },
1457 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001458 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001459 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001460 local_include_dirs: ["stdio"],
1461 include_dirs: ["bionic/libstdc++/include"],
1462 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001463 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001464}
1465
Dan Willemsen208ae172015-09-16 16:33:27 -07001466// ========================================================
1467// libc_pthread.a - pthreads parts that previously lived in
1468// libc_bionic.a. Relocated to their own library because
1469// they can't be included in libc_ndk.a (as they layout of
1470// pthread_t has changed over the years and has ABI
1471// compatibility issues).
1472// ========================================================
1473
1474cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001475 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001476 srcs: [
1477 "bionic/pthread_atfork.cpp",
1478 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001479 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001480 "bionic/pthread_cond.cpp",
1481 "bionic/pthread_create.cpp",
1482 "bionic/pthread_detach.cpp",
1483 "bionic/pthread_equal.cpp",
1484 "bionic/pthread_exit.cpp",
1485 "bionic/pthread_getcpuclockid.cpp",
1486 "bionic/pthread_getschedparam.cpp",
1487 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001488 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001489 "bionic/pthread_join.cpp",
1490 "bionic/pthread_key.cpp",
1491 "bionic/pthread_kill.cpp",
1492 "bionic/pthread_mutex.cpp",
1493 "bionic/pthread_once.cpp",
1494 "bionic/pthread_rwlock.cpp",
1495 "bionic/pthread_self.cpp",
1496 "bionic/pthread_setname_np.cpp",
1497 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001498 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001499
1500 // The following implementations depend on pthread data or implementation,
1501 // so we can't include them in libc_ndk.a.
1502 "bionic/__cxa_thread_atexit_impl.cpp",
1503 "stdlib/atexit.c",
1504 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001505 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001506
Colin Cross50c21ab2015-10-31 23:03:05 -07001507 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001508 include_dirs: ["bionic/libstdc++/include"],
1509 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001510}
1511
1512// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001513// libc_syscalls.a
1514// ========================================================
1515
1516cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001517 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001518 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001519 arch: {
1520 arm: {
1521 srcs: ["arch-arm/syscalls/**/*.S"],
1522 },
1523 arm64: {
1524 srcs: ["arch-arm64/syscalls/**/*.S"],
1525 },
1526 mips: {
1527 srcs: ["arch-mips/syscalls/**/*.S"],
1528 },
1529 mips64: {
1530 srcs: ["arch-mips64/syscalls/**/*.S"],
1531 },
1532 x86: {
1533 srcs: ["arch-x86/syscalls/**/*.S"],
1534 },
1535 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001536 srcs: ["arch-x86_64/syscalls/**/*.S"],
1537 },
1538 },
1539 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001540}
1541
1542// ========================================================
1543// libc_aeabi.a
1544// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1545// to avoid infinite recursion. For the other architectures we just build an
1546// empty library to keep this makefile simple.
1547// ========================================================
1548
1549cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001550 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001551 arch: {
1552 arm: {
1553 srcs: ["arch-arm/bionic/__aeabi.c"],
1554 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001555 },
1556 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001557 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001558}
1559
1560// ========================================================
1561// libc_ndk.a
1562// Compatibility library for the NDK. This library contains
1563// all the parts of libc that are safe to statically link.
1564// We can't safely statically link things that can only run
1565// on a certain version of the OS. Examples include
1566// anything that talks to netd (a large portion of the DNS
1567// code) and anything that is dependent on the layout of a
1568// data structure that has changed across releases (such as
1569// pthread_t).
1570// ========================================================
1571
1572cc_library_static {
1573 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001574 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001575 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001576 multilib: {
1577 lib32: {
1578 srcs: libc_common_src_files_32,
1579 },
1580 },
1581 arch: {
1582 arm: {
1583 srcs: [
1584 "arch-arm/bionic/exidx_dynamic.c",
1585 "arch-common/bionic/crtbegin_so.c",
1586 "arch-arm/bionic/atexit_legacy.c",
1587 "arch-common/bionic/crtend_so.S",
1588 ],
1589 whole_static_libs: ["libc_aeabi"],
1590 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001591 },
1592
Colin Cross50c21ab2015-10-31 23:03:05 -07001593 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001594 "-fvisibility=hidden",
1595 "-DLIBC_STATIC",
1596 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001597
1598 whole_static_libs: [
1599 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001600 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001601 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001602 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001603 "libc_gdtoa",
1604 "libc_malloc",
1605 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001606 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001607 "libc_openbsd_ndk",
1608 "libc_stack_protector",
1609 "libc_syscalls",
1610 "libc_tzcode",
1611 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001612 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001613 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001614 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001615}
1616
1617// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001618// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001619// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001620cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001621 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001622 srcs: libc_common_src_files,
1623 multilib: {
1624 lib32: {
1625 srcs: libc_common_src_files_32,
1626 },
1627 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001628 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001629
1630 whole_static_libs: [
1631 "libc_bionic",
1632 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001633 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001634 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001635 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001636 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001637 "libc_gdtoa",
1638 "libc_malloc",
1639 "libc_netbsd",
1640 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001641 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001642 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001643 "libc_stack_protector",
1644 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001645 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001646 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001647 ],
1648
1649 arch: {
1650 arm: {
1651 whole_static_libs: ["libc_aeabi"],
1652 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001653 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001654}
1655
1656// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001657// libc_common.a
1658// ========================================================
1659
1660cc_library_static {
1661 defaults: ["libc_defaults"],
1662 name: "libc_common",
1663
1664 whole_static_libs: [
1665 "libc_nopthread",
1666 "libc_pthread",
1667 ],
1668}
1669
1670// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001671// libc_nomalloc.a
1672// ========================================================
1673//
1674// This is a version of the static C library that does not
1675// include malloc. It's useful in situations when the user wants
1676// to provide their own malloc implementation, or wants to
1677// explicitly disallow the use of malloc, such as in the
1678// dynamic linker.
1679
1680cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001681 name: "libc_nomalloc",
1682
Colin Cross50c21ab2015-10-31 23:03:05 -07001683 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001684
1685 arch: {
1686 arm: {
1687 srcs: ["arch-arm/bionic/exidx_static.c"],
1688 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001689 },
1690
Colin Cross50c21ab2015-10-31 23:03:05 -07001691 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001692
Colin Crossa3f9fca2016-01-11 13:20:55 -08001693 whole_static_libs: [
1694 "libc_common",
1695 "libc_init_static",
1696 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001697}
1698
1699// ========================================================
1700// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1701// ========================================================
1702cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001703 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001704 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001705 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001706
Dan Willemsen208ae172015-09-16 16:33:27 -07001707 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001708}
1709
1710// ========================================================
1711// libc.a + libc.so
1712// ========================================================
1713cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001714 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001715 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001716 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001717 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001718 platform_sdk_version: {
1719 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1720 },
1721 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001722 static: {
1723 srcs: [
1724 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001725 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001726 ],
1727 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001728 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001729 },
1730 shared: {
1731 srcs: [
1732 "arch-common/bionic/crtbegin_so.c",
1733 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001734 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001735 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001736 "bionic/NetdClient.cpp",
1737 "arch-common/bionic/crtend_so.S",
1738 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001739 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001740 },
1741
1742 required: ["tzdata"],
1743
1744 // Leave the symbols in the shared library so that stack unwinders can produce
1745 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001746 strip: {
1747 keep_symbols: true,
1748 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001749
Colin Cross4ce94d22016-11-15 13:15:43 -08001750 // Do not pack libc.so relocations; see http://b/20645321 for details.
1751 pack_relocations: false,
1752
dimitry06016f22018-01-05 11:39:28 +01001753 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1754 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1755 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1756 // those new libraries from libgcc.a are not declared external; if that were the case,
1757 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1758 // on the external symbols from the dependent libraries. That would create a "cloaked"
1759 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001760
dimitry06016f22018-01-05 11:39:28 +01001761 shared_libs: [
1762 "ld-android",
1763 "libdl",
1764 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001765 whole_static_libs: [
1766 "libc_common",
1767 "libjemalloc",
1768 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001769
1770 nocrt: true,
1771
Dan Willemsen208ae172015-09-16 16:33:27 -07001772 arch: {
1773 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001774 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1775 ldflags: ["-Wl,--hash-style=both"],
1776
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001777 // Don't re-export new/delete and friends, even if the compiler really wants to.
1778 version_script: "libc.arm.map",
1779
Dan Willemsen208ae172015-09-16 16:33:27 -07001780 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001781 srcs: [
1782 "arch-arm/bionic/exidx_dynamic.c",
1783
1784 // special for arm
1785 "arch-arm/bionic/atexit_legacy.c",
1786 ],
1787 // special for arm
1788 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001789 },
1790 static: {
1791 srcs: ["arch-arm/bionic/exidx_static.c"],
1792 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001793 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001794 arm64: {
1795 // Don't re-export new/delete and friends, even if the compiler really wants to.
1796 version_script: "libc.arm64.map",
1797 },
1798 mips: {
1799 // Don't re-export new/delete and friends, even if the compiler really wants to.
1800 version_script: "libc.mips.map",
1801 },
1802 mips64: {
1803 // Don't re-export new/delete and friends, even if the compiler really wants to.
1804 version_script: "libc.mips64.map",
1805 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001806 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001807 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1808 ldflags: ["-Wl,--hash-style=both"],
1809
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001810 // Don't re-export new/delete and friends, even if the compiler really wants to.
1811 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001812 },
1813 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001814 // Don't re-export new/delete and friends, even if the compiler really wants to.
1815 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001816 },
1817 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001818}
1819
Dan Willemsen208ae172015-09-16 16:33:27 -07001820// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001821// libstdc++.so + libstdc++.a
1822// ========================================================
1823cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001824 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001825 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001826 srcs: [
1827 "bionic/__cxa_guard.cpp",
1828 "bionic/__cxa_pure_virtual.cpp",
1829 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001830 ],
1831 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001832 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001833 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001834 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001835
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001836 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001837 arch: {
1838 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001839 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001840 version_script: "libstdc++.arm.map",
1841 },
1842 arm64: {
1843 version_script: "libstdc++.arm64.map",
1844 },
1845 mips: {
1846 version_script: "libstdc++.mips.map",
1847 },
1848 mips64: {
1849 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001850 },
1851 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001852 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001853 version_script: "libstdc++.x86.map",
1854 },
1855 x86_64: {
1856 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001857 },
1858 },
1859}
1860
Colin Cross50c21ab2015-10-31 23:03:05 -07001861cc_defaults {
1862 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001863 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001864 vendor_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001865 recovery_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001866
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001867 cflags: [
1868 "-Wno-gcc-compat",
1869 "-Wall",
1870 "-Werror",
1871 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001872}
1873
Colin Cross50c21ab2015-10-31 23:03:05 -07001874cc_defaults {
1875 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001876 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001877
1878 arch: {
1879 mips: {
1880 cflags: ["-fPIC"],
1881 },
1882 mips64: {
1883 cflags: ["-fPIC"],
1884 },
1885 x86: {
1886 cflags: ["-fPIC"],
1887 },
1888 x86_64: {
1889 cflags: ["-fPIC"],
1890 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001891 },
1892}
1893
Dan Willemsena3ed9012017-04-04 15:51:26 -07001894// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001895cc_object {
1896 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001897 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001898 local_include_dirs: ["include"],
1899 product_variables: {
1900 platform_sdk_version: {
1901 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1902 },
1903 },
1904 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001905
Colin Cross7d7b3682017-11-03 13:38:40 -07001906 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001907}
1908
Dan Willemsen208ae172015-09-16 16:33:27 -07001909cc_object {
1910 name: "crtbegin_so1",
1911 local_include_dirs: ["include"],
1912 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001913
Colin Cross7d7b3682017-11-03 13:38:40 -07001914 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001915}
1916
Dan Willemsen208ae172015-09-16 16:33:27 -07001917cc_object {
1918 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001919
Colin Cross7d7b3682017-11-03 13:38:40 -07001920 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001921 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001922 "crtbegin_so1",
1923 "crtbrand",
1924 ],
1925}
1926
Dan Willemsen208ae172015-09-16 16:33:27 -07001927cc_object {
1928 name: "crtend_so",
1929 local_include_dirs: ["include"],
1930 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001931
Colin Cross7d7b3682017-11-03 13:38:40 -07001932 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001933}
1934
Dan Willemsen208ae172015-09-16 16:33:27 -07001935cc_object {
1936 name: "crtbegin_static1",
1937 local_include_dirs: ["include"],
1938 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001939
Colin Cross50c21ab2015-10-31 23:03:05 -07001940 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001941 mips: {
1942 srcs: [
1943 "arch-mips/bionic/crtbegin.c",
1944 ],
1945 exclude_srcs: [
1946 "arch-common/bionic/crtbegin.c",
1947 ],
1948 },
1949 mips64: {
1950 srcs: [
1951 "arch-mips64/bionic/crtbegin.c",
1952 ],
1953 exclude_srcs: [
1954 "arch-common/bionic/crtbegin.c",
1955 ],
1956 },
1957 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001958
1959 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001960}
1961
Dan Willemsen208ae172015-09-16 16:33:27 -07001962cc_object {
1963 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001964
Colin Cross77d57bf2016-04-11 14:34:18 -07001965 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001966 "crtbegin_static1",
1967 "crtbrand",
1968 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001969 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001970}
1971
Dan Willemsen208ae172015-09-16 16:33:27 -07001972cc_object {
1973 name: "crtbegin_dynamic1",
1974 local_include_dirs: ["include"],
1975 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001976
Colin Cross50c21ab2015-10-31 23:03:05 -07001977 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001978 mips: {
1979 srcs: [
1980 "arch-mips/bionic/crtbegin.c",
1981 ],
1982 exclude_srcs: [
1983 "arch-common/bionic/crtbegin.c",
1984 ],
1985 },
1986 mips64: {
1987 srcs: [
1988 "arch-mips64/bionic/crtbegin.c",
1989 ],
1990 exclude_srcs: [
1991 "arch-common/bionic/crtbegin.c",
1992 ],
1993 },
1994 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001995 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001996}
1997
Dan Willemsen208ae172015-09-16 16:33:27 -07001998cc_object {
1999 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07002000
Colin Cross77d57bf2016-04-11 14:34:18 -07002001 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002002 "crtbegin_dynamic1",
2003 "crtbrand",
2004 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002005 target: {
2006 linux_bionic: {
2007 generated_sources: ["host_bionic_linker_asm"],
2008 objs: [
2009 "linker_wrapper",
2010 ],
2011 },
2012 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002013 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002014}
2015
Dan Willemsen208ae172015-09-16 16:33:27 -07002016cc_object {
2017 // We rename crtend.o to crtend_android.o to avoid a
2018 // name clash between gcc and bionic.
2019 name: "crtend_android",
2020 local_include_dirs: ["include"],
2021 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002022
Colin Cross50c21ab2015-10-31 23:03:05 -07002023 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002024}
Colin Crossbaa48992016-07-13 11:15:21 -07002025
Dan Albert22805ea2017-03-22 15:28:05 -07002026preprocessed_ndk_headers {
2027 name: "common_libc",
2028 from: "include",
2029 to: "",
2030 license: "NOTICE",
2031}
Dan Albert4238a352016-06-28 11:18:05 -07002032
2033ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002034 name: "libc_uapi",
2035 from: "kernel/uapi",
2036 to: "",
2037 srcs: [
2038 "kernel/uapi/asm-generic/**/*.h",
2039 "kernel/uapi/drm/**/*.h",
2040 "kernel/uapi/linux/**/*.h",
2041 "kernel/uapi/misc/**/*.h",
2042 "kernel/uapi/mtd/**/*.h",
2043 "kernel/uapi/rdma/**/*.h",
2044 "kernel/uapi/scsi/**/*.h",
2045 "kernel/uapi/sound/**/*.h",
2046 "kernel/uapi/video/**/*.h",
2047 "kernel/uapi/xen/**/*.h",
2048 ],
Dan Albert92592652016-10-20 01:42:54 -07002049 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002050}
2051
2052ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002053 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002054 from: "kernel/android/uapi/linux",
2055 to: "linux",
2056 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002057 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002058}
2059
2060ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002061 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002062 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002063 to: "scsi",
2064 srcs: ["kernel/android/scsi/**/*.h"],
2065 license: "NOTICE",
2066}
2067
2068ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002069 name: "libc_asm_arm",
2070 from: "kernel/uapi/asm-arm",
2071 to: "arm-linux-androideabi",
2072 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002073 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002074}
2075
2076ndk_headers {
2077 name: "libc_asm_arm64",
2078 from: "kernel/uapi/asm-arm64",
2079 to: "aarch64-linux-android",
2080 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002081 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002082}
2083
Elliott Hughesee291c02017-12-11 11:32:34 -08002084// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002085ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002086 name: "libc_asm_mips",
2087 from: "kernel/uapi/asm-mips",
2088 to: "mipsel-linux-android",
2089 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2090 license: "NOTICE",
2091}
2092
Elliott Hughesee291c02017-12-11 11:32:34 -08002093// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002094ndk_headers {
2095 name: "libc_asm_mips64",
2096 from: "kernel/uapi/asm-mips",
2097 to: "mips64el-linux-android",
2098 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2099 license: "NOTICE",
2100}
2101
2102ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002103 name: "libc_asm_x86",
2104 from: "kernel/uapi/asm-x86",
2105 to: "i686-linux-android",
2106 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002107 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002108}
2109
2110ndk_headers {
2111 name: "libc_asm_x86_64",
2112 from: "kernel/uapi/asm-x86",
2113 to: "x86_64-linux-android",
2114 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002115 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002116}
2117
Dan Albert4238a352016-06-28 11:18:05 -07002118ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002119 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002120 symbol_file: "libc.map.txt",
2121 first_version: "9",
2122}
2123
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002124llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002125 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002126 symbol_file: "libc.map.txt",
2127 export_headers_as_system: true,
2128 export_preprocessed_headers: ["include"],
2129 arch: {
2130 arm: {
2131 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002132 "kernel/uapi",
2133 "kernel/uapi/asm-arm",
2134 "kernel/android/uapi",
2135 ],
2136 },
2137 arm64: {
2138 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002139 "kernel/uapi",
2140 "kernel/uapi/asm-arm64",
2141 "kernel/android/uapi",
2142 ],
2143 },
2144 mips: {
2145 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002146 "kernel/uapi",
2147 "kernel/uapi/asm-mips",
2148 "kernel/android/uapi",
2149 ],
2150 },
2151 mips64: {
2152 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002153 "kernel/uapi",
2154 "kernel/uapi/asm-mips",
2155 "kernel/android/uapi",
2156 ],
2157 },
2158 x86: {
2159 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002160 "kernel/uapi",
2161 "kernel/uapi/asm-x86",
2162 "kernel/android/uapi",
2163 ],
2164 },
2165 x86_64: {
2166 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002167 "kernel/uapi",
2168 "kernel/uapi/asm-x86",
2169 "kernel/android/uapi",
2170 ],
2171 },
2172 },
2173}
2174
Dan Albertdf31aff2016-10-06 15:50:41 -07002175ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002176 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002177 symbol_file: "libstdc++.map.txt",
2178 first_version: "9",
2179}
2180
Dan Willemsenca056d72018-01-08 14:00:24 -08002181// Export these headers for toolbox to process
2182filegroup {
2183 name: "kernel_input_headers",
2184 srcs: [
2185 "kernel/uapi/linux/input.h",
2186 "kernel/uapi/linux/input-event-codes.h",
2187 ],
2188}