blob: 42b6cf789f2a314c650b95d4c528a0a69be963eb [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: {
Ryan Prichard27475b52018-05-17 17:14:18 -0700105 srcs: [
106 "arch-x86/bionic/__libc_init_sysinfo.cpp",
107 "arch-x86/bionic/__set_tls.cpp",
108 ],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800109 },
110 x86_64: {
111 srcs: ["arch-x86_64/bionic/__set_tls.c"],
112 },
113 },
114
Colin Cross50c21ab2015-10-31 23:03:05 -0700115 defaults: ["libc_defaults"],
116 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700117 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700118}
119
Colin Crossa3f9fca2016-01-11 13:20:55 -0800120// libc_init_static.cpp also needs to be built without stack protector,
121// because it's responsible for setting up TLS for static executables.
122// This isn't the case for dynamic executables because the dynamic linker
123// has already set up the main thread's TLS.
124
125cc_library_static {
126 name: "libc_init_static",
127 defaults: ["libc_defaults"],
128 srcs: ["bionic/libc_init_static.cpp"],
129 cflags: ["-fno-stack-protector"],
130}
131
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700132cc_library_static {
133 name: "libc_init_dynamic",
134 defaults: ["libc_defaults"],
135 srcs: ["bionic/libc_init_dynamic.cpp"],
136 cflags: ["-fno-stack-protector"],
137}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800138
Dan Willemsen208ae172015-09-16 16:33:27 -0700139// ========================================================
140// libc_tzcode.a - upstream 'tzcode' code
141// ========================================================
142
143cc_library_static {
144
Colin Cross50c21ab2015-10-31 23:03:05 -0700145 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700146 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800147 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700148 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700149 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
150 ],
151
Colin Cross50c21ab2015-10-31 23:03:05 -0700152 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700153 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700154 // Don't use ridiculous amounts of stack.
155 "-DALL_STATE",
156 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
157 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800158 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700159 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700160 // The name of the tm_gmtoff field in our struct tm.
161 "-DTM_GMTOFF=tm_gmtoff",
162 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700163 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700164 // Include `tzname`, `timezone`, and `daylight` globals.
165 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700166 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800167 // Use the empty string (instead of " ") as the timezone abbreviation
168 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700169 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700170 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
171 "-Dlint",
172 ],
173
Dan Willemsen208ae172015-09-16 16:33:27 -0700174 local_include_dirs: ["tzcode/"],
175 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700176}
177
178// ========================================================
179// libc_dns.a - modified NetBSD DNS code
180// ========================================================
181
182cc_library_static {
183
Colin Cross50c21ab2015-10-31 23:03:05 -0700184 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700185 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800186 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700187
188 "upstream-netbsd/lib/libc/isc/ev_streams.c",
189 "upstream-netbsd/lib/libc/isc/ev_timers.c",
190 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700191 ],
192
Colin Cross50c21ab2015-10-31 23:03:05 -0700193 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700194 "-DANDROID_CHANGES",
195 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700196 "-Wno-unused-parameter",
197 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700198 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700199 ],
200
Dan Willemsen208ae172015-09-16 16:33:27 -0700201 local_include_dirs: [
202 "dns/include",
203 "private",
204 "upstream-netbsd/lib/libc/include",
205 "upstream-netbsd/android/include",
206 ],
207
208 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700209}
210
211// ========================================================
212// libc_freebsd.a - upstream FreeBSD C library code
213// ========================================================
214//
215// These files are built with the freebsd-compat.h header file
216// automatically included.
217
218cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700219 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700220 srcs: [
221 "upstream-freebsd/lib/libc/gen/ldexp.c",
222 "upstream-freebsd/lib/libc/gen/sleep.c",
223 "upstream-freebsd/lib/libc/gen/usleep.c",
224 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700225 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
226 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
227 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
228 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700229 "upstream-freebsd/lib/libc/stdlib/qsort.c",
230 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700231 "upstream-freebsd/lib/libc/string/wcpcpy.c",
232 "upstream-freebsd/lib/libc/string/wcpncpy.c",
233 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700234 "upstream-freebsd/lib/libc/string/wcscat.c",
235 "upstream-freebsd/lib/libc/string/wcschr.c",
236 "upstream-freebsd/lib/libc/string/wcscmp.c",
237 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 "upstream-freebsd/lib/libc/string/wcscspn.c",
239 "upstream-freebsd/lib/libc/string/wcsdup.c",
240 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700241 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700242 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
243 "upstream-freebsd/lib/libc/string/wcsncat.c",
244 "upstream-freebsd/lib/libc/string/wcsncmp.c",
245 "upstream-freebsd/lib/libc/string/wcsncpy.c",
246 "upstream-freebsd/lib/libc/string/wcsnlen.c",
247 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700248 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700249 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700250 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 "upstream-freebsd/lib/libc/string/wcstok.c",
252 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700253 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700254 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700255 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800256 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700257 ],
258 arch: {
259 arm64: {
260 exclude_srcs: [
261 "upstream-freebsd/lib/libc/string/wmemmove.c",
262 ],
263 },
264 x86: {
265 exclude_srcs: [
266 "upstream-freebsd/lib/libc/string/wcschr.c",
267 "upstream-freebsd/lib/libc/string/wcscmp.c",
268 "upstream-freebsd/lib/libc/string/wcslen.c",
269 "upstream-freebsd/lib/libc/string/wcsrchr.c",
270 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800271 atom: {
272 exclude_srcs: [
273 "upstream-freebsd/lib/libc/string/wmemcmp.c",
274 ],
275 },
276 ssse3: {
277 exclude_srcs: [
278 "upstream-freebsd/lib/libc/string/wcscat.c",
279 "upstream-freebsd/lib/libc/string/wcscpy.c",
280 ],
281 },
282 sse4: {
283 exclude_srcs: [
284 "upstream-freebsd/lib/libc/string/wmemcmp.c",
285 ],
286 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700287 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700288 },
289
Colin Cross50c21ab2015-10-31 23:03:05 -0700290 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700291 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700292 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700293 "-include freebsd-compat.h",
294 ],
295
Dan Willemsen208ae172015-09-16 16:33:27 -0700296 local_include_dirs: [
297 "upstream-freebsd/android/include",
298 ],
299
300 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700301}
302
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700303cc_library_static {
304 defaults: ["libc_defaults"],
305 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700306 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700307 "upstream-freebsd/lib/libc/stdlib/realpath.c",
308 ],
309
310 cflags: [
311 "-Wno-sign-compare",
312 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700313 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700314 ],
315
316 local_include_dirs: [
317 "upstream-freebsd/android/include",
318 ],
319
320 name: "libc_freebsd_large_stack",
321}
322
Dan Willemsen208ae172015-09-16 16:33:27 -0700323// ========================================================
324// libc_netbsd.a - upstream NetBSD C library code
325// ========================================================
326//
327// These files are built with the netbsd-compat.h header file
328// automatically included.
329
330cc_library_static {
331
Colin Cross50c21ab2015-10-31 23:03:05 -0700332 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700333 srcs: [
334 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700335 "upstream-netbsd/lib/libc/gen/nice.c",
336 "upstream-netbsd/lib/libc/gen/popen.c",
337 "upstream-netbsd/lib/libc/gen/psignal.c",
338 "upstream-netbsd/lib/libc/gen/utime.c",
339 "upstream-netbsd/lib/libc/gen/utmp.c",
340 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
341 "upstream-netbsd/lib/libc/regex/regcomp.c",
342 "upstream-netbsd/lib/libc/regex/regerror.c",
343 "upstream-netbsd/lib/libc/regex/regexec.c",
344 "upstream-netbsd/lib/libc/regex/regfree.c",
345 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
346 "upstream-netbsd/lib/libc/stdlib/div.c",
347 "upstream-netbsd/lib/libc/stdlib/drand48.c",
348 "upstream-netbsd/lib/libc/stdlib/erand48.c",
349 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
350 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
351 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
352 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
353 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
354 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
355 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
356 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
357 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
358 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
359 "upstream-netbsd/lib/libc/stdlib/seed48.c",
360 "upstream-netbsd/lib/libc/stdlib/srand48.c",
361 "upstream-netbsd/lib/libc/string/memccpy.c",
362 "upstream-netbsd/lib/libc/string/strcasestr.c",
363 "upstream-netbsd/lib/libc/string/strcoll.c",
364 "upstream-netbsd/lib/libc/string/strxfrm.c",
365 ],
366 multilib: {
367 lib32: {
368 // LP32 cruft
369 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
370 },
371 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700372 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700373 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800374 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700375 "-DPOSIX_MISTAKE",
376 "-include netbsd-compat.h",
377 ],
378
Dan Willemsen208ae172015-09-16 16:33:27 -0700379 local_include_dirs: [
380 "upstream-netbsd/android/include",
381 "upstream-netbsd/lib/libc/include",
382 ],
383
384 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700385}
386
387// ========================================================
388// libc_openbsd_ndk.a - upstream OpenBSD C library code
389// that can be safely included in the libc_ndk.a (doesn't
390// contain any troublesome global data or constructors).
391// ========================================================
392//
393// These files are built with the openbsd-compat.h header file
394// automatically included.
395
396cc_library_static {
397 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700398 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700399 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700400 "upstream-openbsd/lib/libc/gen/alarm.c",
401 "upstream-openbsd/lib/libc/gen/ctype_.c",
402 "upstream-openbsd/lib/libc/gen/daemon.c",
403 "upstream-openbsd/lib/libc/gen/err.c",
404 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700405 "upstream-openbsd/lib/libc/gen/fnmatch.c",
406 "upstream-openbsd/lib/libc/gen/ftok.c",
407 "upstream-openbsd/lib/libc/gen/getprogname.c",
408 "upstream-openbsd/lib/libc/gen/isctype.c",
409 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700410 "upstream-openbsd/lib/libc/gen/tolower_.c",
411 "upstream-openbsd/lib/libc/gen/toupper_.c",
412 "upstream-openbsd/lib/libc/gen/verr.c",
413 "upstream-openbsd/lib/libc/gen/verrx.c",
414 "upstream-openbsd/lib/libc/gen/vwarn.c",
415 "upstream-openbsd/lib/libc/gen/vwarnx.c",
416 "upstream-openbsd/lib/libc/gen/warn.c",
417 "upstream-openbsd/lib/libc/gen/warnx.c",
418 "upstream-openbsd/lib/libc/locale/btowc.c",
419 "upstream-openbsd/lib/libc/locale/mbrlen.c",
420 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
421 "upstream-openbsd/lib/libc/locale/mbtowc.c",
422 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700423 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
424 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700425 "upstream-openbsd/lib/libc/locale/wcstoll.c",
426 "upstream-openbsd/lib/libc/locale/wcstombs.c",
427 "upstream-openbsd/lib/libc/locale/wcstoul.c",
428 "upstream-openbsd/lib/libc/locale/wcstoull.c",
429 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
430 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
431 "upstream-openbsd/lib/libc/locale/wctob.c",
432 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700433 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700434 "upstream-openbsd/lib/libc/net/htonl.c",
435 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700436 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
437 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
438 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700439 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
440 "upstream-openbsd/lib/libc/net/inet_ntop.c",
441 "upstream-openbsd/lib/libc/net/inet_pton.c",
442 "upstream-openbsd/lib/libc/net/ntohl.c",
443 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800444 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700445 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
447 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700448 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700449 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700450 "upstream-openbsd/lib/libc/stdio/fputwc.c",
451 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700452 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
453 "upstream-openbsd/lib/libc/stdio/fwalk.c",
454 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700456 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700457 "upstream-openbsd/lib/libc/stdio/makebuf.c",
458 "upstream-openbsd/lib/libc/stdio/mktemp.c",
459 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
460 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700461 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700462 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700463 "upstream-openbsd/lib/libc/stdio/tempnam.c",
464 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
465 "upstream-openbsd/lib/libc/stdio/ungetc.c",
466 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
467 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
468 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700469 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
470 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
471 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700472 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700473 "upstream-openbsd/lib/libc/stdio/wsetup.c",
474 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700475 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700476 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700477 "upstream-openbsd/lib/libc/stdlib/insque.c",
478 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
479 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
480 "upstream-openbsd/lib/libc/stdlib/labs.c",
481 "upstream-openbsd/lib/libc/stdlib/llabs.c",
482 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
483 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
484 "upstream-openbsd/lib/libc/stdlib/remque.c",
485 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700486 "upstream-openbsd/lib/libc/stdlib/tfind.c",
487 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
488 "upstream-openbsd/lib/libc/string/strcasecmp.c",
489 "upstream-openbsd/lib/libc/string/strcspn.c",
490 "upstream-openbsd/lib/libc/string/strdup.c",
491 "upstream-openbsd/lib/libc/string/strndup.c",
492 "upstream-openbsd/lib/libc/string/strpbrk.c",
493 "upstream-openbsd/lib/libc/string/strsep.c",
494 "upstream-openbsd/lib/libc/string/strspn.c",
495 "upstream-openbsd/lib/libc/string/strstr.c",
496 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700497 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700498 "upstream-openbsd/lib/libc/string/wcswidth.c",
499 ],
500
Colin Cross50c21ab2015-10-31 23:03:05 -0700501 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700502 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700503 "-Wno-unused-parameter",
504 "-include openbsd-compat.h",
505 ],
506
Dan Willemsen208ae172015-09-16 16:33:27 -0700507 local_include_dirs: [
508 "private",
509 "stdio",
510 "upstream-openbsd/android/include",
511 "upstream-openbsd/lib/libc/include",
512 "upstream-openbsd/lib/libc/gdtoa/",
513 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700514}
515
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700516cc_library_static {
517 name: "libc_openbsd_large_stack",
518 defaults: ["libc_defaults"],
519 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700520 "stdio/vfprintf.cpp",
521 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700522 ],
523 cflags: [
524 "-include openbsd-compat.h",
525 "-Wno-sign-compare",
526 "-Wframe-larger-than=5000",
527 ],
528
529 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700530 "upstream-openbsd/android/include/",
531 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700532 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700533 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700534 ],
535}
536
Dan Willemsen208ae172015-09-16 16:33:27 -0700537// ========================================================
538// libc_openbsd.a - upstream OpenBSD C library code
539// ========================================================
540//
541// These files are built with the openbsd-compat.h header file
542// automatically included.
543cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700544 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700545 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800546 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700547 "upstream-openbsd/lib/libc/crypt/arc4random.c",
548 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
549
550 // May be overriden by per-arch optimized versions
551 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700552 "upstream-openbsd/lib/libc/string/memrchr.c",
553 "upstream-openbsd/lib/libc/string/stpcpy.c",
554 "upstream-openbsd/lib/libc/string/stpncpy.c",
555 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700556 "upstream-openbsd/lib/libc/string/strcpy.c",
557 "upstream-openbsd/lib/libc/string/strlcat.c",
558 "upstream-openbsd/lib/libc/string/strlcpy.c",
559 "upstream-openbsd/lib/libc/string/strncat.c",
560 "upstream-openbsd/lib/libc/string/strncmp.c",
561 "upstream-openbsd/lib/libc/string/strncpy.c",
562 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700563
564 arch: {
565 arm: {
566 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700567 "upstream-openbsd/lib/libc/string/strcpy.c",
568 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800569 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700570 exclude_srcs: [
Christopher Ferris950a9582017-03-29 13:10:56 -0700571 "upstream-openbsd/lib/libc/string/stpcpy.c",
572 "upstream-openbsd/lib/libc/string/strcat.c",
573 ],
574 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700575 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700576 arm64: {
577 exclude_srcs: [
578 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700579 "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",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530587 "upstream-openbsd/lib/libc/string/strcpy.c",
588 "upstream-openbsd/lib/libc/string/strncmp.c",
589 ],
590 },
591 mips64: {
592 exclude_srcs: [
593 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530594 "upstream-openbsd/lib/libc/string/strcpy.c",
595 "upstream-openbsd/lib/libc/string/strncmp.c",
596 ],
597 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700598 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800599 exclude_srcs: [
600 "upstream-openbsd/lib/libc/string/memchr.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800601 "upstream-openbsd/lib/libc/string/memrchr.c",
602 "upstream-openbsd/lib/libc/string/stpcpy.c",
603 "upstream-openbsd/lib/libc/string/stpncpy.c",
604 "upstream-openbsd/lib/libc/string/strcat.c",
605 "upstream-openbsd/lib/libc/string/strcpy.c",
606 "upstream-openbsd/lib/libc/string/strncmp.c",
607 "upstream-openbsd/lib/libc/string/strncpy.c",
608 ],
609 ssse3: {
610 exclude_srcs: [
611 "upstream-openbsd/lib/libc/string/strlcat.c",
612 "upstream-openbsd/lib/libc/string/strlcpy.c",
613 "upstream-openbsd/lib/libc/string/strncat.c",
614 ],
615 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700616 },
617
618 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800619 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800620 "upstream-openbsd/lib/libc/string/stpcpy.c",
621 "upstream-openbsd/lib/libc/string/stpncpy.c",
622 "upstream-openbsd/lib/libc/string/strcat.c",
623 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800624 "upstream-openbsd/lib/libc/string/strncat.c",
625 "upstream-openbsd/lib/libc/string/strncmp.c",
626 "upstream-openbsd/lib/libc/string/strncpy.c",
627 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700628 },
629 },
630
Colin Cross50c21ab2015-10-31 23:03:05 -0700631 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700632 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700633 "-Wno-unused-parameter",
634 "-include openbsd-compat.h",
635 ],
636
Dan Willemsen208ae172015-09-16 16:33:27 -0700637 local_include_dirs: [
638 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700639 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700640 ],
641
642 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700643}
644
645// ========================================================
646// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
647// ========================================================
648//
649// These files are built with the openbsd-compat.h header file
650// automatically included.
651
652cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700653 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700654 srcs: [
655 "upstream-openbsd/android/gdtoa_support.cpp",
656 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
657 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
658 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
659 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
660 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
661 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
662 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
663 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
664 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
665 "upstream-openbsd/lib/libc/gdtoa/misc.c",
666 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
667 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
668 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
669 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
670 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
671 "upstream-openbsd/lib/libc/gdtoa/sum.c",
672 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
673 ],
674 multilib: {
675 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800676 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700677 },
678 },
679
Colin Cross50c21ab2015-10-31 23:03:05 -0700680 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700681 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700682 "-include openbsd-compat.h",
683 ],
684
Dan Willemsen208ae172015-09-16 16:33:27 -0700685 local_include_dirs: [
686 "private",
687 "upstream-openbsd/android/include",
688 "upstream-openbsd/lib/libc/include",
689 ],
690
691 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700692}
693
694// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700695// libc_fortify.a - container for our FORITFY
696// implementation details
697// ========================================================
698cc_library_static {
699 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700700 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700701
702 name: "libc_fortify",
703
704 // Disable FORTIFY for the compilation of these, so we don't end up having
705 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800706 cflags: [
707 "-U_FORTIFY_SOURCE",
708 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
709 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700710
711 arch: {
712 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700713 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700714 srcs: [
715 "arch-arm/generic/bionic/__memcpy_chk.S",
716 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800717 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800718 cflags: [
719 "-DNO___STRCAT_CHK",
720 "-DNO___STRCPY_CHK",
721 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700722 srcs: [
723 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
724 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
725 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700726 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800727 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700728 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800729 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
730 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
731 ],
732 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700733 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
734 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
735 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700736 },
737 cortex_a9: {
738 srcs: [
739 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
740 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
741 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800742 exclude_srcs: [
743 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
744 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
745 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700746 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800747 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700748 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800749 "arch-arm/krait/bionic/__strcat_chk.S",
750 "arch-arm/krait/bionic/__strcpy_chk.S",
751 ],
752 exclude_srcs: [
753 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
754 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
755 ],
756 },
757 cortex_a53: {
758 srcs: [
759 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
760 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
761 ],
762 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700763 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
764 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
765 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700766 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700767 cortex_a55: {
768 srcs: [
769 "arch-arm/denver/bionic/__strcat_chk.S",
770 "arch-arm/denver/bionic/__strcpy_chk.S",
771 ],
772 exclude_srcs: [
773 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
774 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
775 ],
776 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700777 cortex_a73: {
778 srcs: [
779 "arch-arm/denver/bionic/__strcat_chk.S",
780 "arch-arm/denver/bionic/__strcpy_chk.S",
781 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800782 exclude_srcs: [
783 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
784 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
785 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700786 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700787 cortex_a75: {
788 srcs: [
789 "arch-arm/denver/bionic/__strcat_chk.S",
790 "arch-arm/denver/bionic/__strcpy_chk.S",
791 ],
792 exclude_srcs: [
793 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
794 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
795 ],
796 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700797 denver: {
798 srcs: [
799 "arch-arm/denver/bionic/__strcat_chk.S",
800 "arch-arm/denver/bionic/__strcpy_chk.S",
801 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800802 exclude_srcs: [
803 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
804 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
805 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700806 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800807 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700808 srcs: [
809 "arch-arm/krait/bionic/__strcat_chk.S",
810 "arch-arm/krait/bionic/__strcpy_chk.S",
811 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800812 exclude_srcs: [
813 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
814 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700815 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700816 },
817 },
818 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700819 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700820 srcs: [
821 "arch-arm64/generic/bionic/__memcpy_chk.S",
822 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700823 },
824 },
825}
826
827// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700828// libc_bionic.a - home-grown C library code
829// ========================================================
830
831cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700832 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700833 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700834 // The data that backs getauxval is initialized in the libc init
835 // functions which are invoked by the linker. If this file is included
836 // in libc_ndk.a, only one of the copies of the global data will be
837 // initialized, resulting in nullptr dereferences.
838 "bionic/getauxval.cpp",
839
Elliott Hughes211c4d32018-02-02 15:10:32 -0800840 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700841 "bionic/sysconf.cpp",
842 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700843 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700844
Josh Gao10ec9282017-04-03 15:13:29 -0700845 // The following must not be statically linked into libc_ndk.a, because
846 // debuggerd will look for the abort message in libc.so's copy.
847 "bionic/android_set_abort_message.cpp",
848
Dan Willemsen208ae172015-09-16 16:33:27 -0700849 "bionic/strchr.cpp",
850 "bionic/strnlen.c",
851 "bionic/strrchr.cpp",
852 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700853
854 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700855 arm: {
856 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800857 "arch-arm/generic/bionic/memcmp.S",
858 "arch-arm/generic/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700859 "arch-arm/generic/bionic/memmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800860 "arch-arm/generic/bionic/memset.S",
861 "arch-arm/generic/bionic/strcmp.S",
862 "arch-arm/generic/bionic/strcpy.S",
863 "arch-arm/generic/bionic/strlen.c",
864
Dan Willemsen208ae172015-09-16 16:33:27 -0700865 "arch-arm/bionic/atomics_arm.c",
866 "arch-arm/bionic/__bionic_clone.S",
867 "arch-arm/bionic/_exit_with_stack_teardown.S",
868 "arch-arm/bionic/libgcc_compat.c",
869 "arch-arm/bionic/popcount_tab.c",
870 "arch-arm/bionic/__restore.S",
871 "arch-arm/bionic/setjmp.S",
872 "arch-arm/bionic/syscall.S",
873 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700874 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800875 cortex_a7: {
876 srcs: [
Christopher Ferrisecebb492016-11-28 11:09:49 -0800877 "arch-arm/cortex-a7/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700878 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800879 ],
880 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800881 "arch-arm/cortex-a15/bionic/memcpy.S",
882 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800883 ],
884 },
885 cortex_a9: {
886 srcs: [
887 "arch-arm/cortex-a9/bionic/memcpy.S",
888 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800889
Colin Cross6ab8f892015-11-23 14:12:15 -0800890 "arch-arm/cortex-a9/bionic/stpcpy.S",
891 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800892 "arch-arm/cortex-a9/bionic/strcmp.S",
893 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800894 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800895 ],
896 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800897 "arch-arm/cortex-a15/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700898 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800899
Colin Cross6ab8f892015-11-23 14:12:15 -0800900 "arch-arm/cortex-a15/bionic/stpcpy.S",
901 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800902 "arch-arm/cortex-a15/bionic/strcmp.S",
903 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800904 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800905 ],
906 },
907 krait: {
908 srcs: [
909 "arch-arm/krait/bionic/memcpy.S",
910 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800911
Colin Cross6ab8f892015-11-23 14:12:15 -0800912 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800913 ],
914 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800915 "arch-arm/cortex-a15/bionic/memset.S",
916 "arch-arm/cortex-a15/bionic/memcpy.S",
917
918 "arch-arm/cortex-a15/bionic/strcmp.S",
919 ],
920 },
921 cortex_a53: {
922 srcs: [
923 "arch-arm/cortex-a53/bionic/memcpy.S",
924 "arch-arm/cortex-a7/bionic/memset.S",
925 ],
926 exclude_srcs: [
927 "arch-arm/cortex-a15/bionic/memset.S",
928 "arch-arm/cortex-a15/bionic/memcpy.S",
929 ],
930 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700931 cortex_a55: {
932 srcs: [
933 "arch-arm/cortex-a7/bionic/memset.S",
934 "arch-arm/denver/bionic/memcpy.S",
935
936 "arch-arm/krait/bionic/strcmp.S",
937 ],
938 exclude_srcs: [
939 "arch-arm/cortex-a15/bionic/memset.S",
940 "arch-arm/cortex-a15/bionic/memcpy.S",
941 "arch-arm/cortex-a15/bionic/strcmp.S",
942 ],
943 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800944 cortex_a73: {
945 srcs: [
946 "arch-arm/cortex-a7/bionic/memset.S",
947 "arch-arm/denver/bionic/memcpy.S",
948
949 "arch-arm/krait/bionic/strcmp.S",
950 ],
951 exclude_srcs: [
952 "arch-arm/cortex-a15/bionic/memset.S",
953 "arch-arm/cortex-a15/bionic/memcpy.S",
954 "arch-arm/cortex-a15/bionic/strcmp.S",
955 ],
956 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700957 cortex_a75: {
958 srcs: [
959 "arch-arm/cortex-a7/bionic/memset.S",
960 "arch-arm/denver/bionic/memcpy.S",
961
962 "arch-arm/krait/bionic/strcmp.S",
963 ],
964 exclude_srcs: [
965 "arch-arm/cortex-a15/bionic/memset.S",
966 "arch-arm/cortex-a15/bionic/memcpy.S",
967 "arch-arm/cortex-a15/bionic/strcmp.S",
968 ],
969 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800970 denver: {
971 srcs: [
972 "arch-arm/denver/bionic/memcpy.S",
973 "arch-arm/denver/bionic/memset.S",
974 ],
975 exclude_srcs: [
976 "arch-arm/cortex-a15/bionic/memset.S",
977 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800978 ],
979 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700980 kryo: {
981 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400982 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400983 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800984
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800985 "arch-arm/krait/bionic/strcmp.S",
986 ],
987 exclude_srcs: [
988 "arch-arm/cortex-a15/bionic/memset.S",
989 "arch-arm/cortex-a15/bionic/memcpy.S",
990 "arch-arm/cortex-a15/bionic/strcmp.S",
991 ],
992 },
993 // Cores not listed above (like cortex-a8, cortex-a15) or
994 // "generic" core will use the following implementation.
995 neon: {
996 srcs: [
997 "arch-arm/cortex-a15/bionic/memcpy.S",
998 "arch-arm/cortex-a15/bionic/memset.S",
999
Christopher Ferris950a9582017-03-29 13:10:56 -07001000 "arch-arm/cortex-a15/bionic/stpcpy.S",
1001 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001002 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -07001003 "arch-arm/cortex-a15/bionic/strcpy.S",
1004 "arch-arm/cortex-a15/bionic/strlen.S",
1005
1006 "arch-arm/denver/bionic/memmove.S",
1007 ],
1008 exclude_srcs: [
1009 "arch-arm/generic/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -07001010 "arch-arm/generic/bionic/memmove.S",
Christopher Ferris950a9582017-03-29 13:10:56 -07001011 "arch-arm/generic/bionic/memset.S",
1012 "arch-arm/generic/bionic/strcmp.S",
1013 "arch-arm/generic/bionic/strcpy.S",
1014 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -07001015 ],
1016 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001017 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001018 arm64: {
1019 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001020 "arch-arm64/generic/bionic/memchr.S",
1021 "arch-arm64/generic/bionic/memcmp.S",
1022 "arch-arm64/generic/bionic/memcpy.S",
1023 "arch-arm64/generic/bionic/memmove.S",
1024 "arch-arm64/generic/bionic/memset.S",
1025 "arch-arm64/generic/bionic/stpcpy.S",
1026 "arch-arm64/generic/bionic/strchr.S",
1027 "arch-arm64/generic/bionic/strcmp.S",
1028 "arch-arm64/generic/bionic/strcpy.S",
1029 "arch-arm64/generic/bionic/strlen.S",
1030 "arch-arm64/generic/bionic/strncmp.S",
1031 "arch-arm64/generic/bionic/strnlen.S",
1032 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001033
1034 "arch-arm64/bionic/__bionic_clone.S",
1035 "arch-arm64/bionic/_exit_with_stack_teardown.S",
1036 "arch-arm64/bionic/setjmp.S",
1037 "arch-arm64/bionic/syscall.S",
1038 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001039 ],
1040 exclude_srcs: [
1041 "bionic/__memcpy_chk.cpp",
1042 "bionic/strchr.cpp",
1043 "bionic/strnlen.c",
1044 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001045 denver64: {
1046 srcs: [
1047 "arch-arm64/denver64/bionic/memcpy.S",
1048 "arch-arm64/denver64/bionic/memset.S",
1049 ],
1050 exclude_srcs: [
1051 "arch-arm64/generic/bionic/memcpy.S",
1052 "arch-arm64/generic/bionic/memset.S",
1053 ],
1054 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001055 cortex_a53: {
1056 srcs: [
1057 "arch-arm64/cortex-a53/bionic/memmove.S",
1058 ],
1059 exclude_srcs: [
1060 "arch-arm64/generic/bionic/memmove.S",
1061 ],
1062 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -07001063 cortex_a55: {
1064 srcs: [
1065 "arch-arm64/cortex-a53/bionic/memmove.S",
1066 ],
1067 exclude_srcs: [
1068 "arch-arm64/generic/bionic/memmove.S",
1069 ],
1070 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001071 cortex_a73: {
1072 srcs: [
1073 "arch-arm64/cortex-a53/bionic/memmove.S",
1074 ],
1075 exclude_srcs: [
1076 "arch-arm64/generic/bionic/memmove.S",
1077 ],
1078 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -07001079 cortex_a75: {
1080 srcs: [
1081 "arch-arm64/cortex-a53/bionic/memmove.S",
1082 ],
1083 exclude_srcs: [
1084 "arch-arm64/generic/bionic/memmove.S",
1085 ],
1086 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001087 },
1088
1089 mips: {
1090 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001091 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301092 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001093 "arch-mips/string/memset.S",
1094 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301095 "arch-mips/string/strncmp.S",
1096 "arch-mips/string/strlen.c",
1097 "arch-mips/string/strnlen.c",
1098 "arch-mips/string/strchr.c",
1099 "arch-mips/string/strcpy.c",
1100 "arch-mips/string/memchr.c",
1101 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001102
Dan Willemsen208ae172015-09-16 16:33:27 -07001103 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001104 "arch-mips/bionic/cacheflush.cpp",
1105 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001106 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001107 "arch-mips/bionic/setjmp.S",
1108 "arch-mips/bionic/syscall.S",
1109 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001110 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301111 exclude_srcs: [
1112 "bionic/strchr.cpp",
1113 "bionic/strnlen.c",
1114 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001115 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001116 mips64: {
1117 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001118 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301119 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001120 "arch-mips/string/memset.S",
1121 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301122 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001123 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301124 "arch-mips/string/strnlen.c",
1125 "arch-mips/string/strchr.c",
1126 "arch-mips/string/strcpy.c",
1127 "arch-mips/string/memchr.c",
1128 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001129
Dan Willemsen208ae172015-09-16 16:33:27 -07001130 "arch-mips64/bionic/__bionic_clone.S",
1131 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1132 "arch-mips64/bionic/setjmp.S",
1133 "arch-mips64/bionic/syscall.S",
1134 "arch-mips64/bionic/vfork.S",
1135 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001136 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301137 exclude_srcs: [
1138 "bionic/strchr.cpp",
1139 "bionic/strnlen.c",
1140 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001141 },
1142
1143 x86: {
1144 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001145 "arch-x86/generic/string/memcmp.S",
1146 "arch-x86/generic/string/strcmp.S",
1147 "arch-x86/generic/string/strncmp.S",
1148 "arch-x86/generic/string/strcat.S",
1149 "arch-x86/atom/string/sse2-memchr-atom.S",
1150 "arch-x86/atom/string/sse2-memrchr-atom.S",
1151 "arch-x86/atom/string/sse2-strchr-atom.S",
1152 "arch-x86/atom/string/sse2-strnlen-atom.S",
1153 "arch-x86/atom/string/sse2-strrchr-atom.S",
1154 "arch-x86/atom/string/sse2-wcschr-atom.S",
1155 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1156 "arch-x86/atom/string/sse2-wcslen-atom.S",
1157 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001158 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1159 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1160 "arch-x86/silvermont/string/sse2-memset-slm.S",
1161 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1162 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1163 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1164 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1165 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001166
1167 "arch-x86/bionic/__bionic_clone.S",
1168 "arch-x86/bionic/_exit_with_stack_teardown.S",
1169 "arch-x86/bionic/libgcc_compat.c",
1170 "arch-x86/bionic/__restore.S",
1171 "arch-x86/bionic/setjmp.S",
1172 "arch-x86/bionic/syscall.S",
1173 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001174 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001175
1176 exclude_srcs: [
1177 "bionic/strchr.cpp",
1178 "bionic/strnlen.c",
1179 "bionic/strrchr.cpp",
1180 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001181 atom: {
1182 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001183 "arch-x86/atom/string/sse2-memset-atom.S",
1184 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001185 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001186 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001187 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001188 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001189 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1190 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1191 ],
1192 exclude_srcs: [
1193 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001194 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1195 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1196 "arch-x86/silvermont/string/sse2-memset-slm.S",
1197 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1198 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1199 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1200 ],
1201 },
1202 ssse3: {
1203 srcs: [
1204 "arch-x86/atom/string/ssse3-strncat-atom.S",
1205 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1206 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1207 "arch-x86/atom/string/ssse3-strcat-atom.S",
1208 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1209 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1210 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1211 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1212 ],
1213 exclude_srcs: [
1214 "arch-x86/generic/string/strcmp.S",
1215 "arch-x86/generic/string/strncmp.S",
1216 "arch-x86/generic/string/strcat.S",
1217 ],
1218 },
1219 sse4: {
1220 srcs: [
1221 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1222 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1223 ],
1224 exclude_srcs: [
1225 "arch-x86/generic/string/memcmp.S",
1226 ],
1227 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001228 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001229 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001230 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001231 "arch-x86_64/string/sse2-memcpy-slm.S",
1232 "arch-x86_64/string/sse2-memmove-slm.S",
1233 "arch-x86_64/string/sse2-memset-slm.S",
1234 "arch-x86_64/string/sse2-stpcpy-slm.S",
1235 "arch-x86_64/string/sse2-stpncpy-slm.S",
1236 "arch-x86_64/string/sse2-strcat-slm.S",
1237 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001238 "arch-x86_64/string/sse2-strlen-slm.S",
1239 "arch-x86_64/string/sse2-strncat-slm.S",
1240 "arch-x86_64/string/sse2-strncpy-slm.S",
1241 "arch-x86_64/string/sse4-memcmp-slm.S",
1242 "arch-x86_64/string/ssse3-strcmp-slm.S",
1243 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001244
1245 "arch-x86_64/bionic/__bionic_clone.S",
1246 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1247 "arch-x86_64/bionic/__restore_rt.S",
1248 "arch-x86_64/bionic/setjmp.S",
1249 "arch-x86_64/bionic/syscall.S",
1250 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001251 ],
1252 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001253 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001254
Colin Cross50c21ab2015-10-31 23:03:05 -07001255 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001256 include_dirs: ["bionic/libstdc++/include"],
1257 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001258}
1259
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001260genrule {
1261 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001262 out: ["generated_android_ids.h"],
1263 srcs: [":android_filesystem_config_header"],
1264 tool_files: ["fs_config_generator.py"],
1265 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001266}
1267
Dan Willemsen268a6732015-10-15 14:49:45 -07001268// ========================================================
1269// libc_bionic_ndk.a- The portions of libc_bionic that can
1270// be safely used in libc_ndk.a (no troublesome global data
1271// or constructors).
1272// ========================================================
1273cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001274 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001275 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001276 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001277 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001278 "bionic/__cmsg_nxthdr.cpp",
1279 "bionic/__errno.cpp",
1280 "bionic/__gnu_basename.cpp",
1281 "bionic/__libc_current_sigrtmax.cpp",
1282 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001283 "bionic/abort.cpp",
1284 "bionic/accept.cpp",
1285 "bionic/accept4.cpp",
1286 "bionic/access.cpp",
1287 "bionic/arpa_inet.cpp",
1288 "bionic/assert.cpp",
1289 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001290 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001291 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001292 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001293 "bionic/bionic_systrace.cpp",
1294 "bionic/bionic_time_conversions.cpp",
1295 "bionic/brk.cpp",
1296 "bionic/c16rtomb.cpp",
1297 "bionic/c32rtomb.cpp",
1298 "bionic/chmod.cpp",
1299 "bionic/chown.cpp",
1300 "bionic/clearenv.cpp",
1301 "bionic/clock.cpp",
1302 "bionic/clock_getcpuclockid.cpp",
1303 "bionic/clock_nanosleep.cpp",
1304 "bionic/clone.cpp",
1305 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001306 "bionic/connect.cpp",
1307 "bionic/ctype.cpp",
1308 "bionic/dirent.cpp",
1309 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001310 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001311 "bionic/error.cpp",
1312 "bionic/eventfd_read.cpp",
1313 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001314 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001315 "bionic/faccessat.cpp",
1316 "bionic/fchmod.cpp",
1317 "bionic/fchmodat.cpp",
1318 "bionic/ffs.cpp",
1319 "bionic/fgetxattr.cpp",
1320 "bionic/flistxattr.cpp",
1321 "bionic/flockfile.cpp",
1322 "bionic/fpclassify.cpp",
1323 "bionic/fsetxattr.cpp",
1324 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001325 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001326 "bionic/futimens.cpp",
1327 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001328 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001329 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001330 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001331 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001332 "bionic/getpgrp.cpp",
1333 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001334 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001335 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001336 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001337 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001338 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001339 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001340 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001341 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001342 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001343 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001344 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001345 "bionic/lchown.cpp",
1346 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001347 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001348 "bionic/libgen.cpp",
1349 "bionic/link.cpp",
1350 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001351 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001352 "bionic/lstat.cpp",
1353 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001354 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001355 "bionic/mbrtoc16.cpp",
1356 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001357 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001358 "bionic/mempcpy.cpp",
1359 "bionic/mkdir.cpp",
1360 "bionic/mkfifo.cpp",
1361 "bionic/mknod.cpp",
1362 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001363 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001364 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001365 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001366 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001367 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001368 "bionic/open.cpp",
1369 "bionic/pathconf.cpp",
1370 "bionic/pause.cpp",
1371 "bionic/pipe.cpp",
1372 "bionic/poll.cpp",
1373 "bionic/posix_fadvise.cpp",
1374 "bionic/posix_fallocate.cpp",
1375 "bionic/posix_madvise.cpp",
1376 "bionic/posix_timers.cpp",
1377 "bionic/ptrace.cpp",
1378 "bionic/pty.cpp",
1379 "bionic/raise.cpp",
1380 "bionic/rand.cpp",
1381 "bionic/readlink.cpp",
1382 "bionic/reboot.cpp",
1383 "bionic/recv.cpp",
1384 "bionic/rename.cpp",
1385 "bionic/rmdir.cpp",
1386 "bionic/scandir.cpp",
1387 "bionic/sched_getaffinity.cpp",
1388 "bionic/sched_getcpu.cpp",
1389 "bionic/semaphore.cpp",
1390 "bionic/send.cpp",
1391 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001392 "bionic/seteuid.cpp",
1393 "bionic/setpgrp.cpp",
1394 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001395 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001396 "bionic/sigprocmask.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001397 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001398 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001399 "bionic/stat.cpp",
1400 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001401 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001402 "bionic/strchrnul.cpp",
1403 "bionic/strerror.cpp",
1404 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001405 "bionic/string_l.cpp",
1406 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001407 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001408 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001409 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001410 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001411 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001412 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001413 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001414 "bionic/sys_msg.cpp",
1415 "bionic/sys_sem.cpp",
1416 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001417 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001418 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001419 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001420 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001421 "bionic/sysinfo.cpp",
1422 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001423 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001424 "bionic/system_property_api.cpp",
1425 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001426 "bionic/tdestroy.cpp",
1427 "bionic/termios.cpp",
1428 "bionic/thread_private.cpp",
1429 "bionic/tmpfile.cpp",
1430 "bionic/umount.cpp",
1431 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001432 "bionic/wait.cpp",
1433 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001434 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001435 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001436 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001437 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001438 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001439
1440 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1441 // which will be overridden by the actual one in libc.so.
1442 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001443 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001444
Dan Willemsen208ae172015-09-16 16:33:27 -07001445 multilib: {
1446 lib32: {
1447 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001448 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001449 },
1450 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001451 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001452 treble_linker_namespaces: {
1453 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001454 },
1455 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001456 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001457 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001458 local_include_dirs: ["stdio"],
1459 include_dirs: ["bionic/libstdc++/include"],
1460 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001461 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001462}
1463
Dan Willemsen208ae172015-09-16 16:33:27 -07001464// ========================================================
1465// libc_pthread.a - pthreads parts that previously lived in
1466// libc_bionic.a. Relocated to their own library because
1467// they can't be included in libc_ndk.a (as they layout of
1468// pthread_t has changed over the years and has ABI
1469// compatibility issues).
1470// ========================================================
1471
1472cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001473 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001474 srcs: [
1475 "bionic/pthread_atfork.cpp",
1476 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001477 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001478 "bionic/pthread_cond.cpp",
1479 "bionic/pthread_create.cpp",
1480 "bionic/pthread_detach.cpp",
1481 "bionic/pthread_equal.cpp",
1482 "bionic/pthread_exit.cpp",
1483 "bionic/pthread_getcpuclockid.cpp",
1484 "bionic/pthread_getschedparam.cpp",
1485 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001486 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001487 "bionic/pthread_join.cpp",
1488 "bionic/pthread_key.cpp",
1489 "bionic/pthread_kill.cpp",
1490 "bionic/pthread_mutex.cpp",
1491 "bionic/pthread_once.cpp",
1492 "bionic/pthread_rwlock.cpp",
1493 "bionic/pthread_self.cpp",
1494 "bionic/pthread_setname_np.cpp",
1495 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001496 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001497
1498 // The following implementations depend on pthread data or implementation,
1499 // so we can't include them in libc_ndk.a.
1500 "bionic/__cxa_thread_atexit_impl.cpp",
1501 "stdlib/atexit.c",
1502 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001503 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001504
Colin Cross50c21ab2015-10-31 23:03:05 -07001505 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001506 include_dirs: ["bionic/libstdc++/include"],
1507 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001508}
1509
1510// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001511// libc_syscalls.a
1512// ========================================================
1513
1514cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001515 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001516 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001517 arch: {
1518 arm: {
1519 srcs: ["arch-arm/syscalls/**/*.S"],
1520 },
1521 arm64: {
1522 srcs: ["arch-arm64/syscalls/**/*.S"],
1523 },
1524 mips: {
1525 srcs: ["arch-mips/syscalls/**/*.S"],
1526 },
1527 mips64: {
1528 srcs: ["arch-mips64/syscalls/**/*.S"],
1529 },
1530 x86: {
1531 srcs: ["arch-x86/syscalls/**/*.S"],
1532 },
1533 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001534 srcs: ["arch-x86_64/syscalls/**/*.S"],
1535 },
1536 },
1537 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001538}
1539
1540// ========================================================
1541// libc_aeabi.a
1542// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1543// to avoid infinite recursion. For the other architectures we just build an
1544// empty library to keep this makefile simple.
1545// ========================================================
1546
1547cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001548 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001549 arch: {
1550 arm: {
1551 srcs: ["arch-arm/bionic/__aeabi.c"],
1552 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001553 },
1554 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001555 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001556}
1557
1558// ========================================================
1559// libc_ndk.a
1560// Compatibility library for the NDK. This library contains
1561// all the parts of libc that are safe to statically link.
1562// We can't safely statically link things that can only run
1563// on a certain version of the OS. Examples include
1564// anything that talks to netd (a large portion of the DNS
1565// code) and anything that is dependent on the layout of a
1566// data structure that has changed across releases (such as
1567// pthread_t).
1568// ========================================================
1569
1570cc_library_static {
1571 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001572 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001573 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001574 multilib: {
1575 lib32: {
1576 srcs: libc_common_src_files_32,
1577 },
1578 },
1579 arch: {
1580 arm: {
1581 srcs: [
1582 "arch-arm/bionic/exidx_dynamic.c",
1583 "arch-common/bionic/crtbegin_so.c",
1584 "arch-arm/bionic/atexit_legacy.c",
1585 "arch-common/bionic/crtend_so.S",
1586 ],
1587 whole_static_libs: ["libc_aeabi"],
1588 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001589 },
1590
Colin Cross50c21ab2015-10-31 23:03:05 -07001591 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001592 "-fvisibility=hidden",
1593 "-DLIBC_STATIC",
1594 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001595
1596 whole_static_libs: [
1597 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001598 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001599 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001600 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001601 "libc_gdtoa",
1602 "libc_malloc",
1603 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001604 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001605 "libc_openbsd_ndk",
1606 "libc_stack_protector",
1607 "libc_syscalls",
1608 "libc_tzcode",
1609 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001610 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001611 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001612 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001613}
1614
1615// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001616// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001617// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001618cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001619 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001620 srcs: libc_common_src_files,
1621 multilib: {
1622 lib32: {
1623 srcs: libc_common_src_files_32,
1624 },
1625 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001626 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001627
1628 whole_static_libs: [
1629 "libc_bionic",
1630 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001631 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001632 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001633 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001634 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001635 "libc_gdtoa",
1636 "libc_malloc",
1637 "libc_netbsd",
1638 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001639 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001640 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001641 "libc_stack_protector",
1642 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001643 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001644 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001645 ],
1646
1647 arch: {
1648 arm: {
1649 whole_static_libs: ["libc_aeabi"],
1650 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001651 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001652}
1653
1654// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001655// libc_common.a
1656// ========================================================
1657
1658cc_library_static {
1659 defaults: ["libc_defaults"],
1660 name: "libc_common",
1661
1662 whole_static_libs: [
1663 "libc_nopthread",
1664 "libc_pthread",
1665 ],
1666}
1667
1668// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001669// libc_nomalloc.a
1670// ========================================================
1671//
1672// This is a version of the static C library that does not
1673// include malloc. It's useful in situations when the user wants
1674// to provide their own malloc implementation, or wants to
1675// explicitly disallow the use of malloc, such as in the
1676// dynamic linker.
1677
1678cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001679 name: "libc_nomalloc",
1680
Colin Cross50c21ab2015-10-31 23:03:05 -07001681 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001682
1683 arch: {
1684 arm: {
1685 srcs: ["arch-arm/bionic/exidx_static.c"],
1686 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001687 },
1688
Colin Cross50c21ab2015-10-31 23:03:05 -07001689 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001690
Colin Crossa3f9fca2016-01-11 13:20:55 -08001691 whole_static_libs: [
1692 "libc_common",
1693 "libc_init_static",
1694 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001695}
1696
1697// ========================================================
1698// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1699// ========================================================
1700cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001701 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001702 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001703 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001704
Dan Willemsen208ae172015-09-16 16:33:27 -07001705 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001706}
1707
1708// ========================================================
1709// libc.a + libc.so
1710// ========================================================
1711cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001712 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001713 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001714 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001715 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001716 platform_sdk_version: {
1717 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1718 },
1719 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001720 static: {
1721 srcs: [
1722 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001723 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001724 ],
1725 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001726 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001727 },
1728 shared: {
1729 srcs: [
1730 "arch-common/bionic/crtbegin_so.c",
1731 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001732 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001733 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001734 "bionic/NetdClient.cpp",
1735 "arch-common/bionic/crtend_so.S",
1736 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001737 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001738 },
1739
1740 required: ["tzdata"],
1741
1742 // Leave the symbols in the shared library so that stack unwinders can produce
1743 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001744 strip: {
1745 keep_symbols: true,
1746 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001747
Colin Cross4ce94d22016-11-15 13:15:43 -08001748 // Do not pack libc.so relocations; see http://b/20645321 for details.
1749 pack_relocations: false,
1750
dimitry06016f22018-01-05 11:39:28 +01001751 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1752 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1753 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1754 // those new libraries from libgcc.a are not declared external; if that were the case,
1755 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1756 // on the external symbols from the dependent libraries. That would create a "cloaked"
1757 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001758
dimitry06016f22018-01-05 11:39:28 +01001759 shared_libs: [
1760 "ld-android",
1761 "libdl",
1762 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001763 whole_static_libs: [
1764 "libc_common",
1765 "libjemalloc",
1766 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001767
1768 nocrt: true,
1769
Dan Willemsen208ae172015-09-16 16:33:27 -07001770 arch: {
1771 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001772 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001773 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001774 ldflags: ["-Wl,--hash-style=both"],
1775
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001776 // Don't re-export new/delete and friends, even if the compiler really wants to.
1777 version_script: "libc.arm.map",
1778
Dan Willemsen208ae172015-09-16 16:33:27 -07001779 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001780 srcs: [
1781 "arch-arm/bionic/exidx_dynamic.c",
1782
1783 // special for arm
1784 "arch-arm/bionic/atexit_legacy.c",
1785 ],
1786 // special for arm
1787 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001788 },
1789 static: {
1790 srcs: ["arch-arm/bionic/exidx_static.c"],
1791 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001792 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001793 arm64: {
1794 // Don't re-export new/delete and friends, even if the compiler really wants to.
1795 version_script: "libc.arm64.map",
1796 },
1797 mips: {
1798 // Don't re-export new/delete and friends, even if the compiler really wants to.
1799 version_script: "libc.mips.map",
1800 },
1801 mips64: {
1802 // Don't re-export new/delete and friends, even if the compiler really wants to.
1803 version_script: "libc.mips64.map",
1804 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001805 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001806 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001807 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001808 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: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001839 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001840 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001841 version_script: "libstdc++.arm.map",
1842 },
1843 arm64: {
1844 version_script: "libstdc++.arm64.map",
1845 },
1846 mips: {
1847 version_script: "libstdc++.mips.map",
1848 },
1849 mips64: {
1850 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001851 },
1852 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001853 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001854 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001855 version_script: "libstdc++.x86.map",
1856 },
1857 x86_64: {
1858 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001859 },
1860 },
1861}
1862
Colin Cross50c21ab2015-10-31 23:03:05 -07001863cc_defaults {
1864 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001865 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001866 vendor_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001867 recovery_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001868
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001869 cflags: [
1870 "-Wno-gcc-compat",
1871 "-Wall",
1872 "-Werror",
1873 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001874}
1875
Colin Cross50c21ab2015-10-31 23:03:05 -07001876cc_defaults {
1877 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001878 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001879
1880 arch: {
1881 mips: {
1882 cflags: ["-fPIC"],
1883 },
1884 mips64: {
1885 cflags: ["-fPIC"],
1886 },
1887 x86: {
1888 cflags: ["-fPIC"],
1889 },
1890 x86_64: {
1891 cflags: ["-fPIC"],
1892 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001893 },
1894}
1895
Dan Willemsena3ed9012017-04-04 15:51:26 -07001896// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001897cc_object {
1898 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001899 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001900 local_include_dirs: ["include"],
1901 product_variables: {
1902 platform_sdk_version: {
1903 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1904 },
1905 },
1906 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001907
Colin Cross7d7b3682017-11-03 13:38:40 -07001908 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001909}
1910
Dan Willemsen208ae172015-09-16 16:33:27 -07001911cc_object {
1912 name: "crtbegin_so1",
1913 local_include_dirs: ["include"],
1914 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001915
Colin Cross7d7b3682017-11-03 13:38:40 -07001916 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001917}
1918
Dan Willemsen208ae172015-09-16 16:33:27 -07001919cc_object {
1920 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001921
Colin Cross7d7b3682017-11-03 13:38:40 -07001922 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001923 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001924 "crtbegin_so1",
1925 "crtbrand",
1926 ],
1927}
1928
Dan Willemsen208ae172015-09-16 16:33:27 -07001929cc_object {
1930 name: "crtend_so",
1931 local_include_dirs: ["include"],
1932 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001933
Colin Cross7d7b3682017-11-03 13:38:40 -07001934 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001935}
1936
Dan Willemsen208ae172015-09-16 16:33:27 -07001937cc_object {
1938 name: "crtbegin_static1",
1939 local_include_dirs: ["include"],
1940 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001941
Colin Cross50c21ab2015-10-31 23:03:05 -07001942 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001943 mips: {
1944 srcs: [
1945 "arch-mips/bionic/crtbegin.c",
1946 ],
1947 exclude_srcs: [
1948 "arch-common/bionic/crtbegin.c",
1949 ],
1950 },
1951 mips64: {
1952 srcs: [
1953 "arch-mips64/bionic/crtbegin.c",
1954 ],
1955 exclude_srcs: [
1956 "arch-common/bionic/crtbegin.c",
1957 ],
1958 },
1959 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001960
1961 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001962}
1963
Dan Willemsen208ae172015-09-16 16:33:27 -07001964cc_object {
1965 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001966
Colin Cross77d57bf2016-04-11 14:34:18 -07001967 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001968 "crtbegin_static1",
1969 "crtbrand",
1970 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001971 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001972}
1973
Dan Willemsen208ae172015-09-16 16:33:27 -07001974cc_object {
1975 name: "crtbegin_dynamic1",
1976 local_include_dirs: ["include"],
1977 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001978
Colin Cross50c21ab2015-10-31 23:03:05 -07001979 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001980 mips: {
1981 srcs: [
1982 "arch-mips/bionic/crtbegin.c",
1983 ],
1984 exclude_srcs: [
1985 "arch-common/bionic/crtbegin.c",
1986 ],
1987 },
1988 mips64: {
1989 srcs: [
1990 "arch-mips64/bionic/crtbegin.c",
1991 ],
1992 exclude_srcs: [
1993 "arch-common/bionic/crtbegin.c",
1994 ],
1995 },
1996 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001997 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001998}
1999
Dan Willemsen208ae172015-09-16 16:33:27 -07002000cc_object {
2001 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07002002
Colin Cross77d57bf2016-04-11 14:34:18 -07002003 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002004 "crtbegin_dynamic1",
2005 "crtbrand",
2006 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002007 target: {
2008 linux_bionic: {
2009 generated_sources: ["host_bionic_linker_asm"],
2010 objs: [
2011 "linker_wrapper",
2012 ],
2013 },
2014 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002015 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002016}
2017
Dan Willemsen208ae172015-09-16 16:33:27 -07002018cc_object {
2019 // We rename crtend.o to crtend_android.o to avoid a
2020 // name clash between gcc and bionic.
2021 name: "crtend_android",
2022 local_include_dirs: ["include"],
2023 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002024
Colin Cross50c21ab2015-10-31 23:03:05 -07002025 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002026}
Colin Crossbaa48992016-07-13 11:15:21 -07002027
Dan Albert26e1c412018-05-24 14:56:46 -07002028versioned_ndk_headers {
Dan Albert22805ea2017-03-22 15:28:05 -07002029 name: "common_libc",
2030 from: "include",
2031 to: "",
2032 license: "NOTICE",
2033}
Dan Albert4238a352016-06-28 11:18:05 -07002034
2035ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002036 name: "libc_uapi",
2037 from: "kernel/uapi",
2038 to: "",
2039 srcs: [
2040 "kernel/uapi/asm-generic/**/*.h",
2041 "kernel/uapi/drm/**/*.h",
2042 "kernel/uapi/linux/**/*.h",
2043 "kernel/uapi/misc/**/*.h",
2044 "kernel/uapi/mtd/**/*.h",
2045 "kernel/uapi/rdma/**/*.h",
2046 "kernel/uapi/scsi/**/*.h",
2047 "kernel/uapi/sound/**/*.h",
2048 "kernel/uapi/video/**/*.h",
2049 "kernel/uapi/xen/**/*.h",
2050 ],
Dan Albert92592652016-10-20 01:42:54 -07002051 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002052}
2053
2054ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002055 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002056 from: "kernel/android/uapi/linux",
2057 to: "linux",
2058 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002059 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002060}
2061
2062ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002063 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002064 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002065 to: "scsi",
2066 srcs: ["kernel/android/scsi/**/*.h"],
2067 license: "NOTICE",
2068}
2069
2070ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002071 name: "libc_asm_arm",
2072 from: "kernel/uapi/asm-arm",
2073 to: "arm-linux-androideabi",
2074 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002075 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002076}
2077
2078ndk_headers {
2079 name: "libc_asm_arm64",
2080 from: "kernel/uapi/asm-arm64",
2081 to: "aarch64-linux-android",
2082 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002083 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002084}
2085
Elliott Hughesee291c02017-12-11 11:32:34 -08002086// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002087ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002088 name: "libc_asm_mips",
2089 from: "kernel/uapi/asm-mips",
2090 to: "mipsel-linux-android",
2091 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2092 license: "NOTICE",
2093}
2094
Elliott Hughesee291c02017-12-11 11:32:34 -08002095// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002096ndk_headers {
2097 name: "libc_asm_mips64",
2098 from: "kernel/uapi/asm-mips",
2099 to: "mips64el-linux-android",
2100 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2101 license: "NOTICE",
2102}
2103
2104ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002105 name: "libc_asm_x86",
2106 from: "kernel/uapi/asm-x86",
2107 to: "i686-linux-android",
2108 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002109 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002110}
2111
2112ndk_headers {
2113 name: "libc_asm_x86_64",
2114 from: "kernel/uapi/asm-x86",
2115 to: "x86_64-linux-android",
2116 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002117 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002118}
2119
Dan Albert4238a352016-06-28 11:18:05 -07002120ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002121 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002122 symbol_file: "libc.map.txt",
2123 first_version: "9",
2124}
2125
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002126llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002127 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002128 symbol_file: "libc.map.txt",
2129 export_headers_as_system: true,
2130 export_preprocessed_headers: ["include"],
2131 arch: {
2132 arm: {
2133 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002134 "kernel/uapi",
2135 "kernel/uapi/asm-arm",
2136 "kernel/android/uapi",
2137 ],
2138 },
2139 arm64: {
2140 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002141 "kernel/uapi",
2142 "kernel/uapi/asm-arm64",
2143 "kernel/android/uapi",
2144 ],
2145 },
2146 mips: {
2147 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002148 "kernel/uapi",
2149 "kernel/uapi/asm-mips",
2150 "kernel/android/uapi",
2151 ],
2152 },
2153 mips64: {
2154 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002155 "kernel/uapi",
2156 "kernel/uapi/asm-mips",
2157 "kernel/android/uapi",
2158 ],
2159 },
2160 x86: {
2161 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002162 "kernel/uapi",
2163 "kernel/uapi/asm-x86",
2164 "kernel/android/uapi",
2165 ],
2166 },
2167 x86_64: {
2168 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002169 "kernel/uapi",
2170 "kernel/uapi/asm-x86",
2171 "kernel/android/uapi",
2172 ],
2173 },
2174 },
2175}
2176
Dan Albertdf31aff2016-10-06 15:50:41 -07002177ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002178 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002179 symbol_file: "libstdc++.map.txt",
2180 first_version: "9",
2181}
2182
Dan Willemsenca056d72018-01-08 14:00:24 -08002183// Export these headers for toolbox to process
2184filegroup {
2185 name: "kernel_input_headers",
2186 srcs: [
2187 "kernel/uapi/linux/input.h",
2188 "kernel/uapi/linux/input-event-codes.h",
2189 ],
2190}