blob: f5e2285c0f3e3a254128f1d17029d76e071b3fd4 [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001// Define the common source files for all the libc instances
2// =========================================================
3libc_common_src_files = [
Christopher Ferris7a3681e2017-04-24 17:48:32 -07004 "async_safe/async_safe_log.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07005 "bionic/ether_aton.c",
6 "bionic/ether_ntoa.c",
7 "bionic/fts.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07008 "bionic/initgroups.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07009 "bionic/isatty.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070010 "bionic/pututline.c",
11 "bionic/sched_cpualloc.c",
12 "bionic/sched_cpucount.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070013 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070014 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070015 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080016 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070017 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080018 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070019 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070021]
22
23// Various kinds of cruft.
24// ========================================================
25libc_common_src_files += [
26 "bionic/ndk_cruft.cpp",
27]
28
29libc_common_src_files_32 = [
30 "bionic/legacy_32_bit_support.cpp",
31 "bionic/time64.c",
32]
33
Elliott Hughes53cf3482016-08-09 13:06:41 -070034libc_common_flags = [
35 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080036 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070037 "-Wall",
38 "-Wextra",
39 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080040 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070041 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070042 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070043 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070044
45 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
46 "-Werror=pointer-to-int-cast",
47 "-Werror=int-to-pointer-cast",
48 "-Werror=type-limits",
49 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080050
51 // Clang's exit-time destructor registration hides __dso_handle, but
52 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
53 "-Wexit-time-destructors",
Elliott Hughes53cf3482016-08-09 13:06:41 -070054]
55
Dan Willemsen208ae172015-09-16 16:33:27 -070056// Define some common cflags
57// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070058cc_defaults {
59 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080060 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070061 cflags: libc_common_flags,
62 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070063 conlyflags: ["-std=gnu99"],
64 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070065 include_dirs: [
66 "bionic/libc/async_safe/include",
67 "external/jemalloc/include",
68 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070069
Colin Cross50c21ab2015-10-31 23:03:05 -070070 stl: "none",
71 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070072 sanitize: {
73 never: true,
74 },
Colin Cross50c21ab2015-10-31 23:03:05 -070075 native_coverage: false,
Jiyong Park5603c6e2018-04-27 21:53:11 +090076 recovery_available: true,
Dan Willemsen208ae172015-09-16 16:33:27 -070077}
78
Dan Willemsen208ae172015-09-16 16:33:27 -070079// ANDROIDMK TRANSLATION ERROR: unsupported directive
80// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
81//libc_common_cflags += ["-DDEBUG"]
82// ANDROIDMK TRANSLATION ERROR: unsupported directive
83// endif
84
Dan Willemsen208ae172015-09-16 16:33:27 -070085// ========================================================
86// libc_stack_protector.a - stack protector code
87// ========================================================
88//
Colin Crossa3f9fca2016-01-11 13:20:55 -080089// Code that implements the stack protector (or that runs
90// before TLS has been set up) needs to be compiled with
91// -fno-stack-protector, since it accesses the stack canary
92// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070093
94cc_library_static {
95
Colin Crossa3f9fca2016-01-11 13:20:55 -080096 srcs: [
97 "bionic/__libc_init_main_thread.cpp",
98 "bionic/__stack_chk_fail.cpp",
99 ],
100 arch: {
101 arm64: {
102 srcs: ["arch-arm64/bionic/__set_tls.c"],
103 },
104 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800105 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800106 },
107 x86_64: {
108 srcs: ["arch-x86_64/bionic/__set_tls.c"],
109 },
110 },
111
Colin Cross50c21ab2015-10-31 23:03:05 -0700112 defaults: ["libc_defaults"],
113 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700114 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700115}
116
Colin Crossa3f9fca2016-01-11 13:20:55 -0800117// libc_init_static.cpp also needs to be built without stack protector,
118// because it's responsible for setting up TLS for static executables.
119// This isn't the case for dynamic executables because the dynamic linker
120// has already set up the main thread's TLS.
121
122cc_library_static {
123 name: "libc_init_static",
124 defaults: ["libc_defaults"],
125 srcs: ["bionic/libc_init_static.cpp"],
126 cflags: ["-fno-stack-protector"],
127}
128
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700129cc_library_static {
130 name: "libc_init_dynamic",
131 defaults: ["libc_defaults"],
132 srcs: ["bionic/libc_init_dynamic.cpp"],
133 cflags: ["-fno-stack-protector"],
134}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800135
Dan Willemsen208ae172015-09-16 16:33:27 -0700136// ========================================================
137// libc_tzcode.a - upstream 'tzcode' code
138// ========================================================
139
140cc_library_static {
141
Colin Cross50c21ab2015-10-31 23:03:05 -0700142 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700143 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800144 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700145 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700146 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
147 ],
148
Colin Cross50c21ab2015-10-31 23:03:05 -0700149 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700150 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700151 // Don't use ridiculous amounts of stack.
152 "-DALL_STATE",
153 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
154 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800155 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700156 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700157 // The name of the tm_gmtoff field in our struct tm.
158 "-DTM_GMTOFF=tm_gmtoff",
159 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700160 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700161 // Include `tzname`, `timezone`, and `daylight` globals.
162 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700163 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800164 // Use the empty string (instead of " ") as the timezone abbreviation
165 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700166 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700167 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
168 "-Dlint",
169 ],
170
Dan Willemsen208ae172015-09-16 16:33:27 -0700171 local_include_dirs: ["tzcode/"],
172 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700173}
174
175// ========================================================
176// libc_dns.a - modified NetBSD DNS code
177// ========================================================
178
179cc_library_static {
180
Colin Cross50c21ab2015-10-31 23:03:05 -0700181 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700182 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800183 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700184
185 "upstream-netbsd/lib/libc/isc/ev_streams.c",
186 "upstream-netbsd/lib/libc/isc/ev_timers.c",
187 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700188 ],
189
Colin Cross50c21ab2015-10-31 23:03:05 -0700190 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700191 "-DANDROID_CHANGES",
192 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700193 "-Wno-unused-parameter",
194 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700195 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700196 ],
197
Dan Willemsen208ae172015-09-16 16:33:27 -0700198 local_include_dirs: [
199 "dns/include",
200 "private",
201 "upstream-netbsd/lib/libc/include",
202 "upstream-netbsd/android/include",
203 ],
204
205 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700206}
207
208// ========================================================
209// libc_freebsd.a - upstream FreeBSD C library code
210// ========================================================
211//
212// These files are built with the freebsd-compat.h header file
213// automatically included.
214
215cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700216 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700217 srcs: [
218 "upstream-freebsd/lib/libc/gen/ldexp.c",
219 "upstream-freebsd/lib/libc/gen/sleep.c",
220 "upstream-freebsd/lib/libc/gen/usleep.c",
221 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700222 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
223 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
224 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
225 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700226 "upstream-freebsd/lib/libc/stdlib/qsort.c",
227 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700228 "upstream-freebsd/lib/libc/string/wcpcpy.c",
229 "upstream-freebsd/lib/libc/string/wcpncpy.c",
230 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700231 "upstream-freebsd/lib/libc/string/wcscat.c",
232 "upstream-freebsd/lib/libc/string/wcschr.c",
233 "upstream-freebsd/lib/libc/string/wcscmp.c",
234 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700235 "upstream-freebsd/lib/libc/string/wcscspn.c",
236 "upstream-freebsd/lib/libc/string/wcsdup.c",
237 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700238 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700239 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
240 "upstream-freebsd/lib/libc/string/wcsncat.c",
241 "upstream-freebsd/lib/libc/string/wcsncmp.c",
242 "upstream-freebsd/lib/libc/string/wcsncpy.c",
243 "upstream-freebsd/lib/libc/string/wcsnlen.c",
244 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700245 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700246 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700247 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700248 "upstream-freebsd/lib/libc/string/wcstok.c",
249 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700250 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700251 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700252 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800253 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700254 ],
255 arch: {
256 arm64: {
257 exclude_srcs: [
258 "upstream-freebsd/lib/libc/string/wmemmove.c",
259 ],
260 },
261 x86: {
262 exclude_srcs: [
263 "upstream-freebsd/lib/libc/string/wcschr.c",
264 "upstream-freebsd/lib/libc/string/wcscmp.c",
265 "upstream-freebsd/lib/libc/string/wcslen.c",
266 "upstream-freebsd/lib/libc/string/wcsrchr.c",
267 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800268 atom: {
269 exclude_srcs: [
270 "upstream-freebsd/lib/libc/string/wmemcmp.c",
271 ],
272 },
273 ssse3: {
274 exclude_srcs: [
275 "upstream-freebsd/lib/libc/string/wcscat.c",
276 "upstream-freebsd/lib/libc/string/wcscpy.c",
277 ],
278 },
279 sse4: {
280 exclude_srcs: [
281 "upstream-freebsd/lib/libc/string/wmemcmp.c",
282 ],
283 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700284 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700285 },
286
Colin Cross50c21ab2015-10-31 23:03:05 -0700287 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700288 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700289 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700290 "-include freebsd-compat.h",
291 ],
292
Dan Willemsen208ae172015-09-16 16:33:27 -0700293 local_include_dirs: [
294 "upstream-freebsd/android/include",
295 ],
296
297 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700298}
299
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700300cc_library_static {
301 defaults: ["libc_defaults"],
302 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700303 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700304 "upstream-freebsd/lib/libc/stdlib/realpath.c",
305 ],
306
307 cflags: [
308 "-Wno-sign-compare",
309 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700310 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700311 ],
312
313 local_include_dirs: [
314 "upstream-freebsd/android/include",
315 ],
316
317 name: "libc_freebsd_large_stack",
318}
319
Dan Willemsen208ae172015-09-16 16:33:27 -0700320// ========================================================
321// libc_netbsd.a - upstream NetBSD C library code
322// ========================================================
323//
324// These files are built with the netbsd-compat.h header file
325// automatically included.
326
327cc_library_static {
328
Colin Cross50c21ab2015-10-31 23:03:05 -0700329 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700330 srcs: [
331 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700332 "upstream-netbsd/lib/libc/gen/nice.c",
333 "upstream-netbsd/lib/libc/gen/popen.c",
334 "upstream-netbsd/lib/libc/gen/psignal.c",
335 "upstream-netbsd/lib/libc/gen/utime.c",
336 "upstream-netbsd/lib/libc/gen/utmp.c",
337 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
338 "upstream-netbsd/lib/libc/regex/regcomp.c",
339 "upstream-netbsd/lib/libc/regex/regerror.c",
340 "upstream-netbsd/lib/libc/regex/regexec.c",
341 "upstream-netbsd/lib/libc/regex/regfree.c",
342 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
343 "upstream-netbsd/lib/libc/stdlib/div.c",
344 "upstream-netbsd/lib/libc/stdlib/drand48.c",
345 "upstream-netbsd/lib/libc/stdlib/erand48.c",
346 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
347 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
348 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
349 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
350 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
351 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
352 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
353 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
354 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
355 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
356 "upstream-netbsd/lib/libc/stdlib/seed48.c",
357 "upstream-netbsd/lib/libc/stdlib/srand48.c",
358 "upstream-netbsd/lib/libc/string/memccpy.c",
359 "upstream-netbsd/lib/libc/string/strcasestr.c",
360 "upstream-netbsd/lib/libc/string/strcoll.c",
361 "upstream-netbsd/lib/libc/string/strxfrm.c",
362 ],
363 multilib: {
364 lib32: {
365 // LP32 cruft
366 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
367 },
368 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700369 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700370 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800371 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700372 "-DPOSIX_MISTAKE",
373 "-include netbsd-compat.h",
374 ],
375
Dan Willemsen208ae172015-09-16 16:33:27 -0700376 local_include_dirs: [
377 "upstream-netbsd/android/include",
378 "upstream-netbsd/lib/libc/include",
379 ],
380
381 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700382}
383
384// ========================================================
385// libc_openbsd_ndk.a - upstream OpenBSD C library code
386// that can be safely included in the libc_ndk.a (doesn't
387// contain any troublesome global data or constructors).
388// ========================================================
389//
390// These files are built with the openbsd-compat.h header file
391// automatically included.
392
393cc_library_static {
394 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700395 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700396 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700397 "upstream-openbsd/lib/libc/gen/alarm.c",
398 "upstream-openbsd/lib/libc/gen/ctype_.c",
399 "upstream-openbsd/lib/libc/gen/daemon.c",
400 "upstream-openbsd/lib/libc/gen/err.c",
401 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700402 "upstream-openbsd/lib/libc/gen/fnmatch.c",
403 "upstream-openbsd/lib/libc/gen/ftok.c",
404 "upstream-openbsd/lib/libc/gen/getprogname.c",
405 "upstream-openbsd/lib/libc/gen/isctype.c",
406 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700407 "upstream-openbsd/lib/libc/gen/tolower_.c",
408 "upstream-openbsd/lib/libc/gen/toupper_.c",
409 "upstream-openbsd/lib/libc/gen/verr.c",
410 "upstream-openbsd/lib/libc/gen/verrx.c",
411 "upstream-openbsd/lib/libc/gen/vwarn.c",
412 "upstream-openbsd/lib/libc/gen/vwarnx.c",
413 "upstream-openbsd/lib/libc/gen/warn.c",
414 "upstream-openbsd/lib/libc/gen/warnx.c",
415 "upstream-openbsd/lib/libc/locale/btowc.c",
416 "upstream-openbsd/lib/libc/locale/mbrlen.c",
417 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
418 "upstream-openbsd/lib/libc/locale/mbtowc.c",
419 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700420 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
421 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700422 "upstream-openbsd/lib/libc/locale/wcstoll.c",
423 "upstream-openbsd/lib/libc/locale/wcstombs.c",
424 "upstream-openbsd/lib/libc/locale/wcstoul.c",
425 "upstream-openbsd/lib/libc/locale/wcstoull.c",
426 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
427 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
428 "upstream-openbsd/lib/libc/locale/wctob.c",
429 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700430 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700431 "upstream-openbsd/lib/libc/net/htonl.c",
432 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700433 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
434 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
435 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700436 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
437 "upstream-openbsd/lib/libc/net/inet_ntop.c",
438 "upstream-openbsd/lib/libc/net/inet_pton.c",
439 "upstream-openbsd/lib/libc/net/ntohl.c",
440 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800441 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
444 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700445 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700447 "upstream-openbsd/lib/libc/stdio/fputwc.c",
448 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700449 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
450 "upstream-openbsd/lib/libc/stdio/fwalk.c",
451 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700452 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700454 "upstream-openbsd/lib/libc/stdio/makebuf.c",
455 "upstream-openbsd/lib/libc/stdio/mktemp.c",
456 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
457 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700458 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700459 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700460 "upstream-openbsd/lib/libc/stdio/tempnam.c",
461 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
462 "upstream-openbsd/lib/libc/stdio/ungetc.c",
463 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
464 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
465 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700466 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
467 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
468 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700469 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/stdio/wsetup.c",
471 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700472 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700473 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700474 "upstream-openbsd/lib/libc/stdlib/insque.c",
475 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
476 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
477 "upstream-openbsd/lib/libc/stdlib/labs.c",
478 "upstream-openbsd/lib/libc/stdlib/llabs.c",
479 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
480 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
481 "upstream-openbsd/lib/libc/stdlib/remque.c",
482 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700483 "upstream-openbsd/lib/libc/stdlib/tfind.c",
484 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
485 "upstream-openbsd/lib/libc/string/strcasecmp.c",
486 "upstream-openbsd/lib/libc/string/strcspn.c",
487 "upstream-openbsd/lib/libc/string/strdup.c",
488 "upstream-openbsd/lib/libc/string/strndup.c",
489 "upstream-openbsd/lib/libc/string/strpbrk.c",
490 "upstream-openbsd/lib/libc/string/strsep.c",
491 "upstream-openbsd/lib/libc/string/strspn.c",
492 "upstream-openbsd/lib/libc/string/strstr.c",
493 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700494 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700495 "upstream-openbsd/lib/libc/string/wcswidth.c",
496 ],
497
Colin Cross50c21ab2015-10-31 23:03:05 -0700498 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700499 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700500 "-Wno-unused-parameter",
501 "-include openbsd-compat.h",
502 ],
503
Dan Willemsen208ae172015-09-16 16:33:27 -0700504 local_include_dirs: [
505 "private",
506 "stdio",
507 "upstream-openbsd/android/include",
508 "upstream-openbsd/lib/libc/include",
509 "upstream-openbsd/lib/libc/gdtoa/",
510 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700511}
512
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700513cc_library_static {
514 name: "libc_openbsd_large_stack",
515 defaults: ["libc_defaults"],
516 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700517 "stdio/vfprintf.cpp",
518 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700519 ],
520 cflags: [
521 "-include openbsd-compat.h",
522 "-Wno-sign-compare",
523 "-Wframe-larger-than=5000",
524 ],
525
526 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700527 "upstream-openbsd/android/include/",
528 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700529 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700530 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700531 ],
532}
533
Dan Willemsen208ae172015-09-16 16:33:27 -0700534// ========================================================
535// libc_openbsd.a - upstream OpenBSD C library code
536// ========================================================
537//
538// These files are built with the openbsd-compat.h header file
539// automatically included.
540cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700541 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700542 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800543 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700544 "upstream-openbsd/lib/libc/crypt/arc4random.c",
545 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
546
547 // May be overriden by per-arch optimized versions
548 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700549 "upstream-openbsd/lib/libc/string/memrchr.c",
550 "upstream-openbsd/lib/libc/string/stpcpy.c",
551 "upstream-openbsd/lib/libc/string/stpncpy.c",
552 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700553 "upstream-openbsd/lib/libc/string/strcpy.c",
554 "upstream-openbsd/lib/libc/string/strlcat.c",
555 "upstream-openbsd/lib/libc/string/strlcpy.c",
556 "upstream-openbsd/lib/libc/string/strncat.c",
557 "upstream-openbsd/lib/libc/string/strncmp.c",
558 "upstream-openbsd/lib/libc/string/strncpy.c",
559 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700560
561 arch: {
562 arm: {
563 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700564 "upstream-openbsd/lib/libc/string/strcpy.c",
565 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800566 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700567 exclude_srcs: [
Christopher Ferris950a9582017-03-29 13:10:56 -0700568 "upstream-openbsd/lib/libc/string/stpcpy.c",
569 "upstream-openbsd/lib/libc/string/strcat.c",
570 ],
571 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700572 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700573 arm64: {
574 exclude_srcs: [
575 "upstream-openbsd/lib/libc/string/memchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700576 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700577 "upstream-openbsd/lib/libc/string/strcpy.c",
578 "upstream-openbsd/lib/libc/string/strncmp.c",
579 ],
580 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530581 mips: {
582 exclude_srcs: [
583 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530584 "upstream-openbsd/lib/libc/string/strcpy.c",
585 "upstream-openbsd/lib/libc/string/strncmp.c",
586 ],
587 },
588 mips64: {
589 exclude_srcs: [
590 "upstream-openbsd/lib/libc/string/memchr.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +0530591 "upstream-openbsd/lib/libc/string/strcpy.c",
592 "upstream-openbsd/lib/libc/string/strncmp.c",
593 ],
594 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700595 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800596 exclude_srcs: [
597 "upstream-openbsd/lib/libc/string/memchr.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800598 "upstream-openbsd/lib/libc/string/memrchr.c",
599 "upstream-openbsd/lib/libc/string/stpcpy.c",
600 "upstream-openbsd/lib/libc/string/stpncpy.c",
601 "upstream-openbsd/lib/libc/string/strcat.c",
602 "upstream-openbsd/lib/libc/string/strcpy.c",
603 "upstream-openbsd/lib/libc/string/strncmp.c",
604 "upstream-openbsd/lib/libc/string/strncpy.c",
605 ],
606 ssse3: {
607 exclude_srcs: [
608 "upstream-openbsd/lib/libc/string/strlcat.c",
609 "upstream-openbsd/lib/libc/string/strlcpy.c",
610 "upstream-openbsd/lib/libc/string/strncat.c",
611 ],
612 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700613 },
614
615 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800616 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800617 "upstream-openbsd/lib/libc/string/stpcpy.c",
618 "upstream-openbsd/lib/libc/string/stpncpy.c",
619 "upstream-openbsd/lib/libc/string/strcat.c",
620 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800621 "upstream-openbsd/lib/libc/string/strncat.c",
622 "upstream-openbsd/lib/libc/string/strncmp.c",
623 "upstream-openbsd/lib/libc/string/strncpy.c",
624 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700625 },
626 },
627
Colin Cross50c21ab2015-10-31 23:03:05 -0700628 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700629 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700630 "-Wno-unused-parameter",
631 "-include openbsd-compat.h",
632 ],
633
Dan Willemsen208ae172015-09-16 16:33:27 -0700634 local_include_dirs: [
635 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700636 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700637 ],
638
639 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700640}
641
642// ========================================================
643// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
644// ========================================================
645//
646// These files are built with the openbsd-compat.h header file
647// automatically included.
648
649cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700650 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700651 srcs: [
652 "upstream-openbsd/android/gdtoa_support.cpp",
653 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
654 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
655 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
656 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
657 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
658 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
659 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
660 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
661 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
662 "upstream-openbsd/lib/libc/gdtoa/misc.c",
663 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
664 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
665 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
666 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
667 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
668 "upstream-openbsd/lib/libc/gdtoa/sum.c",
669 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
670 ],
671 multilib: {
672 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800673 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700674 },
675 },
676
Colin Cross50c21ab2015-10-31 23:03:05 -0700677 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700678 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700679 "-include openbsd-compat.h",
680 ],
681
Dan Willemsen208ae172015-09-16 16:33:27 -0700682 local_include_dirs: [
683 "private",
684 "upstream-openbsd/android/include",
685 "upstream-openbsd/lib/libc/include",
686 ],
687
688 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700689}
690
691// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700692// libc_fortify.a - container for our FORITFY
693// implementation details
694// ========================================================
695cc_library_static {
696 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700697 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700698
699 name: "libc_fortify",
700
701 // Disable FORTIFY for the compilation of these, so we don't end up having
702 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800703 cflags: [
704 "-U_FORTIFY_SOURCE",
705 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
706 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700707
708 arch: {
709 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700710 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700711 srcs: [
712 "arch-arm/generic/bionic/__memcpy_chk.S",
713 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800714 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800715 cflags: [
716 "-DNO___STRCAT_CHK",
717 "-DNO___STRCPY_CHK",
718 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700719 srcs: [
720 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
721 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
722 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700723 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800724 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700725 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800726 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
727 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
728 ],
729 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700730 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
731 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
732 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700733 },
734 cortex_a9: {
735 srcs: [
736 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
737 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
738 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800739 exclude_srcs: [
740 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
741 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
742 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700743 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800744 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700745 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800746 "arch-arm/krait/bionic/__strcat_chk.S",
747 "arch-arm/krait/bionic/__strcpy_chk.S",
748 ],
749 exclude_srcs: [
750 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
751 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
752 ],
753 },
754 cortex_a53: {
755 srcs: [
756 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
757 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
758 ],
759 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700760 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
761 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
762 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700763 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700764 cortex_a55: {
765 srcs: [
766 "arch-arm/denver/bionic/__strcat_chk.S",
767 "arch-arm/denver/bionic/__strcpy_chk.S",
768 ],
769 exclude_srcs: [
770 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
771 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
772 ],
773 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700774 cortex_a73: {
775 srcs: [
776 "arch-arm/denver/bionic/__strcat_chk.S",
777 "arch-arm/denver/bionic/__strcpy_chk.S",
778 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800779 exclude_srcs: [
780 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
781 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
782 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700783 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700784 cortex_a75: {
785 srcs: [
786 "arch-arm/denver/bionic/__strcat_chk.S",
787 "arch-arm/denver/bionic/__strcpy_chk.S",
788 ],
789 exclude_srcs: [
790 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
791 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
792 ],
793 },
George Burgess IV6cb06872017-07-21 13:28:42 -0700794 denver: {
795 srcs: [
796 "arch-arm/denver/bionic/__strcat_chk.S",
797 "arch-arm/denver/bionic/__strcpy_chk.S",
798 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800799 exclude_srcs: [
800 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
801 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
802 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700803 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800804 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700805 srcs: [
806 "arch-arm/krait/bionic/__strcat_chk.S",
807 "arch-arm/krait/bionic/__strcpy_chk.S",
808 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800809 exclude_srcs: [
810 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
811 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700812 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700813 },
814 },
815 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700816 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700817 srcs: [
818 "arch-arm64/generic/bionic/__memcpy_chk.S",
819 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700820 },
821 },
822}
823
824// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700825// libc_bionic.a - home-grown C library code
826// ========================================================
827
828cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700829 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700830 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700831 // The data that backs getauxval is initialized in the libc init
832 // functions which are invoked by the linker. If this file is included
833 // in libc_ndk.a, only one of the copies of the global data will be
834 // initialized, resulting in nullptr dereferences.
835 "bionic/getauxval.cpp",
836
Elliott Hughes211c4d32018-02-02 15:10:32 -0800837 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700838 "bionic/sysconf.cpp",
839 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700840 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700841
Josh Gao10ec9282017-04-03 15:13:29 -0700842 // The following must not be statically linked into libc_ndk.a, because
843 // debuggerd will look for the abort message in libc.so's copy.
844 "bionic/android_set_abort_message.cpp",
845
Dan Willemsen208ae172015-09-16 16:33:27 -0700846 "bionic/strchr.cpp",
847 "bionic/strnlen.c",
848 "bionic/strrchr.cpp",
849 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700850
851 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700852 arm: {
853 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800854 "arch-arm/generic/bionic/memcmp.S",
855 "arch-arm/generic/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700856 "arch-arm/generic/bionic/memmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800857 "arch-arm/generic/bionic/memset.S",
858 "arch-arm/generic/bionic/strcmp.S",
859 "arch-arm/generic/bionic/strcpy.S",
860 "arch-arm/generic/bionic/strlen.c",
861
Dan Willemsen208ae172015-09-16 16:33:27 -0700862 "arch-arm/bionic/atomics_arm.c",
863 "arch-arm/bionic/__bionic_clone.S",
864 "arch-arm/bionic/_exit_with_stack_teardown.S",
865 "arch-arm/bionic/libgcc_compat.c",
866 "arch-arm/bionic/popcount_tab.c",
867 "arch-arm/bionic/__restore.S",
868 "arch-arm/bionic/setjmp.S",
869 "arch-arm/bionic/syscall.S",
870 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700871 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800872 cortex_a7: {
873 srcs: [
Christopher Ferrisecebb492016-11-28 11:09:49 -0800874 "arch-arm/cortex-a7/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700875 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800876 ],
877 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800878 "arch-arm/cortex-a15/bionic/memcpy.S",
879 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800880 ],
881 },
882 cortex_a9: {
883 srcs: [
884 "arch-arm/cortex-a9/bionic/memcpy.S",
885 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800886
Colin Cross6ab8f892015-11-23 14:12:15 -0800887 "arch-arm/cortex-a9/bionic/stpcpy.S",
888 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800889 "arch-arm/cortex-a9/bionic/strcmp.S",
890 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800891 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800892 ],
893 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800894 "arch-arm/cortex-a15/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -0700895 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800896
Colin Cross6ab8f892015-11-23 14:12:15 -0800897 "arch-arm/cortex-a15/bionic/stpcpy.S",
898 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800899 "arch-arm/cortex-a15/bionic/strcmp.S",
900 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800901 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800902 ],
903 },
904 krait: {
905 srcs: [
906 "arch-arm/krait/bionic/memcpy.S",
907 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800908
Colin Cross6ab8f892015-11-23 14:12:15 -0800909 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800910 ],
911 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800912 "arch-arm/cortex-a15/bionic/memset.S",
913 "arch-arm/cortex-a15/bionic/memcpy.S",
914
915 "arch-arm/cortex-a15/bionic/strcmp.S",
916 ],
917 },
918 cortex_a53: {
919 srcs: [
920 "arch-arm/cortex-a53/bionic/memcpy.S",
921 "arch-arm/cortex-a7/bionic/memset.S",
922 ],
923 exclude_srcs: [
924 "arch-arm/cortex-a15/bionic/memset.S",
925 "arch-arm/cortex-a15/bionic/memcpy.S",
926 ],
927 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700928 cortex_a55: {
929 srcs: [
930 "arch-arm/cortex-a7/bionic/memset.S",
931 "arch-arm/denver/bionic/memcpy.S",
932
933 "arch-arm/krait/bionic/strcmp.S",
934 ],
935 exclude_srcs: [
936 "arch-arm/cortex-a15/bionic/memset.S",
937 "arch-arm/cortex-a15/bionic/memcpy.S",
938 "arch-arm/cortex-a15/bionic/strcmp.S",
939 ],
940 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800941 cortex_a73: {
942 srcs: [
943 "arch-arm/cortex-a7/bionic/memset.S",
944 "arch-arm/denver/bionic/memcpy.S",
945
946 "arch-arm/krait/bionic/strcmp.S",
947 ],
948 exclude_srcs: [
949 "arch-arm/cortex-a15/bionic/memset.S",
950 "arch-arm/cortex-a15/bionic/memcpy.S",
951 "arch-arm/cortex-a15/bionic/strcmp.S",
952 ],
953 },
Christopher Ferris4da58cf2018-04-27 16:57:51 -0700954 cortex_a75: {
955 srcs: [
956 "arch-arm/cortex-a7/bionic/memset.S",
957 "arch-arm/denver/bionic/memcpy.S",
958
959 "arch-arm/krait/bionic/strcmp.S",
960 ],
961 exclude_srcs: [
962 "arch-arm/cortex-a15/bionic/memset.S",
963 "arch-arm/cortex-a15/bionic/memcpy.S",
964 "arch-arm/cortex-a15/bionic/strcmp.S",
965 ],
966 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800967 denver: {
968 srcs: [
969 "arch-arm/denver/bionic/memcpy.S",
970 "arch-arm/denver/bionic/memset.S",
971 ],
972 exclude_srcs: [
973 "arch-arm/cortex-a15/bionic/memset.S",
974 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800975 ],
976 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700977 kryo: {
978 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400979 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400980 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800981
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800982 "arch-arm/krait/bionic/strcmp.S",
983 ],
984 exclude_srcs: [
985 "arch-arm/cortex-a15/bionic/memset.S",
986 "arch-arm/cortex-a15/bionic/memcpy.S",
987 "arch-arm/cortex-a15/bionic/strcmp.S",
988 ],
989 },
990 // Cores not listed above (like cortex-a8, cortex-a15) or
991 // "generic" core will use the following implementation.
992 neon: {
993 srcs: [
994 "arch-arm/cortex-a15/bionic/memcpy.S",
995 "arch-arm/cortex-a15/bionic/memset.S",
996
Christopher Ferris950a9582017-03-29 13:10:56 -0700997 "arch-arm/cortex-a15/bionic/stpcpy.S",
998 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800999 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -07001000 "arch-arm/cortex-a15/bionic/strcpy.S",
1001 "arch-arm/cortex-a15/bionic/strlen.S",
1002
1003 "arch-arm/denver/bionic/memmove.S",
1004 ],
1005 exclude_srcs: [
1006 "arch-arm/generic/bionic/memcpy.S",
Elliott Hughesda46cae2018-05-24 14:40:32 -07001007 "arch-arm/generic/bionic/memmove.S",
Christopher Ferris950a9582017-03-29 13:10:56 -07001008 "arch-arm/generic/bionic/memset.S",
1009 "arch-arm/generic/bionic/strcmp.S",
1010 "arch-arm/generic/bionic/strcpy.S",
1011 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -07001012 ],
1013 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001014 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001015 arm64: {
1016 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001017 "arch-arm64/generic/bionic/memchr.S",
1018 "arch-arm64/generic/bionic/memcmp.S",
1019 "arch-arm64/generic/bionic/memcpy.S",
1020 "arch-arm64/generic/bionic/memmove.S",
1021 "arch-arm64/generic/bionic/memset.S",
1022 "arch-arm64/generic/bionic/stpcpy.S",
1023 "arch-arm64/generic/bionic/strchr.S",
1024 "arch-arm64/generic/bionic/strcmp.S",
1025 "arch-arm64/generic/bionic/strcpy.S",
1026 "arch-arm64/generic/bionic/strlen.S",
1027 "arch-arm64/generic/bionic/strncmp.S",
1028 "arch-arm64/generic/bionic/strnlen.S",
1029 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001030
1031 "arch-arm64/bionic/__bionic_clone.S",
1032 "arch-arm64/bionic/_exit_with_stack_teardown.S",
1033 "arch-arm64/bionic/setjmp.S",
1034 "arch-arm64/bionic/syscall.S",
1035 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001036 ],
1037 exclude_srcs: [
1038 "bionic/__memcpy_chk.cpp",
1039 "bionic/strchr.cpp",
1040 "bionic/strnlen.c",
1041 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001042 denver64: {
1043 srcs: [
1044 "arch-arm64/denver64/bionic/memcpy.S",
Haibo Huangece43e12018-05-26 13:07:43 -07001045 "arch-arm64/denver64/bionic/memmove.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001046 "arch-arm64/denver64/bionic/memset.S",
1047 ],
1048 exclude_srcs: [
1049 "arch-arm64/generic/bionic/memcpy.S",
Haibo Huangece43e12018-05-26 13:07:43 -07001050 "arch-arm64/generic/bionic/memmove.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001051 "arch-arm64/generic/bionic/memset.S",
1052 ],
1053 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001054 },
1055
1056 mips: {
1057 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001058 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301059 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001060 "arch-mips/string/memset.S",
1061 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301062 "arch-mips/string/strncmp.S",
1063 "arch-mips/string/strlen.c",
1064 "arch-mips/string/strnlen.c",
1065 "arch-mips/string/strchr.c",
1066 "arch-mips/string/strcpy.c",
1067 "arch-mips/string/memchr.c",
1068 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001069
Dan Willemsen208ae172015-09-16 16:33:27 -07001070 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001071 "arch-mips/bionic/cacheflush.cpp",
1072 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001073 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001074 "arch-mips/bionic/setjmp.S",
1075 "arch-mips/bionic/syscall.S",
1076 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001077 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301078 exclude_srcs: [
1079 "bionic/strchr.cpp",
1080 "bionic/strnlen.c",
1081 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001082 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001083 mips64: {
1084 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001085 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301086 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001087 "arch-mips/string/memset.S",
1088 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301089 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001090 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301091 "arch-mips/string/strnlen.c",
1092 "arch-mips/string/strchr.c",
1093 "arch-mips/string/strcpy.c",
1094 "arch-mips/string/memchr.c",
1095 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001096
Dan Willemsen208ae172015-09-16 16:33:27 -07001097 "arch-mips64/bionic/__bionic_clone.S",
1098 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1099 "arch-mips64/bionic/setjmp.S",
1100 "arch-mips64/bionic/syscall.S",
1101 "arch-mips64/bionic/vfork.S",
1102 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001103 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301104 exclude_srcs: [
1105 "bionic/strchr.cpp",
1106 "bionic/strnlen.c",
1107 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001108 },
1109
1110 x86: {
1111 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001112 "arch-x86/generic/string/memcmp.S",
1113 "arch-x86/generic/string/strcmp.S",
1114 "arch-x86/generic/string/strncmp.S",
1115 "arch-x86/generic/string/strcat.S",
1116 "arch-x86/atom/string/sse2-memchr-atom.S",
1117 "arch-x86/atom/string/sse2-memrchr-atom.S",
1118 "arch-x86/atom/string/sse2-strchr-atom.S",
1119 "arch-x86/atom/string/sse2-strnlen-atom.S",
1120 "arch-x86/atom/string/sse2-strrchr-atom.S",
1121 "arch-x86/atom/string/sse2-wcschr-atom.S",
1122 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1123 "arch-x86/atom/string/sse2-wcslen-atom.S",
1124 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001125 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1126 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1127 "arch-x86/silvermont/string/sse2-memset-slm.S",
1128 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1129 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1130 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1131 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1132 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001133
1134 "arch-x86/bionic/__bionic_clone.S",
1135 "arch-x86/bionic/_exit_with_stack_teardown.S",
1136 "arch-x86/bionic/libgcc_compat.c",
1137 "arch-x86/bionic/__restore.S",
1138 "arch-x86/bionic/setjmp.S",
1139 "arch-x86/bionic/syscall.S",
1140 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001141 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001142
1143 exclude_srcs: [
1144 "bionic/strchr.cpp",
1145 "bionic/strnlen.c",
1146 "bionic/strrchr.cpp",
1147 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001148 atom: {
1149 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001150 "arch-x86/atom/string/sse2-memset-atom.S",
1151 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001152 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001153 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001154 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001155 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001156 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1157 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1158 ],
1159 exclude_srcs: [
1160 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001161 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1162 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1163 "arch-x86/silvermont/string/sse2-memset-slm.S",
1164 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1165 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1166 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1167 ],
1168 },
1169 ssse3: {
1170 srcs: [
1171 "arch-x86/atom/string/ssse3-strncat-atom.S",
1172 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1173 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1174 "arch-x86/atom/string/ssse3-strcat-atom.S",
1175 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1176 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1177 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1178 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1179 ],
1180 exclude_srcs: [
1181 "arch-x86/generic/string/strcmp.S",
1182 "arch-x86/generic/string/strncmp.S",
1183 "arch-x86/generic/string/strcat.S",
1184 ],
1185 },
1186 sse4: {
1187 srcs: [
1188 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1189 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1190 ],
1191 exclude_srcs: [
1192 "arch-x86/generic/string/memcmp.S",
1193 ],
1194 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001195 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001196 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001197 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001198 "arch-x86_64/string/sse2-memcpy-slm.S",
1199 "arch-x86_64/string/sse2-memmove-slm.S",
1200 "arch-x86_64/string/sse2-memset-slm.S",
1201 "arch-x86_64/string/sse2-stpcpy-slm.S",
1202 "arch-x86_64/string/sse2-stpncpy-slm.S",
1203 "arch-x86_64/string/sse2-strcat-slm.S",
1204 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001205 "arch-x86_64/string/sse2-strlen-slm.S",
1206 "arch-x86_64/string/sse2-strncat-slm.S",
1207 "arch-x86_64/string/sse2-strncpy-slm.S",
1208 "arch-x86_64/string/sse4-memcmp-slm.S",
1209 "arch-x86_64/string/ssse3-strcmp-slm.S",
1210 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001211
1212 "arch-x86_64/bionic/__bionic_clone.S",
1213 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1214 "arch-x86_64/bionic/__restore_rt.S",
1215 "arch-x86_64/bionic/setjmp.S",
1216 "arch-x86_64/bionic/syscall.S",
1217 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001218 ],
1219 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001220 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001221
Colin Cross50c21ab2015-10-31 23:03:05 -07001222 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001223 include_dirs: ["bionic/libstdc++/include"],
1224 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001225}
1226
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001227genrule {
1228 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001229 out: ["generated_android_ids.h"],
1230 srcs: [":android_filesystem_config_header"],
1231 tool_files: ["fs_config_generator.py"],
1232 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001233}
1234
Dan Willemsen268a6732015-10-15 14:49:45 -07001235// ========================================================
1236// libc_bionic_ndk.a- The portions of libc_bionic that can
1237// be safely used in libc_ndk.a (no troublesome global data
1238// or constructors).
1239// ========================================================
1240cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001241 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001242 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001243 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001244 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001245 "bionic/__cmsg_nxthdr.cpp",
1246 "bionic/__errno.cpp",
1247 "bionic/__gnu_basename.cpp",
1248 "bionic/__libc_current_sigrtmax.cpp",
1249 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001250 "bionic/abort.cpp",
1251 "bionic/accept.cpp",
1252 "bionic/accept4.cpp",
1253 "bionic/access.cpp",
1254 "bionic/arpa_inet.cpp",
1255 "bionic/assert.cpp",
1256 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001257 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001258 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001259 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001260 "bionic/bionic_systrace.cpp",
1261 "bionic/bionic_time_conversions.cpp",
1262 "bionic/brk.cpp",
1263 "bionic/c16rtomb.cpp",
1264 "bionic/c32rtomb.cpp",
1265 "bionic/chmod.cpp",
1266 "bionic/chown.cpp",
1267 "bionic/clearenv.cpp",
1268 "bionic/clock.cpp",
1269 "bionic/clock_getcpuclockid.cpp",
1270 "bionic/clock_nanosleep.cpp",
1271 "bionic/clone.cpp",
1272 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001273 "bionic/connect.cpp",
1274 "bionic/ctype.cpp",
1275 "bionic/dirent.cpp",
1276 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001277 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001278 "bionic/error.cpp",
1279 "bionic/eventfd_read.cpp",
1280 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001281 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001282 "bionic/faccessat.cpp",
1283 "bionic/fchmod.cpp",
1284 "bionic/fchmodat.cpp",
1285 "bionic/ffs.cpp",
1286 "bionic/fgetxattr.cpp",
1287 "bionic/flistxattr.cpp",
1288 "bionic/flockfile.cpp",
1289 "bionic/fpclassify.cpp",
1290 "bionic/fsetxattr.cpp",
1291 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001292 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001293 "bionic/futimens.cpp",
1294 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001295 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001296 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001297 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001298 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001299 "bionic/getpgrp.cpp",
1300 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001301 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001302 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001303 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001304 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001305 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001306 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001307 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001308 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001309 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001310 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001311 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001312 "bionic/lchown.cpp",
1313 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001314 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001315 "bionic/libgen.cpp",
1316 "bionic/link.cpp",
1317 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001318 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001319 "bionic/lstat.cpp",
1320 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001321 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001322 "bionic/mbrtoc16.cpp",
1323 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001324 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001325 "bionic/mempcpy.cpp",
1326 "bionic/mkdir.cpp",
1327 "bionic/mkfifo.cpp",
1328 "bionic/mknod.cpp",
1329 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001330 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001331 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001332 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001333 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001334 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001335 "bionic/open.cpp",
1336 "bionic/pathconf.cpp",
1337 "bionic/pause.cpp",
1338 "bionic/pipe.cpp",
1339 "bionic/poll.cpp",
1340 "bionic/posix_fadvise.cpp",
1341 "bionic/posix_fallocate.cpp",
1342 "bionic/posix_madvise.cpp",
1343 "bionic/posix_timers.cpp",
1344 "bionic/ptrace.cpp",
1345 "bionic/pty.cpp",
1346 "bionic/raise.cpp",
1347 "bionic/rand.cpp",
1348 "bionic/readlink.cpp",
1349 "bionic/reboot.cpp",
1350 "bionic/recv.cpp",
1351 "bionic/rename.cpp",
1352 "bionic/rmdir.cpp",
1353 "bionic/scandir.cpp",
1354 "bionic/sched_getaffinity.cpp",
1355 "bionic/sched_getcpu.cpp",
1356 "bionic/semaphore.cpp",
1357 "bionic/send.cpp",
1358 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001359 "bionic/seteuid.cpp",
1360 "bionic/setpgrp.cpp",
1361 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001362 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001363 "bionic/sigprocmask.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001364 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001365 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001366 "bionic/stat.cpp",
1367 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001368 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001369 "bionic/strchrnul.cpp",
1370 "bionic/strerror.cpp",
1371 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001372 "bionic/string_l.cpp",
1373 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001374 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001375 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001376 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001377 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001378 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001379 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001380 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001381 "bionic/sys_msg.cpp",
1382 "bionic/sys_sem.cpp",
1383 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001384 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001385 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001386 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001387 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001388 "bionic/sysinfo.cpp",
1389 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001390 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001391 "bionic/system_property_api.cpp",
1392 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001393 "bionic/tdestroy.cpp",
1394 "bionic/termios.cpp",
1395 "bionic/thread_private.cpp",
1396 "bionic/tmpfile.cpp",
1397 "bionic/umount.cpp",
1398 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001399 "bionic/wait.cpp",
1400 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001401 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001402 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001403 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001404 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001405 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001406
1407 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1408 // which will be overridden by the actual one in libc.so.
1409 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001410 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001411
Dan Willemsen208ae172015-09-16 16:33:27 -07001412 multilib: {
1413 lib32: {
1414 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001415 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001416 },
1417 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001418 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001419 treble_linker_namespaces: {
1420 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001421 },
1422 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001423 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001424 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001425 local_include_dirs: ["stdio"],
1426 include_dirs: ["bionic/libstdc++/include"],
1427 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001428 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001429}
1430
Dan Willemsen208ae172015-09-16 16:33:27 -07001431// ========================================================
1432// libc_pthread.a - pthreads parts that previously lived in
1433// libc_bionic.a. Relocated to their own library because
1434// they can't be included in libc_ndk.a (as they layout of
1435// pthread_t has changed over the years and has ABI
1436// compatibility issues).
1437// ========================================================
1438
1439cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001440 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001441 srcs: [
1442 "bionic/pthread_atfork.cpp",
1443 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001444 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001445 "bionic/pthread_cond.cpp",
1446 "bionic/pthread_create.cpp",
1447 "bionic/pthread_detach.cpp",
1448 "bionic/pthread_equal.cpp",
1449 "bionic/pthread_exit.cpp",
1450 "bionic/pthread_getcpuclockid.cpp",
1451 "bionic/pthread_getschedparam.cpp",
1452 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001453 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001454 "bionic/pthread_join.cpp",
1455 "bionic/pthread_key.cpp",
1456 "bionic/pthread_kill.cpp",
1457 "bionic/pthread_mutex.cpp",
1458 "bionic/pthread_once.cpp",
1459 "bionic/pthread_rwlock.cpp",
1460 "bionic/pthread_self.cpp",
1461 "bionic/pthread_setname_np.cpp",
1462 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001463 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001464
1465 // The following implementations depend on pthread data or implementation,
1466 // so we can't include them in libc_ndk.a.
1467 "bionic/__cxa_thread_atexit_impl.cpp",
1468 "stdlib/atexit.c",
1469 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001470 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001471
Colin Cross50c21ab2015-10-31 23:03:05 -07001472 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001473 include_dirs: ["bionic/libstdc++/include"],
1474 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001475}
1476
1477// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001478// libc_syscalls.a
1479// ========================================================
1480
1481cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001482 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001483 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001484 arch: {
1485 arm: {
1486 srcs: ["arch-arm/syscalls/**/*.S"],
1487 },
1488 arm64: {
1489 srcs: ["arch-arm64/syscalls/**/*.S"],
1490 },
1491 mips: {
1492 srcs: ["arch-mips/syscalls/**/*.S"],
1493 },
1494 mips64: {
1495 srcs: ["arch-mips64/syscalls/**/*.S"],
1496 },
1497 x86: {
1498 srcs: ["arch-x86/syscalls/**/*.S"],
1499 },
1500 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001501 srcs: ["arch-x86_64/syscalls/**/*.S"],
1502 },
1503 },
1504 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001505}
1506
1507// ========================================================
1508// libc_aeabi.a
1509// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1510// to avoid infinite recursion. For the other architectures we just build an
1511// empty library to keep this makefile simple.
1512// ========================================================
1513
1514cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001515 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001516 arch: {
1517 arm: {
1518 srcs: ["arch-arm/bionic/__aeabi.c"],
1519 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001520 },
1521 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001522 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001523}
1524
1525// ========================================================
1526// libc_ndk.a
1527// Compatibility library for the NDK. This library contains
1528// all the parts of libc that are safe to statically link.
1529// We can't safely statically link things that can only run
1530// on a certain version of the OS. Examples include
1531// anything that talks to netd (a large portion of the DNS
1532// code) and anything that is dependent on the layout of a
1533// data structure that has changed across releases (such as
1534// pthread_t).
1535// ========================================================
1536
1537cc_library_static {
1538 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001539 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001540 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001541 multilib: {
1542 lib32: {
1543 srcs: libc_common_src_files_32,
1544 },
1545 },
1546 arch: {
1547 arm: {
1548 srcs: [
1549 "arch-arm/bionic/exidx_dynamic.c",
1550 "arch-common/bionic/crtbegin_so.c",
1551 "arch-arm/bionic/atexit_legacy.c",
1552 "arch-common/bionic/crtend_so.S",
1553 ],
1554 whole_static_libs: ["libc_aeabi"],
1555 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001556 },
1557
Colin Cross50c21ab2015-10-31 23:03:05 -07001558 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001559 "-fvisibility=hidden",
1560 "-DLIBC_STATIC",
1561 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001562
1563 whole_static_libs: [
1564 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001565 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001566 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001567 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001568 "libc_gdtoa",
1569 "libc_malloc",
1570 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001571 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001572 "libc_openbsd_ndk",
1573 "libc_stack_protector",
1574 "libc_syscalls",
1575 "libc_tzcode",
1576 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001577 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001578 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001579 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001580}
1581
1582// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001583// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001584// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001585cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001586 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001587 srcs: libc_common_src_files,
1588 multilib: {
1589 lib32: {
1590 srcs: libc_common_src_files_32,
1591 },
1592 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001593 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001594
1595 whole_static_libs: [
1596 "libc_bionic",
1597 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001598 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001599 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001600 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001601 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001602 "libc_gdtoa",
1603 "libc_malloc",
1604 "libc_netbsd",
1605 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001606 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001607 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001608 "libc_stack_protector",
1609 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001610 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001611 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001612 ],
1613
1614 arch: {
1615 arm: {
1616 whole_static_libs: ["libc_aeabi"],
1617 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001618 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001619}
1620
1621// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001622// libc_common.a
1623// ========================================================
1624
1625cc_library_static {
1626 defaults: ["libc_defaults"],
1627 name: "libc_common",
1628
1629 whole_static_libs: [
1630 "libc_nopthread",
1631 "libc_pthread",
1632 ],
1633}
1634
1635// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001636// libc_nomalloc.a
1637// ========================================================
1638//
1639// This is a version of the static C library that does not
1640// include malloc. It's useful in situations when the user wants
1641// to provide their own malloc implementation, or wants to
1642// explicitly disallow the use of malloc, such as in the
1643// dynamic linker.
1644
1645cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001646 name: "libc_nomalloc",
1647
Colin Cross50c21ab2015-10-31 23:03:05 -07001648 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001649
1650 arch: {
1651 arm: {
1652 srcs: ["arch-arm/bionic/exidx_static.c"],
1653 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001654 },
1655
Colin Cross50c21ab2015-10-31 23:03:05 -07001656 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001657
Colin Crossa3f9fca2016-01-11 13:20:55 -08001658 whole_static_libs: [
1659 "libc_common",
1660 "libc_init_static",
1661 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001662}
1663
1664// ========================================================
1665// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1666// ========================================================
1667cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001668 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001669 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001670 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001671
Dan Willemsen208ae172015-09-16 16:33:27 -07001672 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001673}
1674
1675// ========================================================
1676// libc.a + libc.so
1677// ========================================================
1678cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001679 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001680 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001681 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001682 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001683 platform_sdk_version: {
1684 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1685 },
1686 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001687 static: {
1688 srcs: [
1689 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001690 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001691 ],
1692 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001693 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001694 },
1695 shared: {
1696 srcs: [
1697 "arch-common/bionic/crtbegin_so.c",
1698 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001699 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001700 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001701 "bionic/NetdClient.cpp",
1702 "arch-common/bionic/crtend_so.S",
1703 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001704 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001705 },
1706
1707 required: ["tzdata"],
1708
1709 // Leave the symbols in the shared library so that stack unwinders can produce
1710 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001711 strip: {
1712 keep_symbols: true,
1713 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001714
Colin Cross4ce94d22016-11-15 13:15:43 -08001715 // Do not pack libc.so relocations; see http://b/20645321 for details.
1716 pack_relocations: false,
1717
dimitry06016f22018-01-05 11:39:28 +01001718 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1719 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1720 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1721 // those new libraries from libgcc.a are not declared external; if that were the case,
1722 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1723 // on the external symbols from the dependent libraries. That would create a "cloaked"
1724 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001725
dimitry06016f22018-01-05 11:39:28 +01001726 shared_libs: [
1727 "ld-android",
1728 "libdl",
1729 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001730 whole_static_libs: [
1731 "libc_common",
1732 "libjemalloc",
1733 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001734
1735 nocrt: true,
1736
Dan Willemsen208ae172015-09-16 16:33:27 -07001737 arch: {
1738 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001739 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001740 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001741 ldflags: ["-Wl,--hash-style=both"],
1742
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001743 // Don't re-export new/delete and friends, even if the compiler really wants to.
1744 version_script: "libc.arm.map",
1745
Dan Willemsen208ae172015-09-16 16:33:27 -07001746 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001747 srcs: [
1748 "arch-arm/bionic/exidx_dynamic.c",
1749
1750 // special for arm
1751 "arch-arm/bionic/atexit_legacy.c",
1752 ],
1753 // special for arm
1754 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001755 },
1756 static: {
1757 srcs: ["arch-arm/bionic/exidx_static.c"],
1758 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001759 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001760 arm64: {
1761 // Don't re-export new/delete and friends, even if the compiler really wants to.
1762 version_script: "libc.arm64.map",
1763 },
1764 mips: {
1765 // Don't re-export new/delete and friends, even if the compiler really wants to.
1766 version_script: "libc.mips.map",
1767 },
1768 mips64: {
1769 // Don't re-export new/delete and friends, even if the compiler really wants to.
1770 version_script: "libc.mips64.map",
1771 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001772 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001773 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001774 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001775 ldflags: ["-Wl,--hash-style=both"],
1776
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001777 // Don't re-export new/delete and friends, even if the compiler really wants to.
1778 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001779 },
1780 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001781 // Don't re-export new/delete and friends, even if the compiler really wants to.
1782 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001783 },
1784 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001785}
1786
Dan Willemsen208ae172015-09-16 16:33:27 -07001787// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001788// libstdc++.so + libstdc++.a
1789// ========================================================
1790cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001791 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001792 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001793 srcs: [
1794 "bionic/__cxa_guard.cpp",
1795 "bionic/__cxa_pure_virtual.cpp",
1796 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001797 ],
1798 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001799 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001800 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001801 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001802
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001803 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001804 arch: {
1805 arm: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001806 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001807 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001808 version_script: "libstdc++.arm.map",
1809 },
1810 arm64: {
1811 version_script: "libstdc++.arm64.map",
1812 },
1813 mips: {
1814 version_script: "libstdc++.mips.map",
1815 },
1816 mips64: {
1817 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001818 },
1819 x86: {
Chih-Hung Hsiehecbff832018-05-23 18:45:53 -07001820 pack_relocations: false,
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001821 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001822 version_script: "libstdc++.x86.map",
1823 },
1824 x86_64: {
1825 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001826 },
1827 },
1828}
1829
Colin Cross50c21ab2015-10-31 23:03:05 -07001830cc_defaults {
1831 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001832 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001833 vendor_available: true,
Jiyong Park5603c6e2018-04-27 21:53:11 +09001834 recovery_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001835
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001836 cflags: [
1837 "-Wno-gcc-compat",
1838 "-Wall",
1839 "-Werror",
1840 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001841}
1842
Colin Cross50c21ab2015-10-31 23:03:05 -07001843cc_defaults {
1844 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001845 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001846
1847 arch: {
1848 mips: {
1849 cflags: ["-fPIC"],
1850 },
1851 mips64: {
1852 cflags: ["-fPIC"],
1853 },
1854 x86: {
1855 cflags: ["-fPIC"],
1856 },
1857 x86_64: {
1858 cflags: ["-fPIC"],
1859 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001860 },
1861}
1862
Dan Willemsena3ed9012017-04-04 15:51:26 -07001863// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001864cc_object {
1865 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001866 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001867 local_include_dirs: ["include"],
1868 product_variables: {
1869 platform_sdk_version: {
1870 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1871 },
1872 },
1873 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001874
Colin Cross7d7b3682017-11-03 13:38:40 -07001875 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001876}
1877
Dan Willemsen208ae172015-09-16 16:33:27 -07001878cc_object {
1879 name: "crtbegin_so1",
1880 local_include_dirs: ["include"],
1881 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001882
Colin Cross7d7b3682017-11-03 13:38:40 -07001883 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001884}
1885
Dan Willemsen208ae172015-09-16 16:33:27 -07001886cc_object {
1887 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001888
Colin Cross7d7b3682017-11-03 13:38:40 -07001889 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001890 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001891 "crtbegin_so1",
1892 "crtbrand",
1893 ],
1894}
1895
Dan Willemsen208ae172015-09-16 16:33:27 -07001896cc_object {
1897 name: "crtend_so",
1898 local_include_dirs: ["include"],
1899 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001900
Colin Cross7d7b3682017-11-03 13:38:40 -07001901 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001902}
1903
Dan Willemsen208ae172015-09-16 16:33:27 -07001904cc_object {
1905 name: "crtbegin_static1",
1906 local_include_dirs: ["include"],
1907 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001908
Colin Cross50c21ab2015-10-31 23:03:05 -07001909 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001910 mips: {
1911 srcs: [
1912 "arch-mips/bionic/crtbegin.c",
1913 ],
1914 exclude_srcs: [
1915 "arch-common/bionic/crtbegin.c",
1916 ],
1917 },
1918 mips64: {
1919 srcs: [
1920 "arch-mips64/bionic/crtbegin.c",
1921 ],
1922 exclude_srcs: [
1923 "arch-common/bionic/crtbegin.c",
1924 ],
1925 },
1926 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001927
1928 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001929}
1930
Dan Willemsen208ae172015-09-16 16:33:27 -07001931cc_object {
1932 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001933
Colin Cross77d57bf2016-04-11 14:34:18 -07001934 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001935 "crtbegin_static1",
1936 "crtbrand",
1937 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001938 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001939}
1940
Dan Willemsen208ae172015-09-16 16:33:27 -07001941cc_object {
1942 name: "crtbegin_dynamic1",
1943 local_include_dirs: ["include"],
1944 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001945
Colin Cross50c21ab2015-10-31 23:03:05 -07001946 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001947 mips: {
1948 srcs: [
1949 "arch-mips/bionic/crtbegin.c",
1950 ],
1951 exclude_srcs: [
1952 "arch-common/bionic/crtbegin.c",
1953 ],
1954 },
1955 mips64: {
1956 srcs: [
1957 "arch-mips64/bionic/crtbegin.c",
1958 ],
1959 exclude_srcs: [
1960 "arch-common/bionic/crtbegin.c",
1961 ],
1962 },
1963 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001964 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001965}
1966
Dan Willemsen208ae172015-09-16 16:33:27 -07001967cc_object {
1968 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001969
Colin Cross77d57bf2016-04-11 14:34:18 -07001970 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001971 "crtbegin_dynamic1",
1972 "crtbrand",
1973 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001974 target: {
1975 linux_bionic: {
1976 generated_sources: ["host_bionic_linker_asm"],
1977 objs: [
1978 "linker_wrapper",
1979 ],
1980 },
1981 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001982 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001983}
1984
Dan Willemsen208ae172015-09-16 16:33:27 -07001985cc_object {
1986 // We rename crtend.o to crtend_android.o to avoid a
1987 // name clash between gcc and bionic.
1988 name: "crtend_android",
1989 local_include_dirs: ["include"],
1990 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001991
Colin Cross50c21ab2015-10-31 23:03:05 -07001992 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001993}
Colin Crossbaa48992016-07-13 11:15:21 -07001994
Dan Albert26e1c412018-05-24 14:56:46 -07001995versioned_ndk_headers {
Dan Albert22805ea2017-03-22 15:28:05 -07001996 name: "common_libc",
1997 from: "include",
1998 to: "",
1999 license: "NOTICE",
2000}
Dan Albert4238a352016-06-28 11:18:05 -07002001
2002ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08002003 name: "libc_uapi",
2004 from: "kernel/uapi",
2005 to: "",
2006 srcs: [
2007 "kernel/uapi/asm-generic/**/*.h",
2008 "kernel/uapi/drm/**/*.h",
2009 "kernel/uapi/linux/**/*.h",
2010 "kernel/uapi/misc/**/*.h",
2011 "kernel/uapi/mtd/**/*.h",
2012 "kernel/uapi/rdma/**/*.h",
2013 "kernel/uapi/scsi/**/*.h",
2014 "kernel/uapi/sound/**/*.h",
2015 "kernel/uapi/video/**/*.h",
2016 "kernel/uapi/xen/**/*.h",
2017 ],
Dan Albert92592652016-10-20 01:42:54 -07002018 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002019}
2020
2021ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002022 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002023 from: "kernel/android/uapi/linux",
2024 to: "linux",
2025 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002026 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002027}
2028
2029ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002030 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002031 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002032 to: "scsi",
2033 srcs: ["kernel/android/scsi/**/*.h"],
2034 license: "NOTICE",
2035}
2036
2037ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002038 name: "libc_asm_arm",
2039 from: "kernel/uapi/asm-arm",
2040 to: "arm-linux-androideabi",
2041 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002042 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002043}
2044
2045ndk_headers {
2046 name: "libc_asm_arm64",
2047 from: "kernel/uapi/asm-arm64",
2048 to: "aarch64-linux-android",
2049 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002050 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002051}
2052
Elliott Hughesee291c02017-12-11 11:32:34 -08002053// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002054ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002055 name: "libc_asm_mips",
2056 from: "kernel/uapi/asm-mips",
2057 to: "mipsel-linux-android",
2058 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2059 license: "NOTICE",
2060}
2061
Elliott Hughesee291c02017-12-11 11:32:34 -08002062// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002063ndk_headers {
2064 name: "libc_asm_mips64",
2065 from: "kernel/uapi/asm-mips",
2066 to: "mips64el-linux-android",
2067 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2068 license: "NOTICE",
2069}
2070
2071ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002072 name: "libc_asm_x86",
2073 from: "kernel/uapi/asm-x86",
2074 to: "i686-linux-android",
2075 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002076 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002077}
2078
2079ndk_headers {
2080 name: "libc_asm_x86_64",
2081 from: "kernel/uapi/asm-x86",
2082 to: "x86_64-linux-android",
2083 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002084 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002085}
2086
Dan Albert4238a352016-06-28 11:18:05 -07002087ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002088 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002089 symbol_file: "libc.map.txt",
2090 first_version: "9",
2091}
2092
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002093llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002094 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002095 symbol_file: "libc.map.txt",
2096 export_headers_as_system: true,
2097 export_preprocessed_headers: ["include"],
2098 arch: {
2099 arm: {
2100 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002101 "kernel/uapi",
2102 "kernel/uapi/asm-arm",
2103 "kernel/android/uapi",
2104 ],
2105 },
2106 arm64: {
2107 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002108 "kernel/uapi",
2109 "kernel/uapi/asm-arm64",
2110 "kernel/android/uapi",
2111 ],
2112 },
2113 mips: {
2114 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002115 "kernel/uapi",
2116 "kernel/uapi/asm-mips",
2117 "kernel/android/uapi",
2118 ],
2119 },
2120 mips64: {
2121 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002122 "kernel/uapi",
2123 "kernel/uapi/asm-mips",
2124 "kernel/android/uapi",
2125 ],
2126 },
2127 x86: {
2128 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002129 "kernel/uapi",
2130 "kernel/uapi/asm-x86",
2131 "kernel/android/uapi",
2132 ],
2133 },
2134 x86_64: {
2135 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002136 "kernel/uapi",
2137 "kernel/uapi/asm-x86",
2138 "kernel/android/uapi",
2139 ],
2140 },
2141 },
2142}
2143
Dan Albertdf31aff2016-10-06 15:50:41 -07002144ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002145 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002146 symbol_file: "libstdc++.map.txt",
2147 first_version: "9",
2148}
2149
Dan Willemsenca056d72018-01-08 14:00:24 -08002150// Export these headers for toolbox to process
2151filegroup {
2152 name: "kernel_input_headers",
2153 srcs: [
2154 "kernel/uapi/linux/input.h",
2155 "kernel/uapi/linux/input-event-codes.h",
2156 ],
2157}