blob: eeeadb67253c2641cf561a6590b013fa6f04299f [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001// Define the common source files for all the libc instances
2// =========================================================
3libc_common_src_files = [
Christopher Ferris7a3681e2017-04-24 17:48:32 -07004 "async_safe/async_safe_log.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07005 "bionic/ether_aton.c",
6 "bionic/ether_ntoa.c",
7 "bionic/fts.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07008 "bionic/initgroups.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07009 "bionic/isatty.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070010 "bionic/pututline.c",
11 "bionic/sched_cpualloc.c",
12 "bionic/sched_cpucount.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070013 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070014 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070015 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080016 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070017 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080018 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070019 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070021]
22
23// Various kinds of cruft.
24// ========================================================
25libc_common_src_files += [
26 "bionic/ndk_cruft.cpp",
27]
28
29libc_common_src_files_32 = [
30 "bionic/legacy_32_bit_support.cpp",
31 "bionic/time64.c",
32]
33
Elliott Hughes53cf3482016-08-09 13:06:41 -070034libc_common_flags = [
35 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080036 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070037 "-Wall",
38 "-Wextra",
39 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080040 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070041 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070042 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070043 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070044
45 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
46 "-Werror=pointer-to-int-cast",
47 "-Werror=int-to-pointer-cast",
48 "-Werror=type-limits",
49 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080050
51 // Clang's exit-time destructor registration hides __dso_handle, but
52 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
53 "-Wexit-time-destructors",
Elliott Hughes53cf3482016-08-09 13:06:41 -070054]
55
Dan Willemsen208ae172015-09-16 16:33:27 -070056// Define some common cflags
57// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070058cc_defaults {
59 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080060 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070061 cflags: libc_common_flags,
62 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070063 conlyflags: ["-std=gnu99"],
64 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070065 include_dirs: [
66 "bionic/libc/async_safe/include",
67 "external/jemalloc/include",
68 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070069
Colin Cross50c21ab2015-10-31 23:03:05 -070070 stl: "none",
71 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070072 sanitize: {
73 never: true,
74 },
Colin Cross50c21ab2015-10-31 23:03:05 -070075 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070076}
77
Dan Willemsen208ae172015-09-16 16:33:27 -070078// ANDROIDMK TRANSLATION ERROR: unsupported directive
79// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
80//libc_common_cflags += ["-DDEBUG"]
81// ANDROIDMK TRANSLATION ERROR: unsupported directive
82// endif
83
Dan Willemsen208ae172015-09-16 16:33:27 -070084// ========================================================
85// libc_stack_protector.a - stack protector code
86// ========================================================
87//
Colin Crossa3f9fca2016-01-11 13:20:55 -080088// Code that implements the stack protector (or that runs
89// before TLS has been set up) needs to be compiled with
90// -fno-stack-protector, since it accesses the stack canary
91// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070092
93cc_library_static {
94
Colin Crossa3f9fca2016-01-11 13:20:55 -080095 srcs: [
96 "bionic/__libc_init_main_thread.cpp",
97 "bionic/__stack_chk_fail.cpp",
98 ],
99 arch: {
100 arm64: {
101 srcs: ["arch-arm64/bionic/__set_tls.c"],
102 },
103 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800104 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800105 },
106 x86_64: {
107 srcs: ["arch-x86_64/bionic/__set_tls.c"],
108 },
109 },
110
Colin Cross50c21ab2015-10-31 23:03:05 -0700111 defaults: ["libc_defaults"],
112 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700113 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700114}
115
Colin Crossa3f9fca2016-01-11 13:20:55 -0800116// libc_init_static.cpp also needs to be built without stack protector,
117// because it's responsible for setting up TLS for static executables.
118// This isn't the case for dynamic executables because the dynamic linker
119// has already set up the main thread's TLS.
120
121cc_library_static {
122 name: "libc_init_static",
123 defaults: ["libc_defaults"],
124 srcs: ["bionic/libc_init_static.cpp"],
125 cflags: ["-fno-stack-protector"],
126}
127
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700128cc_library_static {
129 name: "libc_init_dynamic",
130 defaults: ["libc_defaults"],
131 srcs: ["bionic/libc_init_dynamic.cpp"],
132 cflags: ["-fno-stack-protector"],
133}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800134
Dan Willemsen208ae172015-09-16 16:33:27 -0700135// ========================================================
136// libc_tzcode.a - upstream 'tzcode' code
137// ========================================================
138
139cc_library_static {
140
Colin Cross50c21ab2015-10-31 23:03:05 -0700141 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700142 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800143 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700144 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700145 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
146 ],
147
Colin Cross50c21ab2015-10-31 23:03:05 -0700148 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700149 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700150 // Don't use ridiculous amounts of stack.
151 "-DALL_STATE",
152 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
153 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800154 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700155 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700156 // The name of the tm_gmtoff field in our struct tm.
157 "-DTM_GMTOFF=tm_gmtoff",
158 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700159 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700160 // Include `tzname`, `timezone`, and `daylight` globals.
161 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700162 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800163 // Use the empty string (instead of " ") as the timezone abbreviation
164 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700165 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700166 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
167 "-Dlint",
168 ],
169
Dan Willemsen208ae172015-09-16 16:33:27 -0700170 local_include_dirs: ["tzcode/"],
171 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700172}
173
174// ========================================================
175// libc_dns.a - modified NetBSD DNS code
176// ========================================================
177
178cc_library_static {
179
Colin Cross50c21ab2015-10-31 23:03:05 -0700180 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700181 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800182 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700183
184 "upstream-netbsd/lib/libc/isc/ev_streams.c",
185 "upstream-netbsd/lib/libc/isc/ev_timers.c",
186 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700187 ],
188
Colin Cross50c21ab2015-10-31 23:03:05 -0700189 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700190 "-DANDROID_CHANGES",
191 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700192 "-Wno-unused-parameter",
193 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700194 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700195 ],
196
Dan Willemsen208ae172015-09-16 16:33:27 -0700197 local_include_dirs: [
198 "dns/include",
199 "private",
200 "upstream-netbsd/lib/libc/include",
201 "upstream-netbsd/android/include",
202 ],
203
204 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700205}
206
207// ========================================================
208// libc_freebsd.a - upstream FreeBSD C library code
209// ========================================================
210//
211// These files are built with the freebsd-compat.h header file
212// automatically included.
213
214cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700215 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700216 srcs: [
217 "upstream-freebsd/lib/libc/gen/ldexp.c",
218 "upstream-freebsd/lib/libc/gen/sleep.c",
219 "upstream-freebsd/lib/libc/gen/usleep.c",
220 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700221 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
222 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
223 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
224 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700225 "upstream-freebsd/lib/libc/stdlib/qsort.c",
226 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 "upstream-freebsd/lib/libc/string/wcpcpy.c",
228 "upstream-freebsd/lib/libc/string/wcpncpy.c",
229 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700230 "upstream-freebsd/lib/libc/string/wcscat.c",
231 "upstream-freebsd/lib/libc/string/wcschr.c",
232 "upstream-freebsd/lib/libc/string/wcscmp.c",
233 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700234 "upstream-freebsd/lib/libc/string/wcscspn.c",
235 "upstream-freebsd/lib/libc/string/wcsdup.c",
236 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700237 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
239 "upstream-freebsd/lib/libc/string/wcsncat.c",
240 "upstream-freebsd/lib/libc/string/wcsncmp.c",
241 "upstream-freebsd/lib/libc/string/wcsncpy.c",
242 "upstream-freebsd/lib/libc/string/wcsnlen.c",
243 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700244 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700245 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700246 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700247 "upstream-freebsd/lib/libc/string/wcstok.c",
248 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700249 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700250 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800252 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700253 ],
254 arch: {
255 arm64: {
256 exclude_srcs: [
257 "upstream-freebsd/lib/libc/string/wmemmove.c",
258 ],
259 },
260 x86: {
261 exclude_srcs: [
262 "upstream-freebsd/lib/libc/string/wcschr.c",
263 "upstream-freebsd/lib/libc/string/wcscmp.c",
264 "upstream-freebsd/lib/libc/string/wcslen.c",
265 "upstream-freebsd/lib/libc/string/wcsrchr.c",
266 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800267 atom: {
268 exclude_srcs: [
269 "upstream-freebsd/lib/libc/string/wmemcmp.c",
270 ],
271 },
272 ssse3: {
273 exclude_srcs: [
274 "upstream-freebsd/lib/libc/string/wcscat.c",
275 "upstream-freebsd/lib/libc/string/wcscpy.c",
276 ],
277 },
278 sse4: {
279 exclude_srcs: [
280 "upstream-freebsd/lib/libc/string/wmemcmp.c",
281 ],
282 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700284 },
285
Colin Cross50c21ab2015-10-31 23:03:05 -0700286 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700287 "-Wno-sign-compare",
288 "-Wno-uninitialized",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700289 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700290 "-include freebsd-compat.h",
291 ],
292
Dan Willemsen208ae172015-09-16 16:33:27 -0700293 local_include_dirs: [
294 "upstream-freebsd/android/include",
295 ],
296
297 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700298}
299
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700300cc_library_static {
301 defaults: ["libc_defaults"],
302 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700303 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700304 "upstream-freebsd/lib/libc/stdlib/realpath.c",
305 ],
306
307 cflags: [
308 "-Wno-sign-compare",
309 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700310 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700311 ],
312
313 local_include_dirs: [
314 "upstream-freebsd/android/include",
315 ],
316
317 name: "libc_freebsd_large_stack",
318}
319
Dan Willemsen208ae172015-09-16 16:33:27 -0700320// ========================================================
321// libc_netbsd.a - upstream NetBSD C library code
322// ========================================================
323//
324// These files are built with the netbsd-compat.h header file
325// automatically included.
326
327cc_library_static {
328
Colin Cross50c21ab2015-10-31 23:03:05 -0700329 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700330 srcs: [
331 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700332 "upstream-netbsd/lib/libc/gen/nice.c",
333 "upstream-netbsd/lib/libc/gen/popen.c",
334 "upstream-netbsd/lib/libc/gen/psignal.c",
335 "upstream-netbsd/lib/libc/gen/utime.c",
336 "upstream-netbsd/lib/libc/gen/utmp.c",
337 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
338 "upstream-netbsd/lib/libc/regex/regcomp.c",
339 "upstream-netbsd/lib/libc/regex/regerror.c",
340 "upstream-netbsd/lib/libc/regex/regexec.c",
341 "upstream-netbsd/lib/libc/regex/regfree.c",
342 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
343 "upstream-netbsd/lib/libc/stdlib/div.c",
344 "upstream-netbsd/lib/libc/stdlib/drand48.c",
345 "upstream-netbsd/lib/libc/stdlib/erand48.c",
346 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
347 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
348 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
349 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
350 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
351 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
352 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
353 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
354 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
355 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
356 "upstream-netbsd/lib/libc/stdlib/seed48.c",
357 "upstream-netbsd/lib/libc/stdlib/srand48.c",
358 "upstream-netbsd/lib/libc/string/memccpy.c",
359 "upstream-netbsd/lib/libc/string/strcasestr.c",
360 "upstream-netbsd/lib/libc/string/strcoll.c",
361 "upstream-netbsd/lib/libc/string/strxfrm.c",
362 ],
363 multilib: {
364 lib32: {
365 // LP32 cruft
366 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
367 },
368 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700369 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700370 "-Wno-sign-compare",
371 "-Wno-uninitialized",
Dan Willemsen879cec22016-02-29 10:37:56 -0800372 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700373 "-DPOSIX_MISTAKE",
374 "-include netbsd-compat.h",
375 ],
376
Dan Willemsen208ae172015-09-16 16:33:27 -0700377 local_include_dirs: [
378 "upstream-netbsd/android/include",
379 "upstream-netbsd/lib/libc/include",
380 ],
381
382 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700383}
384
385// ========================================================
386// libc_openbsd_ndk.a - upstream OpenBSD C library code
387// that can be safely included in the libc_ndk.a (doesn't
388// contain any troublesome global data or constructors).
389// ========================================================
390//
391// These files are built with the openbsd-compat.h header file
392// automatically included.
393
394cc_library_static {
395 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700396 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700397 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700398 "upstream-openbsd/lib/libc/gen/alarm.c",
399 "upstream-openbsd/lib/libc/gen/ctype_.c",
400 "upstream-openbsd/lib/libc/gen/daemon.c",
401 "upstream-openbsd/lib/libc/gen/err.c",
402 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700403 "upstream-openbsd/lib/libc/gen/fnmatch.c",
404 "upstream-openbsd/lib/libc/gen/ftok.c",
405 "upstream-openbsd/lib/libc/gen/getprogname.c",
406 "upstream-openbsd/lib/libc/gen/isctype.c",
407 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700408 "upstream-openbsd/lib/libc/gen/tolower_.c",
409 "upstream-openbsd/lib/libc/gen/toupper_.c",
410 "upstream-openbsd/lib/libc/gen/verr.c",
411 "upstream-openbsd/lib/libc/gen/verrx.c",
412 "upstream-openbsd/lib/libc/gen/vwarn.c",
413 "upstream-openbsd/lib/libc/gen/vwarnx.c",
414 "upstream-openbsd/lib/libc/gen/warn.c",
415 "upstream-openbsd/lib/libc/gen/warnx.c",
416 "upstream-openbsd/lib/libc/locale/btowc.c",
417 "upstream-openbsd/lib/libc/locale/mbrlen.c",
418 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
419 "upstream-openbsd/lib/libc/locale/mbtowc.c",
420 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700421 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
422 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700423 "upstream-openbsd/lib/libc/locale/wcstoll.c",
424 "upstream-openbsd/lib/libc/locale/wcstombs.c",
425 "upstream-openbsd/lib/libc/locale/wcstoul.c",
426 "upstream-openbsd/lib/libc/locale/wcstoull.c",
427 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
428 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
429 "upstream-openbsd/lib/libc/locale/wctob.c",
430 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700431 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700432 "upstream-openbsd/lib/libc/net/htonl.c",
433 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700434 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
435 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
436 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700437 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
438 "upstream-openbsd/lib/libc/net/inet_ntop.c",
439 "upstream-openbsd/lib/libc/net/inet_pton.c",
440 "upstream-openbsd/lib/libc/net/ntohl.c",
441 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800442 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700444 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
445 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700447 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700448 "upstream-openbsd/lib/libc/stdio/fputwc.c",
449 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700450 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
451 "upstream-openbsd/lib/libc/stdio/fwalk.c",
452 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700454 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-openbsd/lib/libc/stdio/makebuf.c",
456 "upstream-openbsd/lib/libc/stdio/mktemp.c",
457 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
458 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700459 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700460 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700461 "upstream-openbsd/lib/libc/stdio/tempnam.c",
462 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
463 "upstream-openbsd/lib/libc/stdio/ungetc.c",
464 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
465 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
466 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700467 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
468 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
469 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700471 "upstream-openbsd/lib/libc/stdio/wsetup.c",
472 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700473 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700474 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700475 "upstream-openbsd/lib/libc/stdlib/insque.c",
476 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
477 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
478 "upstream-openbsd/lib/libc/stdlib/labs.c",
479 "upstream-openbsd/lib/libc/stdlib/llabs.c",
480 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
481 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
482 "upstream-openbsd/lib/libc/stdlib/remque.c",
483 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700484 "upstream-openbsd/lib/libc/stdlib/system.c",
485 "upstream-openbsd/lib/libc/stdlib/tfind.c",
486 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
487 "upstream-openbsd/lib/libc/string/strcasecmp.c",
488 "upstream-openbsd/lib/libc/string/strcspn.c",
489 "upstream-openbsd/lib/libc/string/strdup.c",
490 "upstream-openbsd/lib/libc/string/strndup.c",
491 "upstream-openbsd/lib/libc/string/strpbrk.c",
492 "upstream-openbsd/lib/libc/string/strsep.c",
493 "upstream-openbsd/lib/libc/string/strspn.c",
494 "upstream-openbsd/lib/libc/string/strstr.c",
495 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700496 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700497 "upstream-openbsd/lib/libc/string/wcswidth.c",
498 ],
499
Colin Cross50c21ab2015-10-31 23:03:05 -0700500 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700501 "-Wno-sign-compare",
502 "-Wno-uninitialized",
503 "-Wno-unused-parameter",
504 "-include openbsd-compat.h",
505 ],
506
Dan Willemsen208ae172015-09-16 16:33:27 -0700507 local_include_dirs: [
508 "private",
509 "stdio",
510 "upstream-openbsd/android/include",
511 "upstream-openbsd/lib/libc/include",
512 "upstream-openbsd/lib/libc/gdtoa/",
513 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700514}
515
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700516cc_library_static {
517 name: "libc_openbsd_large_stack",
518 defaults: ["libc_defaults"],
519 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700520 "stdio/vfprintf.cpp",
521 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700522 ],
523 cflags: [
524 "-include openbsd-compat.h",
525 "-Wno-sign-compare",
526 "-Wframe-larger-than=5000",
527 ],
528
529 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700530 "upstream-openbsd/android/include/",
531 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700532 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700533 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700534 ],
535}
536
Dan Willemsen208ae172015-09-16 16:33:27 -0700537// ========================================================
538// libc_openbsd.a - upstream OpenBSD C library code
539// ========================================================
540//
541// These files are built with the openbsd-compat.h header file
542// automatically included.
543cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700544 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700545 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800546 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700547 "upstream-openbsd/lib/libc/crypt/arc4random.c",
548 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
549
550 // May be overriden by per-arch optimized versions
551 "upstream-openbsd/lib/libc/string/memchr.c",
552 "upstream-openbsd/lib/libc/string/memmove.c",
553 "upstream-openbsd/lib/libc/string/memrchr.c",
554 "upstream-openbsd/lib/libc/string/stpcpy.c",
555 "upstream-openbsd/lib/libc/string/stpncpy.c",
556 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700557 "upstream-openbsd/lib/libc/string/strcpy.c",
558 "upstream-openbsd/lib/libc/string/strlcat.c",
559 "upstream-openbsd/lib/libc/string/strlcpy.c",
560 "upstream-openbsd/lib/libc/string/strncat.c",
561 "upstream-openbsd/lib/libc/string/strncmp.c",
562 "upstream-openbsd/lib/libc/string/strncpy.c",
563 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700564
565 arch: {
566 arm: {
567 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700568 "upstream-openbsd/lib/libc/string/strcpy.c",
569 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800570 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700571 exclude_srcs: [
572 "upstream-openbsd/lib/libc/string/memmove.c",
573 "upstream-openbsd/lib/libc/string/stpcpy.c",
574 "upstream-openbsd/lib/libc/string/strcat.c",
575 ],
576 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700577 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700578 arm64: {
579 exclude_srcs: [
580 "upstream-openbsd/lib/libc/string/memchr.c",
581 "upstream-openbsd/lib/libc/string/memmove.c",
582 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700583 "upstream-openbsd/lib/libc/string/strcpy.c",
584 "upstream-openbsd/lib/libc/string/strncmp.c",
585 ],
586 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530587 mips: {
588 exclude_srcs: [
589 "upstream-openbsd/lib/libc/string/memchr.c",
590 "upstream-openbsd/lib/libc/string/memmove.c",
591 "upstream-openbsd/lib/libc/string/strcpy.c",
592 "upstream-openbsd/lib/libc/string/strncmp.c",
593 ],
594 },
595 mips64: {
596 exclude_srcs: [
597 "upstream-openbsd/lib/libc/string/memchr.c",
598 "upstream-openbsd/lib/libc/string/memmove.c",
599 "upstream-openbsd/lib/libc/string/strcpy.c",
600 "upstream-openbsd/lib/libc/string/strncmp.c",
601 ],
602 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700603 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800604 exclude_srcs: [
605 "upstream-openbsd/lib/libc/string/memchr.c",
606 "upstream-openbsd/lib/libc/string/memmove.c",
607 "upstream-openbsd/lib/libc/string/memrchr.c",
608 "upstream-openbsd/lib/libc/string/stpcpy.c",
609 "upstream-openbsd/lib/libc/string/stpncpy.c",
610 "upstream-openbsd/lib/libc/string/strcat.c",
611 "upstream-openbsd/lib/libc/string/strcpy.c",
612 "upstream-openbsd/lib/libc/string/strncmp.c",
613 "upstream-openbsd/lib/libc/string/strncpy.c",
614 ],
615 ssse3: {
616 exclude_srcs: [
617 "upstream-openbsd/lib/libc/string/strlcat.c",
618 "upstream-openbsd/lib/libc/string/strlcpy.c",
619 "upstream-openbsd/lib/libc/string/strncat.c",
620 ],
621 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700622 },
623
624 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800625 exclude_srcs: [
626 "upstream-openbsd/lib/libc/string/memmove.c",
627 "upstream-openbsd/lib/libc/string/stpcpy.c",
628 "upstream-openbsd/lib/libc/string/stpncpy.c",
629 "upstream-openbsd/lib/libc/string/strcat.c",
630 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800631 "upstream-openbsd/lib/libc/string/strncat.c",
632 "upstream-openbsd/lib/libc/string/strncmp.c",
633 "upstream-openbsd/lib/libc/string/strncpy.c",
634 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700635 },
636 },
637
Colin Cross50c21ab2015-10-31 23:03:05 -0700638 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700639 "-Wno-sign-compare",
640 "-Wno-uninitialized",
641 "-Wno-unused-parameter",
642 "-include openbsd-compat.h",
643 ],
644
Dan Willemsen208ae172015-09-16 16:33:27 -0700645 local_include_dirs: [
646 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700647 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700648 ],
649
650 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700651}
652
653// ========================================================
654// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
655// ========================================================
656//
657// These files are built with the openbsd-compat.h header file
658// automatically included.
659
660cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700661 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700662 srcs: [
663 "upstream-openbsd/android/gdtoa_support.cpp",
664 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
665 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
666 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
667 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
668 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
669 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
670 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
671 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
672 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
673 "upstream-openbsd/lib/libc/gdtoa/misc.c",
674 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
675 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
676 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
677 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
678 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
679 "upstream-openbsd/lib/libc/gdtoa/sum.c",
680 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
681 ],
682 multilib: {
683 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800684 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700685 },
686 },
687
Colin Cross50c21ab2015-10-31 23:03:05 -0700688 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700689 "-Wno-sign-compare",
690 "-Wno-uninitialized",
Dan Willemsen208ae172015-09-16 16:33:27 -0700691 "-include openbsd-compat.h",
692 ],
693
Dan Willemsen208ae172015-09-16 16:33:27 -0700694 local_include_dirs: [
695 "private",
696 "upstream-openbsd/android/include",
697 "upstream-openbsd/lib/libc/include",
698 ],
699
700 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700701}
702
703// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700704// libc_fortify.a - container for our FORITFY
705// implementation details
706// ========================================================
707cc_library_static {
708 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700709 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700710
711 name: "libc_fortify",
712
713 // Disable FORTIFY for the compilation of these, so we don't end up having
714 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800715 cflags: [
716 "-U_FORTIFY_SOURCE",
717 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
718 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700719
720 arch: {
721 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700722 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700723 srcs: [
724 "arch-arm/generic/bionic/__memcpy_chk.S",
725 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800726 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800727 cflags: [
728 "-DNO___STRCAT_CHK",
729 "-DNO___STRCPY_CHK",
730 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700731 srcs: [
732 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
733 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
734 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700735 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800736 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700737 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800738 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
739 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
740 ],
741 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700742 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
743 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
744 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700745 },
746 cortex_a9: {
747 srcs: [
748 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
749 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
750 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800751 exclude_srcs: [
752 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
753 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
754 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700755 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800756 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700757 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800758 "arch-arm/krait/bionic/__strcat_chk.S",
759 "arch-arm/krait/bionic/__strcpy_chk.S",
760 ],
761 exclude_srcs: [
762 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
763 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
764 ],
765 },
766 cortex_a53: {
767 srcs: [
768 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
769 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
770 ],
771 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700772 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
773 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
774 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700775 },
Christopher Ferris3f54e7d2018-04-27 16:57:51 -0700776 cortex_a55: {
777 srcs: [
778 "arch-arm/denver/bionic/__strcat_chk.S",
779 "arch-arm/denver/bionic/__strcpy_chk.S",
780 ],
781 exclude_srcs: [
782 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
783 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
784 ],
785 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700786 cortex_a73: {
787 srcs: [
788 "arch-arm/denver/bionic/__strcat_chk.S",
789 "arch-arm/denver/bionic/__strcpy_chk.S",
790 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800791 exclude_srcs: [
792 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
793 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
794 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700795 },
Christopher Ferris3f54e7d2018-04-27 16:57:51 -0700796 cortex_a75: {
797 srcs: [
798 "arch-arm/denver/bionic/__strcat_chk.S",
799 "arch-arm/denver/bionic/__strcpy_chk.S",
800 ],
801 exclude_srcs: [
802 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
803 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
804 ],
805 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700806 denver: {
807 srcs: [
808 "arch-arm/denver/bionic/__strcat_chk.S",
809 "arch-arm/denver/bionic/__strcpy_chk.S",
810 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800811 exclude_srcs: [
812 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
813 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
814 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700815 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800816 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700817 srcs: [
818 "arch-arm/krait/bionic/__strcat_chk.S",
819 "arch-arm/krait/bionic/__strcpy_chk.S",
820 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800821 exclude_srcs: [
822 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
823 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700824 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700825 },
826 },
827 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700828 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700829 srcs: [
830 "arch-arm64/generic/bionic/__memcpy_chk.S",
831 ],
Karthik Gopalan48f23242018-03-26 10:45:32 +0530832 kryo: {
833 srcs: [
834 "arch-arm64/kryo/bionic/__memcpy_chk.S",
835 ],
836 exclude_srcs: [
837 "arch-arm64/generic/bionic/__memcpy_chk.S",
838 ],
839 },
Chitti Babu Theegalafe8ca912018-04-01 11:35:12 +0530840 kryo300: {
841 srcs: [
842 "arch-arm64/kryo300/bionic/__memcpy_chk.S",
843 ],
844 exclude_srcs: [
845 "arch-arm64/generic/bionic/__memcpy_chk.S",
846 ],
847 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700848 },
849 },
850}
851
852// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700853// libc_bionic.a - home-grown C library code
854// ========================================================
855
856cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700857 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700858 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700859 // The data that backs getauxval is initialized in the libc init
860 // functions which are invoked by the linker. If this file is included
861 // in libc_ndk.a, only one of the copies of the global data will be
862 // initialized, resulting in nullptr dereferences.
863 "bionic/getauxval.cpp",
864
Elliott Hughes211c4d32018-02-02 15:10:32 -0800865 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700866 "bionic/sysconf.cpp",
867 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700868 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700869
Josh Gao10ec9282017-04-03 15:13:29 -0700870 // The following must not be statically linked into libc_ndk.a, because
871 // debuggerd will look for the abort message in libc.so's copy.
872 "bionic/android_set_abort_message.cpp",
873
Dan Willemsen208ae172015-09-16 16:33:27 -0700874 "bionic/strchr.cpp",
875 "bionic/strnlen.c",
876 "bionic/strrchr.cpp",
877 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700878
879 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700880 arm: {
881 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800882 "arch-arm/generic/bionic/memcmp.S",
883 "arch-arm/generic/bionic/memcpy.S",
884 "arch-arm/generic/bionic/memset.S",
885 "arch-arm/generic/bionic/strcmp.S",
886 "arch-arm/generic/bionic/strcpy.S",
887 "arch-arm/generic/bionic/strlen.c",
888
Dan Willemsen208ae172015-09-16 16:33:27 -0700889 "arch-arm/bionic/atomics_arm.c",
890 "arch-arm/bionic/__bionic_clone.S",
891 "arch-arm/bionic/_exit_with_stack_teardown.S",
892 "arch-arm/bionic/libgcc_compat.c",
893 "arch-arm/bionic/popcount_tab.c",
894 "arch-arm/bionic/__restore.S",
895 "arch-arm/bionic/setjmp.S",
896 "arch-arm/bionic/syscall.S",
897 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700898 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800899 cortex_a7: {
900 srcs: [
901 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800902 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800903 ],
904 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800905 "arch-arm/cortex-a15/bionic/memcpy.S",
906 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800907 ],
908 },
909 cortex_a9: {
910 srcs: [
911 "arch-arm/cortex-a9/bionic/memcpy.S",
912 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800913
Colin Cross6ab8f892015-11-23 14:12:15 -0800914 "arch-arm/cortex-a9/bionic/stpcpy.S",
915 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800916 "arch-arm/cortex-a9/bionic/strcmp.S",
917 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800918 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800919 ],
920 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800921 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800922 "arch-arm/cortex-a15/bionic/memcpy.S",
923
Colin Cross6ab8f892015-11-23 14:12:15 -0800924 "arch-arm/cortex-a15/bionic/stpcpy.S",
925 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800926 "arch-arm/cortex-a15/bionic/strcmp.S",
927 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800928 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800929 ],
930 },
931 krait: {
932 srcs: [
933 "arch-arm/krait/bionic/memcpy.S",
934 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800935
Colin Cross6ab8f892015-11-23 14:12:15 -0800936 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800937 ],
938 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800939 "arch-arm/cortex-a15/bionic/memset.S",
940 "arch-arm/cortex-a15/bionic/memcpy.S",
941
942 "arch-arm/cortex-a15/bionic/strcmp.S",
943 ],
944 },
945 cortex_a53: {
946 srcs: [
947 "arch-arm/cortex-a53/bionic/memcpy.S",
948 "arch-arm/cortex-a7/bionic/memset.S",
949 ],
950 exclude_srcs: [
951 "arch-arm/cortex-a15/bionic/memset.S",
952 "arch-arm/cortex-a15/bionic/memcpy.S",
953 ],
954 },
Christopher Ferris3f54e7d2018-04-27 16:57:51 -0700955 cortex_a55: {
956 srcs: [
957 "arch-arm/cortex-a7/bionic/memset.S",
958 "arch-arm/denver/bionic/memcpy.S",
959
960 "arch-arm/krait/bionic/strcmp.S",
961 ],
962 exclude_srcs: [
963 "arch-arm/cortex-a15/bionic/memset.S",
964 "arch-arm/cortex-a15/bionic/memcpy.S",
965 "arch-arm/cortex-a15/bionic/strcmp.S",
966 ],
967 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800968 cortex_a73: {
969 srcs: [
970 "arch-arm/cortex-a7/bionic/memset.S",
971 "arch-arm/denver/bionic/memcpy.S",
972
973 "arch-arm/krait/bionic/strcmp.S",
974 ],
975 exclude_srcs: [
976 "arch-arm/cortex-a15/bionic/memset.S",
977 "arch-arm/cortex-a15/bionic/memcpy.S",
978 "arch-arm/cortex-a15/bionic/strcmp.S",
979 ],
980 },
Christopher Ferris3f54e7d2018-04-27 16:57:51 -0700981 cortex_a75: {
982 srcs: [
983 "arch-arm/cortex-a7/bionic/memset.S",
984 "arch-arm/denver/bionic/memcpy.S",
985
986 "arch-arm/krait/bionic/strcmp.S",
987 ],
988 exclude_srcs: [
989 "arch-arm/cortex-a15/bionic/memset.S",
990 "arch-arm/cortex-a15/bionic/memcpy.S",
991 "arch-arm/cortex-a15/bionic/strcmp.S",
992 ],
993 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800994 denver: {
995 srcs: [
996 "arch-arm/denver/bionic/memcpy.S",
997 "arch-arm/denver/bionic/memset.S",
998 ],
999 exclude_srcs: [
1000 "arch-arm/cortex-a15/bionic/memset.S",
1001 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001002 ],
1003 },
Christopher Ferris950a9582017-03-29 13:10:56 -07001004 kryo: {
1005 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -04001006 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -04001007 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001008
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001009 "arch-arm/krait/bionic/strcmp.S",
1010 ],
1011 exclude_srcs: [
1012 "arch-arm/cortex-a15/bionic/memset.S",
1013 "arch-arm/cortex-a15/bionic/memcpy.S",
1014 "arch-arm/cortex-a15/bionic/strcmp.S",
1015 ],
1016 },
1017 // Cores not listed above (like cortex-a8, cortex-a15) or
1018 // "generic" core will use the following implementation.
1019 neon: {
1020 srcs: [
1021 "arch-arm/cortex-a15/bionic/memcpy.S",
1022 "arch-arm/cortex-a15/bionic/memset.S",
1023
Christopher Ferris950a9582017-03-29 13:10:56 -07001024 "arch-arm/cortex-a15/bionic/stpcpy.S",
1025 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001026 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -07001027 "arch-arm/cortex-a15/bionic/strcpy.S",
1028 "arch-arm/cortex-a15/bionic/strlen.S",
1029
1030 "arch-arm/denver/bionic/memmove.S",
1031 ],
1032 exclude_srcs: [
1033 "arch-arm/generic/bionic/memcpy.S",
1034 "arch-arm/generic/bionic/memset.S",
1035 "arch-arm/generic/bionic/strcmp.S",
1036 "arch-arm/generic/bionic/strcpy.S",
1037 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -07001038 ],
1039 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001040 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001041 arm64: {
1042 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001043 "arch-arm64/generic/bionic/memchr.S",
1044 "arch-arm64/generic/bionic/memcmp.S",
1045 "arch-arm64/generic/bionic/memcpy.S",
1046 "arch-arm64/generic/bionic/memmove.S",
1047 "arch-arm64/generic/bionic/memset.S",
1048 "arch-arm64/generic/bionic/stpcpy.S",
1049 "arch-arm64/generic/bionic/strchr.S",
1050 "arch-arm64/generic/bionic/strcmp.S",
1051 "arch-arm64/generic/bionic/strcpy.S",
1052 "arch-arm64/generic/bionic/strlen.S",
1053 "arch-arm64/generic/bionic/strncmp.S",
1054 "arch-arm64/generic/bionic/strnlen.S",
1055 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001056
1057 "arch-arm64/bionic/__bionic_clone.S",
1058 "arch-arm64/bionic/_exit_with_stack_teardown.S",
1059 "arch-arm64/bionic/setjmp.S",
1060 "arch-arm64/bionic/syscall.S",
1061 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001062 ],
1063 exclude_srcs: [
1064 "bionic/__memcpy_chk.cpp",
1065 "bionic/strchr.cpp",
1066 "bionic/strnlen.c",
1067 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001068 denver64: {
1069 srcs: [
1070 "arch-arm64/denver64/bionic/memcpy.S",
1071 "arch-arm64/denver64/bionic/memset.S",
1072 ],
1073 exclude_srcs: [
1074 "arch-arm64/generic/bionic/memcpy.S",
1075 "arch-arm64/generic/bionic/memset.S",
1076 ],
1077 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001078 cortex_a53: {
1079 srcs: [
1080 "arch-arm64/cortex-a53/bionic/memmove.S",
1081 ],
1082 exclude_srcs: [
1083 "arch-arm64/generic/bionic/memmove.S",
1084 ],
1085 },
Christopher Ferris3f54e7d2018-04-27 16:57:51 -07001086 cortex_a55: {
1087 srcs: [
1088 "arch-arm64/cortex-a53/bionic/memmove.S",
1089 ],
1090 exclude_srcs: [
1091 "arch-arm64/generic/bionic/memmove.S",
1092 ],
1093 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001094 cortex_a73: {
1095 srcs: [
1096 "arch-arm64/cortex-a53/bionic/memmove.S",
1097 ],
1098 exclude_srcs: [
1099 "arch-arm64/generic/bionic/memmove.S",
1100 ],
1101 },
Christopher Ferris3f54e7d2018-04-27 16:57:51 -07001102 cortex_a75: {
1103 srcs: [
1104 "arch-arm64/cortex-a53/bionic/memmove.S",
1105 ],
1106 exclude_srcs: [
1107 "arch-arm64/generic/bionic/memmove.S",
1108 ],
1109 },
Chitti Babu Theegalac4e5fda2017-09-11 17:31:11 +05301110 kryo: {
1111 srcs: [
1112 "arch-arm64/kryo/bionic/memcpy.S",
1113 ],
1114 exclude_srcs: [
1115 "arch-arm64/generic/bionic/memcpy.S",
1116 ],
1117 },
Chitti Babu Theegalafe8ca912018-04-01 11:35:12 +05301118 kryo300: {
1119 srcs: [
1120 "arch-arm64/kryo300/bionic/memcpy.S",
1121 ],
1122 exclude_srcs: [
1123 "arch-arm64/generic/bionic/memcpy.S",
1124 ],
1125 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001126 },
1127
1128 mips: {
1129 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001130 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301131 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001132 "arch-mips/string/memset.S",
1133 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301134 "arch-mips/string/strncmp.S",
1135 "arch-mips/string/strlen.c",
1136 "arch-mips/string/strnlen.c",
1137 "arch-mips/string/strchr.c",
1138 "arch-mips/string/strcpy.c",
1139 "arch-mips/string/memchr.c",
1140 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001141
Dan Willemsen208ae172015-09-16 16:33:27 -07001142 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001143 "arch-mips/bionic/cacheflush.cpp",
1144 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001145 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001146 "arch-mips/bionic/setjmp.S",
1147 "arch-mips/bionic/syscall.S",
1148 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001149 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301150 exclude_srcs: [
1151 "bionic/strchr.cpp",
1152 "bionic/strnlen.c",
1153 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001154 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001155 mips64: {
1156 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001157 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301158 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001159 "arch-mips/string/memset.S",
1160 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301161 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001162 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301163 "arch-mips/string/strnlen.c",
1164 "arch-mips/string/strchr.c",
1165 "arch-mips/string/strcpy.c",
1166 "arch-mips/string/memchr.c",
1167 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001168
Dan Willemsen208ae172015-09-16 16:33:27 -07001169 "arch-mips64/bionic/__bionic_clone.S",
1170 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1171 "arch-mips64/bionic/setjmp.S",
1172 "arch-mips64/bionic/syscall.S",
1173 "arch-mips64/bionic/vfork.S",
1174 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001175 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301176 exclude_srcs: [
1177 "bionic/strchr.cpp",
1178 "bionic/strnlen.c",
1179 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001180 },
1181
1182 x86: {
1183 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001184 "arch-x86/generic/string/memcmp.S",
1185 "arch-x86/generic/string/strcmp.S",
1186 "arch-x86/generic/string/strncmp.S",
1187 "arch-x86/generic/string/strcat.S",
1188 "arch-x86/atom/string/sse2-memchr-atom.S",
1189 "arch-x86/atom/string/sse2-memrchr-atom.S",
1190 "arch-x86/atom/string/sse2-strchr-atom.S",
1191 "arch-x86/atom/string/sse2-strnlen-atom.S",
1192 "arch-x86/atom/string/sse2-strrchr-atom.S",
1193 "arch-x86/atom/string/sse2-wcschr-atom.S",
1194 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1195 "arch-x86/atom/string/sse2-wcslen-atom.S",
1196 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001197 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1198 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1199 "arch-x86/silvermont/string/sse2-memset-slm.S",
1200 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1201 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1202 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1203 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1204 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001205
1206 "arch-x86/bionic/__bionic_clone.S",
1207 "arch-x86/bionic/_exit_with_stack_teardown.S",
1208 "arch-x86/bionic/libgcc_compat.c",
1209 "arch-x86/bionic/__restore.S",
1210 "arch-x86/bionic/setjmp.S",
1211 "arch-x86/bionic/syscall.S",
1212 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001213 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001214
1215 exclude_srcs: [
1216 "bionic/strchr.cpp",
1217 "bionic/strnlen.c",
1218 "bionic/strrchr.cpp",
1219 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001220 atom: {
1221 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001222 "arch-x86/atom/string/sse2-memset-atom.S",
1223 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001224 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001225 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001226 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001227 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001228 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1229 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1230 ],
1231 exclude_srcs: [
1232 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001233 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1234 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1235 "arch-x86/silvermont/string/sse2-memset-slm.S",
1236 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1237 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1238 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1239 ],
1240 },
1241 ssse3: {
1242 srcs: [
1243 "arch-x86/atom/string/ssse3-strncat-atom.S",
1244 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1245 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1246 "arch-x86/atom/string/ssse3-strcat-atom.S",
1247 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1248 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1249 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1250 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1251 ],
1252 exclude_srcs: [
1253 "arch-x86/generic/string/strcmp.S",
1254 "arch-x86/generic/string/strncmp.S",
1255 "arch-x86/generic/string/strcat.S",
1256 ],
1257 },
1258 sse4: {
1259 srcs: [
1260 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1261 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1262 ],
1263 exclude_srcs: [
1264 "arch-x86/generic/string/memcmp.S",
1265 ],
1266 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001267 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001268 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001269 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001270 "arch-x86_64/string/sse2-memcpy-slm.S",
1271 "arch-x86_64/string/sse2-memmove-slm.S",
1272 "arch-x86_64/string/sse2-memset-slm.S",
1273 "arch-x86_64/string/sse2-stpcpy-slm.S",
1274 "arch-x86_64/string/sse2-stpncpy-slm.S",
1275 "arch-x86_64/string/sse2-strcat-slm.S",
1276 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001277 "arch-x86_64/string/sse2-strlen-slm.S",
1278 "arch-x86_64/string/sse2-strncat-slm.S",
1279 "arch-x86_64/string/sse2-strncpy-slm.S",
1280 "arch-x86_64/string/sse4-memcmp-slm.S",
1281 "arch-x86_64/string/ssse3-strcmp-slm.S",
1282 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001283
1284 "arch-x86_64/bionic/__bionic_clone.S",
1285 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1286 "arch-x86_64/bionic/__restore_rt.S",
1287 "arch-x86_64/bionic/setjmp.S",
1288 "arch-x86_64/bionic/syscall.S",
1289 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001290 ],
1291 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001292 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001293
Colin Cross50c21ab2015-10-31 23:03:05 -07001294 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001295 include_dirs: ["bionic/libstdc++/include"],
1296 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001297}
1298
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001299genrule {
1300 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001301 out: ["generated_android_ids.h"],
1302 srcs: [":android_filesystem_config_header"],
1303 tool_files: ["fs_config_generator.py"],
1304 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001305}
1306
Dan Willemsen268a6732015-10-15 14:49:45 -07001307// ========================================================
1308// libc_bionic_ndk.a- The portions of libc_bionic that can
1309// be safely used in libc_ndk.a (no troublesome global data
1310// or constructors).
1311// ========================================================
1312cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001313 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001314 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001315 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001316 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001317 "bionic/__cmsg_nxthdr.cpp",
1318 "bionic/__errno.cpp",
1319 "bionic/__gnu_basename.cpp",
1320 "bionic/__libc_current_sigrtmax.cpp",
1321 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001322 "bionic/abort.cpp",
1323 "bionic/accept.cpp",
1324 "bionic/accept4.cpp",
1325 "bionic/access.cpp",
1326 "bionic/arpa_inet.cpp",
1327 "bionic/assert.cpp",
1328 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001329 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001330 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001331 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001332 "bionic/bionic_systrace.cpp",
1333 "bionic/bionic_time_conversions.cpp",
1334 "bionic/brk.cpp",
1335 "bionic/c16rtomb.cpp",
1336 "bionic/c32rtomb.cpp",
1337 "bionic/chmod.cpp",
1338 "bionic/chown.cpp",
1339 "bionic/clearenv.cpp",
1340 "bionic/clock.cpp",
1341 "bionic/clock_getcpuclockid.cpp",
1342 "bionic/clock_nanosleep.cpp",
1343 "bionic/clone.cpp",
1344 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001345 "bionic/connect.cpp",
1346 "bionic/ctype.cpp",
1347 "bionic/dirent.cpp",
1348 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001349 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001350 "bionic/error.cpp",
1351 "bionic/eventfd_read.cpp",
1352 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001353 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001354 "bionic/faccessat.cpp",
1355 "bionic/fchmod.cpp",
1356 "bionic/fchmodat.cpp",
1357 "bionic/ffs.cpp",
1358 "bionic/fgetxattr.cpp",
1359 "bionic/flistxattr.cpp",
1360 "bionic/flockfile.cpp",
1361 "bionic/fpclassify.cpp",
1362 "bionic/fsetxattr.cpp",
1363 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001364 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001365 "bionic/futimens.cpp",
1366 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001367 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001368 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001369 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001370 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001371 "bionic/getpgrp.cpp",
1372 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001373 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001374 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001375 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001376 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001377 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001378 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001379 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001380 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001381 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001382 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001383 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001384 "bionic/lchown.cpp",
1385 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001386 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001387 "bionic/libgen.cpp",
1388 "bionic/link.cpp",
1389 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001390 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001391 "bionic/lstat.cpp",
1392 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001393 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001394 "bionic/mbrtoc16.cpp",
1395 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001396 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001397 "bionic/mempcpy.cpp",
1398 "bionic/mkdir.cpp",
1399 "bionic/mkfifo.cpp",
1400 "bionic/mknod.cpp",
1401 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001402 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001403 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001404 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001405 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001406 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001407 "bionic/open.cpp",
1408 "bionic/pathconf.cpp",
1409 "bionic/pause.cpp",
1410 "bionic/pipe.cpp",
1411 "bionic/poll.cpp",
1412 "bionic/posix_fadvise.cpp",
1413 "bionic/posix_fallocate.cpp",
1414 "bionic/posix_madvise.cpp",
1415 "bionic/posix_timers.cpp",
1416 "bionic/ptrace.cpp",
1417 "bionic/pty.cpp",
1418 "bionic/raise.cpp",
1419 "bionic/rand.cpp",
1420 "bionic/readlink.cpp",
1421 "bionic/reboot.cpp",
1422 "bionic/recv.cpp",
1423 "bionic/rename.cpp",
1424 "bionic/rmdir.cpp",
1425 "bionic/scandir.cpp",
1426 "bionic/sched_getaffinity.cpp",
1427 "bionic/sched_getcpu.cpp",
1428 "bionic/semaphore.cpp",
1429 "bionic/send.cpp",
1430 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001431 "bionic/seteuid.cpp",
1432 "bionic/setpgrp.cpp",
1433 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001434 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001435 "bionic/sigprocmask.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001436 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001437 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001438 "bionic/stat.cpp",
1439 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001440 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001441 "bionic/strchrnul.cpp",
1442 "bionic/strerror.cpp",
1443 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001444 "bionic/string_l.cpp",
1445 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001446 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001447 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001448 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001449 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001450 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001451 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001452 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001453 "bionic/sys_msg.cpp",
1454 "bionic/sys_sem.cpp",
1455 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001456 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001457 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001458 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001459 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001460 "bionic/sysinfo.cpp",
1461 "bionic/syslog.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001462 "bionic/system_property_api.cpp",
1463 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001464 "bionic/tdestroy.cpp",
1465 "bionic/termios.cpp",
1466 "bionic/thread_private.cpp",
1467 "bionic/tmpfile.cpp",
1468 "bionic/umount.cpp",
1469 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001470 "bionic/wait.cpp",
1471 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001472 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001473 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001474 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001475 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001476 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001477
1478 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1479 // which will be overridden by the actual one in libc.so.
1480 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001481 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001482
Dan Willemsen208ae172015-09-16 16:33:27 -07001483 multilib: {
1484 lib32: {
1485 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001486 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001487 },
1488 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001489 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001490 treble_linker_namespaces: {
1491 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001492 },
1493 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001494 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001495 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001496 local_include_dirs: ["stdio"],
1497 include_dirs: ["bionic/libstdc++/include"],
1498 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001499 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001500}
1501
Dan Willemsen208ae172015-09-16 16:33:27 -07001502// ========================================================
1503// libc_pthread.a - pthreads parts that previously lived in
1504// libc_bionic.a. Relocated to their own library because
1505// they can't be included in libc_ndk.a (as they layout of
1506// pthread_t has changed over the years and has ABI
1507// compatibility issues).
1508// ========================================================
1509
1510cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001511 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001512 srcs: [
1513 "bionic/pthread_atfork.cpp",
1514 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001515 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001516 "bionic/pthread_cond.cpp",
1517 "bionic/pthread_create.cpp",
1518 "bionic/pthread_detach.cpp",
1519 "bionic/pthread_equal.cpp",
1520 "bionic/pthread_exit.cpp",
1521 "bionic/pthread_getcpuclockid.cpp",
1522 "bionic/pthread_getschedparam.cpp",
1523 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001524 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001525 "bionic/pthread_join.cpp",
1526 "bionic/pthread_key.cpp",
1527 "bionic/pthread_kill.cpp",
1528 "bionic/pthread_mutex.cpp",
1529 "bionic/pthread_once.cpp",
1530 "bionic/pthread_rwlock.cpp",
1531 "bionic/pthread_self.cpp",
1532 "bionic/pthread_setname_np.cpp",
1533 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001534 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001535
1536 // The following implementations depend on pthread data or implementation,
1537 // so we can't include them in libc_ndk.a.
1538 "bionic/__cxa_thread_atexit_impl.cpp",
1539 "stdlib/atexit.c",
1540 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001541 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001542
Colin Cross50c21ab2015-10-31 23:03:05 -07001543 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001544 include_dirs: ["bionic/libstdc++/include"],
1545 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001546}
1547
1548// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001549// libc_syscalls.a
1550// ========================================================
1551
1552cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001553 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001554 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001555 arch: {
1556 arm: {
1557 srcs: ["arch-arm/syscalls/**/*.S"],
1558 },
1559 arm64: {
1560 srcs: ["arch-arm64/syscalls/**/*.S"],
1561 },
1562 mips: {
1563 srcs: ["arch-mips/syscalls/**/*.S"],
1564 },
1565 mips64: {
1566 srcs: ["arch-mips64/syscalls/**/*.S"],
1567 },
1568 x86: {
1569 srcs: ["arch-x86/syscalls/**/*.S"],
1570 },
1571 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001572 srcs: ["arch-x86_64/syscalls/**/*.S"],
1573 },
1574 },
1575 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001576}
1577
1578// ========================================================
1579// libc_aeabi.a
1580// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1581// to avoid infinite recursion. For the other architectures we just build an
1582// empty library to keep this makefile simple.
1583// ========================================================
1584
1585cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001586 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001587 arch: {
1588 arm: {
1589 srcs: ["arch-arm/bionic/__aeabi.c"],
1590 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001591 },
1592 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001593 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001594}
1595
1596// ========================================================
1597// libc_ndk.a
1598// Compatibility library for the NDK. This library contains
1599// all the parts of libc that are safe to statically link.
1600// We can't safely statically link things that can only run
1601// on a certain version of the OS. Examples include
1602// anything that talks to netd (a large portion of the DNS
1603// code) and anything that is dependent on the layout of a
1604// data structure that has changed across releases (such as
1605// pthread_t).
1606// ========================================================
1607
1608cc_library_static {
1609 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001610 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001611 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001612 multilib: {
1613 lib32: {
1614 srcs: libc_common_src_files_32,
1615 },
1616 },
1617 arch: {
1618 arm: {
1619 srcs: [
1620 "arch-arm/bionic/exidx_dynamic.c",
1621 "arch-common/bionic/crtbegin_so.c",
1622 "arch-arm/bionic/atexit_legacy.c",
1623 "arch-common/bionic/crtend_so.S",
1624 ],
1625 whole_static_libs: ["libc_aeabi"],
1626 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001627 },
1628
Colin Cross50c21ab2015-10-31 23:03:05 -07001629 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001630 "-fvisibility=hidden",
1631 "-DLIBC_STATIC",
1632 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001633
1634 whole_static_libs: [
1635 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001636 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001637 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001638 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001639 "libc_gdtoa",
1640 "libc_malloc",
1641 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001642 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001643 "libc_openbsd_ndk",
1644 "libc_stack_protector",
1645 "libc_syscalls",
1646 "libc_tzcode",
1647 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001648 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001649 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001650 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001651}
1652
1653// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001654// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001655// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001656cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001657 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001658 srcs: libc_common_src_files,
1659 multilib: {
1660 lib32: {
1661 srcs: libc_common_src_files_32,
1662 },
1663 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001664 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001665
1666 whole_static_libs: [
1667 "libc_bionic",
1668 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001669 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001670 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001671 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001672 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001673 "libc_gdtoa",
1674 "libc_malloc",
1675 "libc_netbsd",
1676 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001677 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001678 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001679 "libc_stack_protector",
1680 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001681 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001682 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001683 ],
1684
1685 arch: {
1686 arm: {
1687 whole_static_libs: ["libc_aeabi"],
1688 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001689 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001690}
1691
1692// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001693// libc_common.a
1694// ========================================================
1695
1696cc_library_static {
1697 defaults: ["libc_defaults"],
1698 name: "libc_common",
1699
1700 whole_static_libs: [
1701 "libc_nopthread",
1702 "libc_pthread",
1703 ],
1704}
1705
1706// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001707// libc_nomalloc.a
1708// ========================================================
1709//
1710// This is a version of the static C library that does not
1711// include malloc. It's useful in situations when the user wants
1712// to provide their own malloc implementation, or wants to
1713// explicitly disallow the use of malloc, such as in the
1714// dynamic linker.
1715
1716cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001717 name: "libc_nomalloc",
1718
Colin Cross50c21ab2015-10-31 23:03:05 -07001719 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001720
1721 arch: {
1722 arm: {
1723 srcs: ["arch-arm/bionic/exidx_static.c"],
1724 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001725 },
1726
Colin Cross50c21ab2015-10-31 23:03:05 -07001727 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001728
Colin Crossa3f9fca2016-01-11 13:20:55 -08001729 whole_static_libs: [
1730 "libc_common",
1731 "libc_init_static",
1732 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001733}
1734
1735// ========================================================
1736// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1737// ========================================================
1738cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001739 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001740 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001741 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001742
Dan Willemsen208ae172015-09-16 16:33:27 -07001743 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001744}
1745
1746// ========================================================
1747// libc.a + libc.so
1748// ========================================================
1749cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001750 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001751 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001752 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001753 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001754 platform_sdk_version: {
1755 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1756 },
1757 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001758 static: {
1759 srcs: [
1760 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001761 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001762 ],
1763 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001764 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001765 },
1766 shared: {
1767 srcs: [
1768 "arch-common/bionic/crtbegin_so.c",
1769 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001770 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001771 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001772 "bionic/NetdClient.cpp",
1773 "arch-common/bionic/crtend_so.S",
1774 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001775 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001776 },
1777
1778 required: ["tzdata"],
1779
1780 // Leave the symbols in the shared library so that stack unwinders can produce
1781 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001782 strip: {
1783 keep_symbols: true,
1784 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001785
Colin Cross4ce94d22016-11-15 13:15:43 -08001786 // Do not pack libc.so relocations; see http://b/20645321 for details.
1787 pack_relocations: false,
1788
dimitry06016f22018-01-05 11:39:28 +01001789 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1790 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1791 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1792 // those new libraries from libgcc.a are not declared external; if that were the case,
1793 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1794 // on the external symbols from the dependent libraries. That would create a "cloaked"
1795 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001796
dimitry06016f22018-01-05 11:39:28 +01001797 shared_libs: [
1798 "ld-android",
1799 "libdl",
1800 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001801 whole_static_libs: [
1802 "libc_common",
1803 "libjemalloc",
1804 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001805
1806 nocrt: true,
1807
Dan Willemsen208ae172015-09-16 16:33:27 -07001808 arch: {
1809 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001810 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1811 ldflags: ["-Wl,--hash-style=both"],
1812
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001813 // Don't re-export new/delete and friends, even if the compiler really wants to.
1814 version_script: "libc.arm.map",
1815
Dan Willemsen208ae172015-09-16 16:33:27 -07001816 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001817 srcs: [
1818 "arch-arm/bionic/exidx_dynamic.c",
1819
1820 // special for arm
1821 "arch-arm/bionic/atexit_legacy.c",
1822 ],
1823 // special for arm
1824 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001825 },
1826 static: {
1827 srcs: ["arch-arm/bionic/exidx_static.c"],
1828 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001829 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001830 arm64: {
1831 // Don't re-export new/delete and friends, even if the compiler really wants to.
1832 version_script: "libc.arm64.map",
1833 },
1834 mips: {
1835 // Don't re-export new/delete and friends, even if the compiler really wants to.
1836 version_script: "libc.mips.map",
1837 },
1838 mips64: {
1839 // Don't re-export new/delete and friends, even if the compiler really wants to.
1840 version_script: "libc.mips64.map",
1841 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001842 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001843 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1844 ldflags: ["-Wl,--hash-style=both"],
1845
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001846 // Don't re-export new/delete and friends, even if the compiler really wants to.
1847 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001848 },
1849 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001850 // Don't re-export new/delete and friends, even if the compiler really wants to.
1851 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001852 },
1853 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001854}
1855
Dan Willemsen208ae172015-09-16 16:33:27 -07001856// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001857// libstdc++.so + libstdc++.a
1858// ========================================================
1859cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001860 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001861 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001862 srcs: [
1863 "bionic/__cxa_guard.cpp",
1864 "bionic/__cxa_pure_virtual.cpp",
1865 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001866 ],
1867 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001868 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001869 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001870 static_libs: ["libasync_safe"],
Rashed Abdel-Tawab5ffc14a2018-04-15 10:18:26 -07001871 vendor_available: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001872
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001873 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001874 arch: {
1875 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001876 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001877 version_script: "libstdc++.arm.map",
1878 },
1879 arm64: {
1880 version_script: "libstdc++.arm64.map",
1881 },
1882 mips: {
1883 version_script: "libstdc++.mips.map",
1884 },
1885 mips64: {
1886 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001887 },
1888 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001889 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001890 version_script: "libstdc++.x86.map",
1891 },
1892 x86_64: {
1893 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001894 },
1895 },
1896}
1897
Colin Cross50c21ab2015-10-31 23:03:05 -07001898cc_defaults {
1899 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001900 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001901 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001902
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001903 cflags: [
1904 "-Wno-gcc-compat",
1905 "-Wall",
1906 "-Werror",
1907 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001908}
1909
Colin Cross50c21ab2015-10-31 23:03:05 -07001910cc_defaults {
1911 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001912 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001913
1914 arch: {
1915 mips: {
1916 cflags: ["-fPIC"],
1917 },
1918 mips64: {
1919 cflags: ["-fPIC"],
1920 },
1921 x86: {
1922 cflags: ["-fPIC"],
1923 },
1924 x86_64: {
1925 cflags: ["-fPIC"],
1926 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001927 },
1928}
1929
Dan Willemsena3ed9012017-04-04 15:51:26 -07001930// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001931cc_object {
1932 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001933 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001934 local_include_dirs: ["include"],
1935 product_variables: {
1936 platform_sdk_version: {
1937 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1938 },
1939 },
1940 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001941
Colin Cross7d7b3682017-11-03 13:38:40 -07001942 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001943}
1944
Dan Willemsen208ae172015-09-16 16:33:27 -07001945cc_object {
1946 name: "crtbegin_so1",
1947 local_include_dirs: ["include"],
1948 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001949
Colin Cross7d7b3682017-11-03 13:38:40 -07001950 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001951}
1952
Dan Willemsen208ae172015-09-16 16:33:27 -07001953cc_object {
1954 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001955
Colin Cross7d7b3682017-11-03 13:38:40 -07001956 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001957 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001958 "crtbegin_so1",
1959 "crtbrand",
1960 ],
1961}
1962
Dan Willemsen208ae172015-09-16 16:33:27 -07001963cc_object {
1964 name: "crtend_so",
1965 local_include_dirs: ["include"],
1966 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001967
Colin Cross7d7b3682017-11-03 13:38:40 -07001968 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001969}
1970
Dan Willemsen208ae172015-09-16 16:33:27 -07001971cc_object {
1972 name: "crtbegin_static1",
1973 local_include_dirs: ["include"],
1974 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001975
Colin Cross50c21ab2015-10-31 23:03:05 -07001976 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001977 mips: {
1978 srcs: [
1979 "arch-mips/bionic/crtbegin.c",
1980 ],
1981 exclude_srcs: [
1982 "arch-common/bionic/crtbegin.c",
1983 ],
1984 },
1985 mips64: {
1986 srcs: [
1987 "arch-mips64/bionic/crtbegin.c",
1988 ],
1989 exclude_srcs: [
1990 "arch-common/bionic/crtbegin.c",
1991 ],
1992 },
1993 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001994
1995 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001996}
1997
Dan Willemsen208ae172015-09-16 16:33:27 -07001998cc_object {
1999 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07002000
Colin Cross77d57bf2016-04-11 14:34:18 -07002001 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002002 "crtbegin_static1",
2003 "crtbrand",
2004 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07002005 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002006}
2007
Dan Willemsen208ae172015-09-16 16:33:27 -07002008cc_object {
2009 name: "crtbegin_dynamic1",
2010 local_include_dirs: ["include"],
2011 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002012
Colin Cross50c21ab2015-10-31 23:03:05 -07002013 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07002014 mips: {
2015 srcs: [
2016 "arch-mips/bionic/crtbegin.c",
2017 ],
2018 exclude_srcs: [
2019 "arch-common/bionic/crtbegin.c",
2020 ],
2021 },
2022 mips64: {
2023 srcs: [
2024 "arch-mips64/bionic/crtbegin.c",
2025 ],
2026 exclude_srcs: [
2027 "arch-common/bionic/crtbegin.c",
2028 ],
2029 },
2030 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002031 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002032}
2033
Dan Willemsen208ae172015-09-16 16:33:27 -07002034cc_object {
2035 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07002036
Colin Cross77d57bf2016-04-11 14:34:18 -07002037 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07002038 "crtbegin_dynamic1",
2039 "crtbrand",
2040 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07002041 target: {
2042 linux_bionic: {
2043 generated_sources: ["host_bionic_linker_asm"],
2044 objs: [
2045 "linker_wrapper",
2046 ],
2047 },
2048 },
Colin Cross50c21ab2015-10-31 23:03:05 -07002049 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002050}
2051
Dan Willemsen208ae172015-09-16 16:33:27 -07002052cc_object {
2053 // We rename crtend.o to crtend_android.o to avoid a
2054 // name clash between gcc and bionic.
2055 name: "crtend_android",
2056 local_include_dirs: ["include"],
2057 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002058
Colin Cross50c21ab2015-10-31 23:03:05 -07002059 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002060}
Colin Crossbaa48992016-07-13 11:15:21 -07002061
Dan Albert22805ea2017-03-22 15:28:05 -07002062preprocessed_ndk_headers {
2063 name: "common_libc",
2064 from: "include",
2065 to: "",
2066 license: "NOTICE",
2067}
Dan Albert4238a352016-06-28 11:18:05 -07002068
2069ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002070 name: "libc_uapi",
2071 from: "kernel/uapi",
2072 to: "",
2073 srcs: [
2074 "kernel/uapi/asm-generic/**/*.h",
2075 "kernel/uapi/drm/**/*.h",
2076 "kernel/uapi/linux/**/*.h",
2077 "kernel/uapi/misc/**/*.h",
2078 "kernel/uapi/mtd/**/*.h",
2079 "kernel/uapi/rdma/**/*.h",
2080 "kernel/uapi/scsi/**/*.h",
2081 "kernel/uapi/sound/**/*.h",
2082 "kernel/uapi/video/**/*.h",
2083 "kernel/uapi/xen/**/*.h",
2084 ],
Dan Albert92592652016-10-20 01:42:54 -07002085 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002086}
2087
2088ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002089 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002090 from: "kernel/android/uapi/linux",
2091 to: "linux",
2092 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002093 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002094}
2095
2096ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002097 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002098 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002099 to: "scsi",
2100 srcs: ["kernel/android/scsi/**/*.h"],
2101 license: "NOTICE",
2102}
2103
2104ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002105 name: "libc_asm_arm",
2106 from: "kernel/uapi/asm-arm",
2107 to: "arm-linux-androideabi",
2108 srcs: ["kernel/uapi/asm-arm/**/*.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_arm64",
2114 from: "kernel/uapi/asm-arm64",
2115 to: "aarch64-linux-android",
2116 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002117 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002118}
2119
Elliott Hughesee291c02017-12-11 11:32:34 -08002120// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002121ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002122 name: "libc_asm_mips",
2123 from: "kernel/uapi/asm-mips",
2124 to: "mipsel-linux-android",
2125 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2126 license: "NOTICE",
2127}
2128
Elliott Hughesee291c02017-12-11 11:32:34 -08002129// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002130ndk_headers {
2131 name: "libc_asm_mips64",
2132 from: "kernel/uapi/asm-mips",
2133 to: "mips64el-linux-android",
2134 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2135 license: "NOTICE",
2136}
2137
2138ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002139 name: "libc_asm_x86",
2140 from: "kernel/uapi/asm-x86",
2141 to: "i686-linux-android",
2142 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002143 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002144}
2145
2146ndk_headers {
2147 name: "libc_asm_x86_64",
2148 from: "kernel/uapi/asm-x86",
2149 to: "x86_64-linux-android",
2150 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002151 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002152}
2153
Dan Albert4238a352016-06-28 11:18:05 -07002154ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002155 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002156 symbol_file: "libc.map.txt",
2157 first_version: "9",
2158}
2159
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002160llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002161 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002162 symbol_file: "libc.map.txt",
2163 export_headers_as_system: true,
2164 export_preprocessed_headers: ["include"],
2165 arch: {
2166 arm: {
2167 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002168 "kernel/uapi",
2169 "kernel/uapi/asm-arm",
2170 "kernel/android/uapi",
2171 ],
2172 },
2173 arm64: {
2174 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002175 "kernel/uapi",
2176 "kernel/uapi/asm-arm64",
2177 "kernel/android/uapi",
2178 ],
2179 },
2180 mips: {
2181 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002182 "kernel/uapi",
2183 "kernel/uapi/asm-mips",
2184 "kernel/android/uapi",
2185 ],
2186 },
2187 mips64: {
2188 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002189 "kernel/uapi",
2190 "kernel/uapi/asm-mips",
2191 "kernel/android/uapi",
2192 ],
2193 },
2194 x86: {
2195 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002196 "kernel/uapi",
2197 "kernel/uapi/asm-x86",
2198 "kernel/android/uapi",
2199 ],
2200 },
2201 x86_64: {
2202 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002203 "kernel/uapi",
2204 "kernel/uapi/asm-x86",
2205 "kernel/android/uapi",
2206 ],
2207 },
2208 },
2209}
2210
Dan Albertdf31aff2016-10-06 15:50:41 -07002211ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002212 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002213 symbol_file: "libstdc++.map.txt",
2214 first_version: "9",
2215}
2216
Dan Willemsenca056d72018-01-08 14:00:24 -08002217// Export these headers for toolbox to process
2218filegroup {
2219 name: "kernel_input_headers",
2220 srcs: [
2221 "kernel/uapi/linux/input.h",
2222 "kernel/uapi/linux/input-event-codes.h",
2223 ],
2224}