blob: 102a0954b8eb69832b72198890d4c3c6ee65230d [file] [log] [blame]
Dan Willemsen208ae172015-09-16 16:33:27 -07001// Define the common source files for all the libc instances
2// =========================================================
3libc_common_src_files = [
Christopher Ferris7a3681e2017-04-24 17:48:32 -07004 "async_safe/async_safe_log.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07005 "bionic/ether_aton.c",
6 "bionic/ether_ntoa.c",
7 "bionic/fts.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07008 "bionic/initgroups.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07009 "bionic/isatty.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070010 "bionic/pututline.c",
11 "bionic/sched_cpualloc.c",
12 "bionic/sched_cpucount.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070013 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070014 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070015 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080016 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070017 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080018 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070019 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070021]
22
23// Various kinds of cruft.
24// ========================================================
25libc_common_src_files += [
26 "bionic/ndk_cruft.cpp",
27]
28
29libc_common_src_files_32 = [
30 "bionic/legacy_32_bit_support.cpp",
31 "bionic/time64.c",
32]
33
Elliott Hughes53cf3482016-08-09 13:06:41 -070034libc_common_flags = [
35 "-D_LIBC=1",
Elliott Hughes25f17e42018-02-12 15:48:01 -080036 "-D__BIONIC_LP32_USE_STAT64",
Elliott Hughes53cf3482016-08-09 13:06:41 -070037 "-Wall",
38 "-Wextra",
39 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080040 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070041 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070042 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070043 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070044
45 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
46 "-Werror=pointer-to-int-cast",
47 "-Werror=int-to-pointer-cast",
48 "-Werror=type-limits",
49 "-Werror",
Ryan Prichard8f419572018-02-20 17:09:05 -080050
51 // Clang's exit-time destructor registration hides __dso_handle, but
52 // __dso_handle needs to have default visibility on ARM32. See b/73485611.
53 "-Wexit-time-destructors",
Elliott Hughes53cf3482016-08-09 13:06:41 -070054]
55
Dan Willemsen208ae172015-09-16 16:33:27 -070056// Define some common cflags
57// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070058cc_defaults {
59 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080060 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070061 cflags: libc_common_flags,
62 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070063 conlyflags: ["-std=gnu99"],
64 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070065 include_dirs: [
66 "bionic/libc/async_safe/include",
67 "external/jemalloc/include",
68 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070069
Colin Cross50c21ab2015-10-31 23:03:05 -070070 stl: "none",
71 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070072 sanitize: {
73 never: true,
74 },
Colin Cross50c21ab2015-10-31 23:03:05 -070075 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070076}
77
Dan Willemsen208ae172015-09-16 16:33:27 -070078// ANDROIDMK TRANSLATION ERROR: unsupported directive
79// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
80//libc_common_cflags += ["-DDEBUG"]
81// ANDROIDMK TRANSLATION ERROR: unsupported directive
82// endif
83
Dan Willemsen208ae172015-09-16 16:33:27 -070084// ========================================================
85// libc_stack_protector.a - stack protector code
86// ========================================================
87//
Colin Crossa3f9fca2016-01-11 13:20:55 -080088// Code that implements the stack protector (or that runs
89// before TLS has been set up) needs to be compiled with
90// -fno-stack-protector, since it accesses the stack canary
91// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070092
93cc_library_static {
94
Colin Crossa3f9fca2016-01-11 13:20:55 -080095 srcs: [
96 "bionic/__libc_init_main_thread.cpp",
97 "bionic/__stack_chk_fail.cpp",
98 ],
99 arch: {
100 arm64: {
101 srcs: ["arch-arm64/bionic/__set_tls.c"],
102 },
103 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800104 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800105 },
106 x86_64: {
107 srcs: ["arch-x86_64/bionic/__set_tls.c"],
108 },
109 },
110
Colin Cross50c21ab2015-10-31 23:03:05 -0700111 defaults: ["libc_defaults"],
112 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700113 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700114}
115
Colin Crossa3f9fca2016-01-11 13:20:55 -0800116// libc_init_static.cpp also needs to be built without stack protector,
117// because it's responsible for setting up TLS for static executables.
118// This isn't the case for dynamic executables because the dynamic linker
119// has already set up the main thread's TLS.
120
121cc_library_static {
122 name: "libc_init_static",
123 defaults: ["libc_defaults"],
124 srcs: ["bionic/libc_init_static.cpp"],
125 cflags: ["-fno-stack-protector"],
126}
127
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700128cc_library_static {
129 name: "libc_init_dynamic",
130 defaults: ["libc_defaults"],
131 srcs: ["bionic/libc_init_dynamic.cpp"],
132 cflags: ["-fno-stack-protector"],
133}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800134
Dan Willemsen208ae172015-09-16 16:33:27 -0700135// ========================================================
136// libc_tzcode.a - upstream 'tzcode' code
137// ========================================================
138
139cc_library_static {
140
Colin Cross50c21ab2015-10-31 23:03:05 -0700141 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700142 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800143 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700144 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700145 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
146 ],
147
Colin Cross50c21ab2015-10-31 23:03:05 -0700148 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700149 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700150 // Don't use ridiculous amounts of stack.
151 "-DALL_STATE",
152 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
153 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800154 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700155 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700156 // The name of the tm_gmtoff field in our struct tm.
157 "-DTM_GMTOFF=tm_gmtoff",
158 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700159 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700160 // Include `tzname`, `timezone`, and `daylight` globals.
161 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700162 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800163 // Use the empty string (instead of " ") as the timezone abbreviation
164 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700165 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700166 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
167 "-Dlint",
168 ],
169
Dan Willemsen208ae172015-09-16 16:33:27 -0700170 local_include_dirs: ["tzcode/"],
171 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700172}
173
174// ========================================================
175// libc_dns.a - modified NetBSD DNS code
176// ========================================================
177
178cc_library_static {
179
Colin Cross50c21ab2015-10-31 23:03:05 -0700180 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700181 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800182 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700183
184 "upstream-netbsd/lib/libc/isc/ev_streams.c",
185 "upstream-netbsd/lib/libc/isc/ev_timers.c",
186 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700187 ],
188
Colin Cross50c21ab2015-10-31 23:03:05 -0700189 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700190 "-DANDROID_CHANGES",
191 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700192 "-Wno-unused-parameter",
193 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700194 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700195 ],
196
Dan Willemsen208ae172015-09-16 16:33:27 -0700197 local_include_dirs: [
198 "dns/include",
199 "private",
200 "upstream-netbsd/lib/libc/include",
201 "upstream-netbsd/android/include",
202 ],
203
204 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700205}
206
207// ========================================================
208// libc_freebsd.a - upstream FreeBSD C library code
209// ========================================================
210//
211// These files are built with the freebsd-compat.h header file
212// automatically included.
213
214cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700215 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700216 srcs: [
217 "upstream-freebsd/lib/libc/gen/ldexp.c",
218 "upstream-freebsd/lib/libc/gen/sleep.c",
219 "upstream-freebsd/lib/libc/gen/usleep.c",
220 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700221 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
222 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
223 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
224 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700225 "upstream-freebsd/lib/libc/stdlib/qsort.c",
226 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 "upstream-freebsd/lib/libc/string/wcpcpy.c",
228 "upstream-freebsd/lib/libc/string/wcpncpy.c",
229 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700230 "upstream-freebsd/lib/libc/string/wcscat.c",
231 "upstream-freebsd/lib/libc/string/wcschr.c",
232 "upstream-freebsd/lib/libc/string/wcscmp.c",
233 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700234 "upstream-freebsd/lib/libc/string/wcscspn.c",
235 "upstream-freebsd/lib/libc/string/wcsdup.c",
236 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700237 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
239 "upstream-freebsd/lib/libc/string/wcsncat.c",
240 "upstream-freebsd/lib/libc/string/wcsncmp.c",
241 "upstream-freebsd/lib/libc/string/wcsncpy.c",
242 "upstream-freebsd/lib/libc/string/wcsnlen.c",
243 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700244 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700245 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700246 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700247 "upstream-freebsd/lib/libc/string/wcstok.c",
248 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700249 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700250 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800252 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700253 ],
254 arch: {
255 arm64: {
256 exclude_srcs: [
257 "upstream-freebsd/lib/libc/string/wmemmove.c",
258 ],
259 },
260 x86: {
261 exclude_srcs: [
262 "upstream-freebsd/lib/libc/string/wcschr.c",
263 "upstream-freebsd/lib/libc/string/wcscmp.c",
264 "upstream-freebsd/lib/libc/string/wcslen.c",
265 "upstream-freebsd/lib/libc/string/wcsrchr.c",
266 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800267 atom: {
268 exclude_srcs: [
269 "upstream-freebsd/lib/libc/string/wmemcmp.c",
270 ],
271 },
272 ssse3: {
273 exclude_srcs: [
274 "upstream-freebsd/lib/libc/string/wcscat.c",
275 "upstream-freebsd/lib/libc/string/wcscpy.c",
276 ],
277 },
278 sse4: {
279 exclude_srcs: [
280 "upstream-freebsd/lib/libc/string/wmemcmp.c",
281 ],
282 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700284 },
285
Colin Cross50c21ab2015-10-31 23:03:05 -0700286 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700287 "-Wno-sign-compare",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700288 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700289 "-include freebsd-compat.h",
290 ],
291
Dan Willemsen208ae172015-09-16 16:33:27 -0700292 local_include_dirs: [
293 "upstream-freebsd/android/include",
294 ],
295
296 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700297}
298
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700299cc_library_static {
300 defaults: ["libc_defaults"],
301 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700302 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700303 "upstream-freebsd/lib/libc/stdlib/realpath.c",
304 ],
305
306 cflags: [
307 "-Wno-sign-compare",
308 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700309 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700310 ],
311
312 local_include_dirs: [
313 "upstream-freebsd/android/include",
314 ],
315
316 name: "libc_freebsd_large_stack",
317}
318
Dan Willemsen208ae172015-09-16 16:33:27 -0700319// ========================================================
320// libc_netbsd.a - upstream NetBSD C library code
321// ========================================================
322//
323// These files are built with the netbsd-compat.h header file
324// automatically included.
325
326cc_library_static {
327
Colin Cross50c21ab2015-10-31 23:03:05 -0700328 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700329 srcs: [
330 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700331 "upstream-netbsd/lib/libc/gen/nice.c",
332 "upstream-netbsd/lib/libc/gen/popen.c",
333 "upstream-netbsd/lib/libc/gen/psignal.c",
334 "upstream-netbsd/lib/libc/gen/utime.c",
335 "upstream-netbsd/lib/libc/gen/utmp.c",
336 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
337 "upstream-netbsd/lib/libc/regex/regcomp.c",
338 "upstream-netbsd/lib/libc/regex/regerror.c",
339 "upstream-netbsd/lib/libc/regex/regexec.c",
340 "upstream-netbsd/lib/libc/regex/regfree.c",
341 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
342 "upstream-netbsd/lib/libc/stdlib/div.c",
343 "upstream-netbsd/lib/libc/stdlib/drand48.c",
344 "upstream-netbsd/lib/libc/stdlib/erand48.c",
345 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
346 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
347 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
348 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
349 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
350 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
351 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
352 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
353 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
354 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
355 "upstream-netbsd/lib/libc/stdlib/seed48.c",
356 "upstream-netbsd/lib/libc/stdlib/srand48.c",
357 "upstream-netbsd/lib/libc/string/memccpy.c",
358 "upstream-netbsd/lib/libc/string/strcasestr.c",
359 "upstream-netbsd/lib/libc/string/strcoll.c",
360 "upstream-netbsd/lib/libc/string/strxfrm.c",
361 ],
362 multilib: {
363 lib32: {
364 // LP32 cruft
365 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
366 },
367 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700368 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700369 "-Wno-sign-compare",
Dan Willemsen879cec22016-02-29 10:37:56 -0800370 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700371 "-DPOSIX_MISTAKE",
372 "-include netbsd-compat.h",
373 ],
374
Dan Willemsen208ae172015-09-16 16:33:27 -0700375 local_include_dirs: [
376 "upstream-netbsd/android/include",
377 "upstream-netbsd/lib/libc/include",
378 ],
379
380 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700381}
382
383// ========================================================
384// libc_openbsd_ndk.a - upstream OpenBSD C library code
385// that can be safely included in the libc_ndk.a (doesn't
386// contain any troublesome global data or constructors).
387// ========================================================
388//
389// These files are built with the openbsd-compat.h header file
390// automatically included.
391
392cc_library_static {
393 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700394 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700395 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700396 "upstream-openbsd/lib/libc/gen/alarm.c",
397 "upstream-openbsd/lib/libc/gen/ctype_.c",
398 "upstream-openbsd/lib/libc/gen/daemon.c",
399 "upstream-openbsd/lib/libc/gen/err.c",
400 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700401 "upstream-openbsd/lib/libc/gen/fnmatch.c",
402 "upstream-openbsd/lib/libc/gen/ftok.c",
403 "upstream-openbsd/lib/libc/gen/getprogname.c",
404 "upstream-openbsd/lib/libc/gen/isctype.c",
405 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700406 "upstream-openbsd/lib/libc/gen/tolower_.c",
407 "upstream-openbsd/lib/libc/gen/toupper_.c",
408 "upstream-openbsd/lib/libc/gen/verr.c",
409 "upstream-openbsd/lib/libc/gen/verrx.c",
410 "upstream-openbsd/lib/libc/gen/vwarn.c",
411 "upstream-openbsd/lib/libc/gen/vwarnx.c",
412 "upstream-openbsd/lib/libc/gen/warn.c",
413 "upstream-openbsd/lib/libc/gen/warnx.c",
414 "upstream-openbsd/lib/libc/locale/btowc.c",
415 "upstream-openbsd/lib/libc/locale/mbrlen.c",
416 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
417 "upstream-openbsd/lib/libc/locale/mbtowc.c",
418 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700419 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
420 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700421 "upstream-openbsd/lib/libc/locale/wcstoll.c",
422 "upstream-openbsd/lib/libc/locale/wcstombs.c",
423 "upstream-openbsd/lib/libc/locale/wcstoul.c",
424 "upstream-openbsd/lib/libc/locale/wcstoull.c",
425 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
426 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
427 "upstream-openbsd/lib/libc/locale/wctob.c",
428 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700429 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700430 "upstream-openbsd/lib/libc/net/htonl.c",
431 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700432 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
433 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
434 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700435 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
436 "upstream-openbsd/lib/libc/net/inet_ntop.c",
437 "upstream-openbsd/lib/libc/net/inet_pton.c",
438 "upstream-openbsd/lib/libc/net/ntohl.c",
439 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800440 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700441 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
443 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700444 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700445 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700446 "upstream-openbsd/lib/libc/stdio/fputwc.c",
447 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700448 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
449 "upstream-openbsd/lib/libc/stdio/fwalk.c",
450 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700451 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700452 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700453 "upstream-openbsd/lib/libc/stdio/makebuf.c",
454 "upstream-openbsd/lib/libc/stdio/mktemp.c",
455 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
456 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700457 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700458 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700459 "upstream-openbsd/lib/libc/stdio/tempnam.c",
460 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
461 "upstream-openbsd/lib/libc/stdio/ungetc.c",
462 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
463 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
464 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700465 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
466 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
467 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700468 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700469 "upstream-openbsd/lib/libc/stdio/wsetup.c",
470 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700471 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700472 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700473 "upstream-openbsd/lib/libc/stdlib/insque.c",
474 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
475 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
476 "upstream-openbsd/lib/libc/stdlib/labs.c",
477 "upstream-openbsd/lib/libc/stdlib/llabs.c",
478 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
479 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
480 "upstream-openbsd/lib/libc/stdlib/remque.c",
481 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700482 "upstream-openbsd/lib/libc/stdlib/tfind.c",
483 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
484 "upstream-openbsd/lib/libc/string/strcasecmp.c",
485 "upstream-openbsd/lib/libc/string/strcspn.c",
486 "upstream-openbsd/lib/libc/string/strdup.c",
487 "upstream-openbsd/lib/libc/string/strndup.c",
488 "upstream-openbsd/lib/libc/string/strpbrk.c",
489 "upstream-openbsd/lib/libc/string/strsep.c",
490 "upstream-openbsd/lib/libc/string/strspn.c",
491 "upstream-openbsd/lib/libc/string/strstr.c",
492 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700493 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700494 "upstream-openbsd/lib/libc/string/wcswidth.c",
495 ],
496
Colin Cross50c21ab2015-10-31 23:03:05 -0700497 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700498 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700499 "-Wno-unused-parameter",
500 "-include openbsd-compat.h",
501 ],
502
Dan Willemsen208ae172015-09-16 16:33:27 -0700503 local_include_dirs: [
504 "private",
505 "stdio",
506 "upstream-openbsd/android/include",
507 "upstream-openbsd/lib/libc/include",
508 "upstream-openbsd/lib/libc/gdtoa/",
509 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700510}
511
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700512cc_library_static {
513 name: "libc_openbsd_large_stack",
514 defaults: ["libc_defaults"],
515 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700516 "stdio/vfprintf.cpp",
517 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700518 ],
519 cflags: [
520 "-include openbsd-compat.h",
521 "-Wno-sign-compare",
522 "-Wframe-larger-than=5000",
523 ],
524
525 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700526 "upstream-openbsd/android/include/",
527 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700528 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700529 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700530 ],
531}
532
Dan Willemsen208ae172015-09-16 16:33:27 -0700533// ========================================================
534// libc_openbsd.a - upstream OpenBSD C library code
535// ========================================================
536//
537// These files are built with the openbsd-compat.h header file
538// automatically included.
539cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700540 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700541 srcs: [
Elliott Hughes211c4d32018-02-02 15:10:32 -0800542 // These two depend on getentropy, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700543 "upstream-openbsd/lib/libc/crypt/arc4random.c",
544 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
545
546 // May be overriden by per-arch optimized versions
547 "upstream-openbsd/lib/libc/string/memchr.c",
548 "upstream-openbsd/lib/libc/string/memmove.c",
549 "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: [
568 "upstream-openbsd/lib/libc/string/memmove.c",
569 "upstream-openbsd/lib/libc/string/stpcpy.c",
570 "upstream-openbsd/lib/libc/string/strcat.c",
571 ],
572 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700573 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700574 arm64: {
575 exclude_srcs: [
576 "upstream-openbsd/lib/libc/string/memchr.c",
577 "upstream-openbsd/lib/libc/string/memmove.c",
578 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700579 "upstream-openbsd/lib/libc/string/strcpy.c",
580 "upstream-openbsd/lib/libc/string/strncmp.c",
581 ],
582 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530583 mips: {
584 exclude_srcs: [
585 "upstream-openbsd/lib/libc/string/memchr.c",
586 "upstream-openbsd/lib/libc/string/memmove.c",
587 "upstream-openbsd/lib/libc/string/strcpy.c",
588 "upstream-openbsd/lib/libc/string/strncmp.c",
589 ],
590 },
591 mips64: {
592 exclude_srcs: [
593 "upstream-openbsd/lib/libc/string/memchr.c",
594 "upstream-openbsd/lib/libc/string/memmove.c",
595 "upstream-openbsd/lib/libc/string/strcpy.c",
596 "upstream-openbsd/lib/libc/string/strncmp.c",
597 ],
598 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700599 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800600 exclude_srcs: [
601 "upstream-openbsd/lib/libc/string/memchr.c",
602 "upstream-openbsd/lib/libc/string/memmove.c",
603 "upstream-openbsd/lib/libc/string/memrchr.c",
604 "upstream-openbsd/lib/libc/string/stpcpy.c",
605 "upstream-openbsd/lib/libc/string/stpncpy.c",
606 "upstream-openbsd/lib/libc/string/strcat.c",
607 "upstream-openbsd/lib/libc/string/strcpy.c",
608 "upstream-openbsd/lib/libc/string/strncmp.c",
609 "upstream-openbsd/lib/libc/string/strncpy.c",
610 ],
611 ssse3: {
612 exclude_srcs: [
613 "upstream-openbsd/lib/libc/string/strlcat.c",
614 "upstream-openbsd/lib/libc/string/strlcpy.c",
615 "upstream-openbsd/lib/libc/string/strncat.c",
616 ],
617 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700618 },
619
620 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800621 exclude_srcs: [
622 "upstream-openbsd/lib/libc/string/memmove.c",
623 "upstream-openbsd/lib/libc/string/stpcpy.c",
624 "upstream-openbsd/lib/libc/string/stpncpy.c",
625 "upstream-openbsd/lib/libc/string/strcat.c",
626 "upstream-openbsd/lib/libc/string/strcpy.c",
Colin Cross6ab8f892015-11-23 14:12:15 -0800627 "upstream-openbsd/lib/libc/string/strncat.c",
628 "upstream-openbsd/lib/libc/string/strncmp.c",
629 "upstream-openbsd/lib/libc/string/strncpy.c",
630 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700631 },
632 },
633
Colin Cross50c21ab2015-10-31 23:03:05 -0700634 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700635 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700636 "-Wno-unused-parameter",
637 "-include openbsd-compat.h",
638 ],
639
Dan Willemsen208ae172015-09-16 16:33:27 -0700640 local_include_dirs: [
641 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700642 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700643 ],
644
645 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700646}
647
648// ========================================================
649// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
650// ========================================================
651//
652// These files are built with the openbsd-compat.h header file
653// automatically included.
654
655cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700656 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700657 srcs: [
658 "upstream-openbsd/android/gdtoa_support.cpp",
659 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
660 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
661 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
662 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
663 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
664 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
665 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
666 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
667 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
668 "upstream-openbsd/lib/libc/gdtoa/misc.c",
669 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
670 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
671 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
672 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
673 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
674 "upstream-openbsd/lib/libc/gdtoa/sum.c",
675 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
676 ],
677 multilib: {
678 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800679 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700680 },
681 },
682
Colin Cross50c21ab2015-10-31 23:03:05 -0700683 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700684 "-Wno-sign-compare",
Dan Willemsen208ae172015-09-16 16:33:27 -0700685 "-include openbsd-compat.h",
686 ],
687
Dan Willemsen208ae172015-09-16 16:33:27 -0700688 local_include_dirs: [
689 "private",
690 "upstream-openbsd/android/include",
691 "upstream-openbsd/lib/libc/include",
692 ],
693
694 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700695}
696
697// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700698// libc_fortify.a - container for our FORITFY
699// implementation details
700// ========================================================
701cc_library_static {
702 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700703 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700704
705 name: "libc_fortify",
706
707 // Disable FORTIFY for the compilation of these, so we don't end up having
708 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800709 cflags: [
710 "-U_FORTIFY_SOURCE",
711 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
712 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700713
714 arch: {
715 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700716 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700717 srcs: [
718 "arch-arm/generic/bionic/__memcpy_chk.S",
719 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800720 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800721 cflags: [
722 "-DNO___STRCAT_CHK",
723 "-DNO___STRCPY_CHK",
724 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700725 srcs: [
726 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
727 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
728 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700729 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800730 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700731 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800732 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
733 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
734 ],
735 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700736 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
737 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
738 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700739 },
740 cortex_a9: {
741 srcs: [
742 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
743 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
744 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800745 exclude_srcs: [
746 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
747 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
748 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700749 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800750 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700751 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800752 "arch-arm/krait/bionic/__strcat_chk.S",
753 "arch-arm/krait/bionic/__strcpy_chk.S",
754 ],
755 exclude_srcs: [
756 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
757 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
758 ],
759 },
760 cortex_a53: {
761 srcs: [
762 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
763 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
764 ],
765 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700766 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
767 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
768 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700769 },
770 cortex_a73: {
771 srcs: [
772 "arch-arm/denver/bionic/__strcat_chk.S",
773 "arch-arm/denver/bionic/__strcpy_chk.S",
774 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800775 exclude_srcs: [
776 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
777 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
778 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700779 },
780 denver: {
781 srcs: [
782 "arch-arm/denver/bionic/__strcat_chk.S",
783 "arch-arm/denver/bionic/__strcpy_chk.S",
784 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800785 exclude_srcs: [
786 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
787 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
788 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700789 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800790 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700791 srcs: [
792 "arch-arm/krait/bionic/__strcat_chk.S",
793 "arch-arm/krait/bionic/__strcpy_chk.S",
794 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800795 exclude_srcs: [
796 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
797 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700798 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700799 },
800 },
801 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700802 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700803 srcs: [
804 "arch-arm64/generic/bionic/__memcpy_chk.S",
805 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700806 },
807 },
808}
809
810// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700811// libc_bionic.a - home-grown C library code
812// ========================================================
813
814cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700815 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700816 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700817 // The data that backs getauxval is initialized in the libc init
818 // functions which are invoked by the linker. If this file is included
819 // in libc_ndk.a, only one of the copies of the global data will be
820 // initialized, resulting in nullptr dereferences.
821 "bionic/getauxval.cpp",
822
Elliott Hughes211c4d32018-02-02 15:10:32 -0800823 // These require getauxval, which isn't available on older platforms.
Dan Willemsen208ae172015-09-16 16:33:27 -0700824 "bionic/sysconf.cpp",
825 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700826 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700827
Josh Gao10ec9282017-04-03 15:13:29 -0700828 // The following must not be statically linked into libc_ndk.a, because
829 // debuggerd will look for the abort message in libc.so's copy.
830 "bionic/android_set_abort_message.cpp",
831
Dan Willemsen208ae172015-09-16 16:33:27 -0700832 "bionic/strchr.cpp",
833 "bionic/strnlen.c",
834 "bionic/strrchr.cpp",
835 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700836
837 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700838 arm: {
839 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800840 "arch-arm/generic/bionic/memcmp.S",
841 "arch-arm/generic/bionic/memcpy.S",
842 "arch-arm/generic/bionic/memset.S",
843 "arch-arm/generic/bionic/strcmp.S",
844 "arch-arm/generic/bionic/strcpy.S",
845 "arch-arm/generic/bionic/strlen.c",
846
Dan Willemsen208ae172015-09-16 16:33:27 -0700847 "arch-arm/bionic/atomics_arm.c",
848 "arch-arm/bionic/__bionic_clone.S",
849 "arch-arm/bionic/_exit_with_stack_teardown.S",
850 "arch-arm/bionic/libgcc_compat.c",
851 "arch-arm/bionic/popcount_tab.c",
852 "arch-arm/bionic/__restore.S",
853 "arch-arm/bionic/setjmp.S",
854 "arch-arm/bionic/syscall.S",
855 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700856 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800857 cortex_a7: {
858 srcs: [
859 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800860 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800861 ],
862 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800863 "arch-arm/cortex-a15/bionic/memcpy.S",
864 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800865 ],
866 },
867 cortex_a9: {
868 srcs: [
869 "arch-arm/cortex-a9/bionic/memcpy.S",
870 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800871
Colin Cross6ab8f892015-11-23 14:12:15 -0800872 "arch-arm/cortex-a9/bionic/stpcpy.S",
873 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800874 "arch-arm/cortex-a9/bionic/strcmp.S",
875 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800876 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800877 ],
878 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800879 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800880 "arch-arm/cortex-a15/bionic/memcpy.S",
881
Colin Cross6ab8f892015-11-23 14:12:15 -0800882 "arch-arm/cortex-a15/bionic/stpcpy.S",
883 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800884 "arch-arm/cortex-a15/bionic/strcmp.S",
885 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800886 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800887 ],
888 },
889 krait: {
890 srcs: [
891 "arch-arm/krait/bionic/memcpy.S",
892 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800893
Colin Cross6ab8f892015-11-23 14:12:15 -0800894 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800895 ],
896 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800897 "arch-arm/cortex-a15/bionic/memset.S",
898 "arch-arm/cortex-a15/bionic/memcpy.S",
899
900 "arch-arm/cortex-a15/bionic/strcmp.S",
901 ],
902 },
903 cortex_a53: {
904 srcs: [
905 "arch-arm/cortex-a53/bionic/memcpy.S",
906 "arch-arm/cortex-a7/bionic/memset.S",
907 ],
908 exclude_srcs: [
909 "arch-arm/cortex-a15/bionic/memset.S",
910 "arch-arm/cortex-a15/bionic/memcpy.S",
911 ],
912 },
913 cortex_a73: {
914 srcs: [
915 "arch-arm/cortex-a7/bionic/memset.S",
916 "arch-arm/denver/bionic/memcpy.S",
917
918 "arch-arm/krait/bionic/strcmp.S",
919 ],
920 exclude_srcs: [
921 "arch-arm/cortex-a15/bionic/memset.S",
922 "arch-arm/cortex-a15/bionic/memcpy.S",
923 "arch-arm/cortex-a15/bionic/strcmp.S",
924 ],
925 },
926 denver: {
927 srcs: [
928 "arch-arm/denver/bionic/memcpy.S",
929 "arch-arm/denver/bionic/memset.S",
930 ],
931 exclude_srcs: [
932 "arch-arm/cortex-a15/bionic/memset.S",
933 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800934 ],
935 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700936 kryo: {
937 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400938 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400939 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800940
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800941 "arch-arm/krait/bionic/strcmp.S",
942 ],
943 exclude_srcs: [
944 "arch-arm/cortex-a15/bionic/memset.S",
945 "arch-arm/cortex-a15/bionic/memcpy.S",
946 "arch-arm/cortex-a15/bionic/strcmp.S",
947 ],
948 },
949 // Cores not listed above (like cortex-a8, cortex-a15) or
950 // "generic" core will use the following implementation.
951 neon: {
952 srcs: [
953 "arch-arm/cortex-a15/bionic/memcpy.S",
954 "arch-arm/cortex-a15/bionic/memset.S",
955
Christopher Ferris950a9582017-03-29 13:10:56 -0700956 "arch-arm/cortex-a15/bionic/stpcpy.S",
957 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800958 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -0700959 "arch-arm/cortex-a15/bionic/strcpy.S",
960 "arch-arm/cortex-a15/bionic/strlen.S",
961
962 "arch-arm/denver/bionic/memmove.S",
963 ],
964 exclude_srcs: [
965 "arch-arm/generic/bionic/memcpy.S",
966 "arch-arm/generic/bionic/memset.S",
967 "arch-arm/generic/bionic/strcmp.S",
968 "arch-arm/generic/bionic/strcpy.S",
969 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -0700970 ],
971 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700972 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700973 arm64: {
974 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700975 "arch-arm64/generic/bionic/memchr.S",
976 "arch-arm64/generic/bionic/memcmp.S",
977 "arch-arm64/generic/bionic/memcpy.S",
978 "arch-arm64/generic/bionic/memmove.S",
979 "arch-arm64/generic/bionic/memset.S",
980 "arch-arm64/generic/bionic/stpcpy.S",
981 "arch-arm64/generic/bionic/strchr.S",
982 "arch-arm64/generic/bionic/strcmp.S",
983 "arch-arm64/generic/bionic/strcpy.S",
984 "arch-arm64/generic/bionic/strlen.S",
985 "arch-arm64/generic/bionic/strncmp.S",
986 "arch-arm64/generic/bionic/strnlen.S",
987 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800988
989 "arch-arm64/bionic/__bionic_clone.S",
990 "arch-arm64/bionic/_exit_with_stack_teardown.S",
991 "arch-arm64/bionic/setjmp.S",
992 "arch-arm64/bionic/syscall.S",
993 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700994 ],
995 exclude_srcs: [
996 "bionic/__memcpy_chk.cpp",
997 "bionic/strchr.cpp",
998 "bionic/strnlen.c",
999 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001000 denver64: {
1001 srcs: [
1002 "arch-arm64/denver64/bionic/memcpy.S",
1003 "arch-arm64/denver64/bionic/memset.S",
1004 ],
1005 exclude_srcs: [
1006 "arch-arm64/generic/bionic/memcpy.S",
1007 "arch-arm64/generic/bionic/memset.S",
1008 ],
1009 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001010 cortex_a53: {
1011 srcs: [
1012 "arch-arm64/cortex-a53/bionic/memmove.S",
1013 ],
1014 exclude_srcs: [
1015 "arch-arm64/generic/bionic/memmove.S",
1016 ],
1017 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001018 cortex_a73: {
1019 srcs: [
1020 "arch-arm64/cortex-a53/bionic/memmove.S",
1021 ],
1022 exclude_srcs: [
1023 "arch-arm64/generic/bionic/memmove.S",
1024 ],
1025 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001026 },
1027
1028 mips: {
1029 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001030 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301031 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001032 "arch-mips/string/memset.S",
1033 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301034 "arch-mips/string/strncmp.S",
1035 "arch-mips/string/strlen.c",
1036 "arch-mips/string/strnlen.c",
1037 "arch-mips/string/strchr.c",
1038 "arch-mips/string/strcpy.c",
1039 "arch-mips/string/memchr.c",
1040 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001041
Dan Willemsen208ae172015-09-16 16:33:27 -07001042 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001043 "arch-mips/bionic/cacheflush.cpp",
1044 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001045 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001046 "arch-mips/bionic/setjmp.S",
1047 "arch-mips/bionic/syscall.S",
1048 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001049 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301050 exclude_srcs: [
1051 "bionic/strchr.cpp",
1052 "bionic/strnlen.c",
1053 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001054 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001055 mips64: {
1056 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001057 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301058 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001059 "arch-mips/string/memset.S",
1060 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301061 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001062 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301063 "arch-mips/string/strnlen.c",
1064 "arch-mips/string/strchr.c",
1065 "arch-mips/string/strcpy.c",
1066 "arch-mips/string/memchr.c",
1067 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001068
Dan Willemsen208ae172015-09-16 16:33:27 -07001069 "arch-mips64/bionic/__bionic_clone.S",
1070 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1071 "arch-mips64/bionic/setjmp.S",
1072 "arch-mips64/bionic/syscall.S",
1073 "arch-mips64/bionic/vfork.S",
1074 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001075 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301076 exclude_srcs: [
1077 "bionic/strchr.cpp",
1078 "bionic/strnlen.c",
1079 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001080 },
1081
1082 x86: {
1083 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001084 "arch-x86/generic/string/memcmp.S",
1085 "arch-x86/generic/string/strcmp.S",
1086 "arch-x86/generic/string/strncmp.S",
1087 "arch-x86/generic/string/strcat.S",
1088 "arch-x86/atom/string/sse2-memchr-atom.S",
1089 "arch-x86/atom/string/sse2-memrchr-atom.S",
1090 "arch-x86/atom/string/sse2-strchr-atom.S",
1091 "arch-x86/atom/string/sse2-strnlen-atom.S",
1092 "arch-x86/atom/string/sse2-strrchr-atom.S",
1093 "arch-x86/atom/string/sse2-wcschr-atom.S",
1094 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1095 "arch-x86/atom/string/sse2-wcslen-atom.S",
1096 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001097 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1098 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1099 "arch-x86/silvermont/string/sse2-memset-slm.S",
1100 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1101 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1102 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1103 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1104 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001105
1106 "arch-x86/bionic/__bionic_clone.S",
1107 "arch-x86/bionic/_exit_with_stack_teardown.S",
1108 "arch-x86/bionic/libgcc_compat.c",
1109 "arch-x86/bionic/__restore.S",
1110 "arch-x86/bionic/setjmp.S",
1111 "arch-x86/bionic/syscall.S",
1112 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001113 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001114
1115 exclude_srcs: [
1116 "bionic/strchr.cpp",
1117 "bionic/strnlen.c",
1118 "bionic/strrchr.cpp",
1119 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001120 atom: {
1121 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001122 "arch-x86/atom/string/sse2-memset-atom.S",
1123 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001124 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001125 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001126 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001127 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001128 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1129 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1130 ],
1131 exclude_srcs: [
1132 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001133 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1134 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1135 "arch-x86/silvermont/string/sse2-memset-slm.S",
1136 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1137 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1138 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1139 ],
1140 },
1141 ssse3: {
1142 srcs: [
1143 "arch-x86/atom/string/ssse3-strncat-atom.S",
1144 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1145 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1146 "arch-x86/atom/string/ssse3-strcat-atom.S",
1147 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1148 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1149 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1150 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1151 ],
1152 exclude_srcs: [
1153 "arch-x86/generic/string/strcmp.S",
1154 "arch-x86/generic/string/strncmp.S",
1155 "arch-x86/generic/string/strcat.S",
1156 ],
1157 },
1158 sse4: {
1159 srcs: [
1160 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1161 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1162 ],
1163 exclude_srcs: [
1164 "arch-x86/generic/string/memcmp.S",
1165 ],
1166 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001167 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001168 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001169 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001170 "arch-x86_64/string/sse2-memcpy-slm.S",
1171 "arch-x86_64/string/sse2-memmove-slm.S",
1172 "arch-x86_64/string/sse2-memset-slm.S",
1173 "arch-x86_64/string/sse2-stpcpy-slm.S",
1174 "arch-x86_64/string/sse2-stpncpy-slm.S",
1175 "arch-x86_64/string/sse2-strcat-slm.S",
1176 "arch-x86_64/string/sse2-strcpy-slm.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001177 "arch-x86_64/string/sse2-strlen-slm.S",
1178 "arch-x86_64/string/sse2-strncat-slm.S",
1179 "arch-x86_64/string/sse2-strncpy-slm.S",
1180 "arch-x86_64/string/sse4-memcmp-slm.S",
1181 "arch-x86_64/string/ssse3-strcmp-slm.S",
1182 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001183
1184 "arch-x86_64/bionic/__bionic_clone.S",
1185 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1186 "arch-x86_64/bionic/__restore_rt.S",
1187 "arch-x86_64/bionic/setjmp.S",
1188 "arch-x86_64/bionic/syscall.S",
1189 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001190 ],
1191 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001192 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001193
Colin Cross50c21ab2015-10-31 23:03:05 -07001194 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001195 include_dirs: ["bionic/libstdc++/include"],
1196 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001197}
1198
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001199genrule {
1200 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001201 out: ["generated_android_ids.h"],
1202 srcs: [":android_filesystem_config_header"],
1203 tool_files: ["fs_config_generator.py"],
1204 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001205}
1206
Dan Willemsen268a6732015-10-15 14:49:45 -07001207// ========================================================
1208// libc_bionic_ndk.a- The portions of libc_bionic that can
1209// be safely used in libc_ndk.a (no troublesome global data
1210// or constructors).
1211// ========================================================
1212cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001213 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001214 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001215 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001216 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001217 "bionic/__cmsg_nxthdr.cpp",
1218 "bionic/__errno.cpp",
1219 "bionic/__gnu_basename.cpp",
1220 "bionic/__libc_current_sigrtmax.cpp",
1221 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001222 "bionic/abort.cpp",
1223 "bionic/accept.cpp",
1224 "bionic/accept4.cpp",
1225 "bionic/access.cpp",
1226 "bionic/arpa_inet.cpp",
1227 "bionic/assert.cpp",
1228 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001229 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001230 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001231 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001232 "bionic/bionic_systrace.cpp",
1233 "bionic/bionic_time_conversions.cpp",
1234 "bionic/brk.cpp",
1235 "bionic/c16rtomb.cpp",
1236 "bionic/c32rtomb.cpp",
1237 "bionic/chmod.cpp",
1238 "bionic/chown.cpp",
1239 "bionic/clearenv.cpp",
1240 "bionic/clock.cpp",
1241 "bionic/clock_getcpuclockid.cpp",
1242 "bionic/clock_nanosleep.cpp",
1243 "bionic/clone.cpp",
1244 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001245 "bionic/connect.cpp",
1246 "bionic/ctype.cpp",
1247 "bionic/dirent.cpp",
1248 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001249 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001250 "bionic/error.cpp",
1251 "bionic/eventfd_read.cpp",
1252 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001253 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001254 "bionic/faccessat.cpp",
1255 "bionic/fchmod.cpp",
1256 "bionic/fchmodat.cpp",
1257 "bionic/ffs.cpp",
1258 "bionic/fgetxattr.cpp",
1259 "bionic/flistxattr.cpp",
1260 "bionic/flockfile.cpp",
1261 "bionic/fpclassify.cpp",
1262 "bionic/fsetxattr.cpp",
1263 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001264 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001265 "bionic/futimens.cpp",
1266 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001267 "bionic/getdomainname.cpp",
Elliott Hughes211c4d32018-02-02 15:10:32 -08001268 "bionic/getentropy.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001269 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001270 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001271 "bionic/getpgrp.cpp",
1272 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001273 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001274 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001275 "bionic/grp_pwd.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -08001276 "bionic/grp_pwd_file.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001277 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001278 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001279 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001280 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001281 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001282 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001283 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001284 "bionic/lchown.cpp",
1285 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001286 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001287 "bionic/libgen.cpp",
1288 "bionic/link.cpp",
1289 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001290 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001291 "bionic/lstat.cpp",
1292 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001293 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001294 "bionic/mbrtoc16.cpp",
1295 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001296 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001297 "bionic/mempcpy.cpp",
1298 "bionic/mkdir.cpp",
1299 "bionic/mkfifo.cpp",
1300 "bionic/mknod.cpp",
1301 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001302 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001303 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001304 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001305 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001306 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001307 "bionic/open.cpp",
1308 "bionic/pathconf.cpp",
1309 "bionic/pause.cpp",
1310 "bionic/pipe.cpp",
1311 "bionic/poll.cpp",
1312 "bionic/posix_fadvise.cpp",
1313 "bionic/posix_fallocate.cpp",
1314 "bionic/posix_madvise.cpp",
1315 "bionic/posix_timers.cpp",
1316 "bionic/ptrace.cpp",
1317 "bionic/pty.cpp",
1318 "bionic/raise.cpp",
1319 "bionic/rand.cpp",
1320 "bionic/readlink.cpp",
1321 "bionic/reboot.cpp",
1322 "bionic/recv.cpp",
1323 "bionic/rename.cpp",
1324 "bionic/rmdir.cpp",
1325 "bionic/scandir.cpp",
1326 "bionic/sched_getaffinity.cpp",
1327 "bionic/sched_getcpu.cpp",
1328 "bionic/semaphore.cpp",
1329 "bionic/send.cpp",
1330 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001331 "bionic/seteuid.cpp",
1332 "bionic/setpgrp.cpp",
1333 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001334 "bionic/signal.cpp",
Elliott Hughes7ae39122018-02-26 16:49:43 -08001335 "bionic/sigprocmask.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001336 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001337 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001338 "bionic/stat.cpp",
1339 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001340 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001341 "bionic/strchrnul.cpp",
1342 "bionic/strerror.cpp",
1343 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001344 "bionic/string_l.cpp",
1345 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001346 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001347 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001348 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001349 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001350 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001351 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001352 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001353 "bionic/sys_msg.cpp",
1354 "bionic/sys_sem.cpp",
1355 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001356 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001357 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001358 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001359 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001360 "bionic/sysinfo.cpp",
1361 "bionic/syslog.cpp",
Elliott Hughes71ba5892018-02-07 12:44:45 -08001362 "bionic/system.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001363 "bionic/system_property_api.cpp",
1364 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001365 "bionic/tdestroy.cpp",
1366 "bionic/termios.cpp",
1367 "bionic/thread_private.cpp",
1368 "bionic/tmpfile.cpp",
1369 "bionic/umount.cpp",
1370 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001371 "bionic/wait.cpp",
1372 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001373 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001374 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001375 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001376 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001377 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001378
1379 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1380 // which will be overridden by the actual one in libc.so.
1381 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001382 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001383
Dan Willemsen208ae172015-09-16 16:33:27 -07001384 multilib: {
1385 lib32: {
1386 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001387 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001388 },
1389 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001390 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001391 treble_linker_namespaces: {
1392 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001393 },
1394 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001395 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001396 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001397 local_include_dirs: ["stdio"],
1398 include_dirs: ["bionic/libstdc++/include"],
1399 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001400 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001401}
1402
Dan Willemsen208ae172015-09-16 16:33:27 -07001403// ========================================================
1404// libc_pthread.a - pthreads parts that previously lived in
1405// libc_bionic.a. Relocated to their own library because
1406// they can't be included in libc_ndk.a (as they layout of
1407// pthread_t has changed over the years and has ABI
1408// compatibility issues).
1409// ========================================================
1410
1411cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001412 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001413 srcs: [
1414 "bionic/pthread_atfork.cpp",
1415 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001416 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001417 "bionic/pthread_cond.cpp",
1418 "bionic/pthread_create.cpp",
1419 "bionic/pthread_detach.cpp",
1420 "bionic/pthread_equal.cpp",
1421 "bionic/pthread_exit.cpp",
1422 "bionic/pthread_getcpuclockid.cpp",
1423 "bionic/pthread_getschedparam.cpp",
1424 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001425 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001426 "bionic/pthread_join.cpp",
1427 "bionic/pthread_key.cpp",
1428 "bionic/pthread_kill.cpp",
1429 "bionic/pthread_mutex.cpp",
1430 "bionic/pthread_once.cpp",
1431 "bionic/pthread_rwlock.cpp",
1432 "bionic/pthread_self.cpp",
1433 "bionic/pthread_setname_np.cpp",
1434 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001435 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001436
1437 // The following implementations depend on pthread data or implementation,
1438 // so we can't include them in libc_ndk.a.
1439 "bionic/__cxa_thread_atexit_impl.cpp",
1440 "stdlib/atexit.c",
1441 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001442 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001443
Colin Cross50c21ab2015-10-31 23:03:05 -07001444 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001445 include_dirs: ["bionic/libstdc++/include"],
1446 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001447}
1448
1449// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001450// libc_syscalls.a
1451// ========================================================
1452
1453cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001454 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001455 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001456 arch: {
1457 arm: {
1458 srcs: ["arch-arm/syscalls/**/*.S"],
1459 },
1460 arm64: {
1461 srcs: ["arch-arm64/syscalls/**/*.S"],
1462 },
1463 mips: {
1464 srcs: ["arch-mips/syscalls/**/*.S"],
1465 },
1466 mips64: {
1467 srcs: ["arch-mips64/syscalls/**/*.S"],
1468 },
1469 x86: {
1470 srcs: ["arch-x86/syscalls/**/*.S"],
1471 },
1472 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001473 srcs: ["arch-x86_64/syscalls/**/*.S"],
1474 },
1475 },
1476 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001477}
1478
1479// ========================================================
1480// libc_aeabi.a
1481// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1482// to avoid infinite recursion. For the other architectures we just build an
1483// empty library to keep this makefile simple.
1484// ========================================================
1485
1486cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001487 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001488 arch: {
1489 arm: {
1490 srcs: ["arch-arm/bionic/__aeabi.c"],
1491 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001492 },
1493 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001494 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001495}
1496
1497// ========================================================
1498// libc_ndk.a
1499// Compatibility library for the NDK. This library contains
1500// all the parts of libc that are safe to statically link.
1501// We can't safely statically link things that can only run
1502// on a certain version of the OS. Examples include
1503// anything that talks to netd (a large portion of the DNS
1504// code) and anything that is dependent on the layout of a
1505// data structure that has changed across releases (such as
1506// pthread_t).
1507// ========================================================
1508
1509cc_library_static {
1510 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001511 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001512 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001513 multilib: {
1514 lib32: {
1515 srcs: libc_common_src_files_32,
1516 },
1517 },
1518 arch: {
1519 arm: {
1520 srcs: [
1521 "arch-arm/bionic/exidx_dynamic.c",
1522 "arch-common/bionic/crtbegin_so.c",
1523 "arch-arm/bionic/atexit_legacy.c",
1524 "arch-common/bionic/crtend_so.S",
1525 ],
1526 whole_static_libs: ["libc_aeabi"],
1527 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001528 },
1529
Colin Cross50c21ab2015-10-31 23:03:05 -07001530 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001531 "-fvisibility=hidden",
1532 "-DLIBC_STATIC",
1533 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001534
1535 whole_static_libs: [
1536 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001537 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001538 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001539 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001540 "libc_gdtoa",
1541 "libc_malloc",
1542 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001543 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001544 "libc_openbsd_ndk",
1545 "libc_stack_protector",
1546 "libc_syscalls",
1547 "libc_tzcode",
1548 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001549 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001550 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001551 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001552}
1553
1554// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001555// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001556// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001557cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001558 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001559 srcs: libc_common_src_files,
1560 multilib: {
1561 lib32: {
1562 srcs: libc_common_src_files_32,
1563 },
1564 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001565 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001566
1567 whole_static_libs: [
1568 "libc_bionic",
1569 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001570 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001571 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001572 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001573 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001574 "libc_gdtoa",
1575 "libc_malloc",
1576 "libc_netbsd",
1577 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001578 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001579 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001580 "libc_stack_protector",
1581 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001582 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001583 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001584 ],
1585
1586 arch: {
1587 arm: {
1588 whole_static_libs: ["libc_aeabi"],
1589 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001590 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001591}
1592
1593// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001594// libc_common.a
1595// ========================================================
1596
1597cc_library_static {
1598 defaults: ["libc_defaults"],
1599 name: "libc_common",
1600
1601 whole_static_libs: [
1602 "libc_nopthread",
1603 "libc_pthread",
1604 ],
1605}
1606
1607// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001608// libc_nomalloc.a
1609// ========================================================
1610//
1611// This is a version of the static C library that does not
1612// include malloc. It's useful in situations when the user wants
1613// to provide their own malloc implementation, or wants to
1614// explicitly disallow the use of malloc, such as in the
1615// dynamic linker.
1616
1617cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001618 name: "libc_nomalloc",
1619
Colin Cross50c21ab2015-10-31 23:03:05 -07001620 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001621
1622 arch: {
1623 arm: {
1624 srcs: ["arch-arm/bionic/exidx_static.c"],
1625 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001626 },
1627
Colin Cross50c21ab2015-10-31 23:03:05 -07001628 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001629
Colin Crossa3f9fca2016-01-11 13:20:55 -08001630 whole_static_libs: [
1631 "libc_common",
1632 "libc_init_static",
1633 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001634}
1635
1636// ========================================================
1637// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1638// ========================================================
1639cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001640 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001641 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001642 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001643
Dan Willemsen208ae172015-09-16 16:33:27 -07001644 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001645}
1646
1647// ========================================================
1648// libc.a + libc.so
1649// ========================================================
1650cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001651 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001652 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001653 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001654 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001655 platform_sdk_version: {
1656 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1657 },
1658 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001659 static: {
1660 srcs: [
1661 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001662 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001663 ],
1664 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001665 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001666 },
1667 shared: {
1668 srcs: [
1669 "arch-common/bionic/crtbegin_so.c",
1670 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001671 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001672 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001673 "bionic/NetdClient.cpp",
1674 "arch-common/bionic/crtend_so.S",
1675 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001676 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001677 },
1678
1679 required: ["tzdata"],
1680
1681 // Leave the symbols in the shared library so that stack unwinders can produce
1682 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001683 strip: {
1684 keep_symbols: true,
1685 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001686
Colin Cross4ce94d22016-11-15 13:15:43 -08001687 // Do not pack libc.so relocations; see http://b/20645321 for details.
1688 pack_relocations: false,
1689
dimitry06016f22018-01-05 11:39:28 +01001690 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1691 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1692 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1693 // those new libraries from libgcc.a are not declared external; if that were the case,
1694 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1695 // on the external symbols from the dependent libraries. That would create a "cloaked"
1696 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001697
dimitry06016f22018-01-05 11:39:28 +01001698 shared_libs: [
1699 "ld-android",
1700 "libdl",
1701 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001702 whole_static_libs: [
1703 "libc_common",
1704 "libjemalloc",
1705 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001706
1707 nocrt: true,
1708
Dan Willemsen208ae172015-09-16 16:33:27 -07001709 arch: {
1710 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001711 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1712 ldflags: ["-Wl,--hash-style=both"],
1713
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001714 // Don't re-export new/delete and friends, even if the compiler really wants to.
1715 version_script: "libc.arm.map",
1716
Dan Willemsen208ae172015-09-16 16:33:27 -07001717 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001718 srcs: [
1719 "arch-arm/bionic/exidx_dynamic.c",
1720
1721 // special for arm
1722 "arch-arm/bionic/atexit_legacy.c",
1723 ],
1724 // special for arm
1725 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001726 },
1727 static: {
1728 srcs: ["arch-arm/bionic/exidx_static.c"],
1729 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001730 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001731 arm64: {
1732 // Don't re-export new/delete and friends, even if the compiler really wants to.
1733 version_script: "libc.arm64.map",
1734 },
1735 mips: {
1736 // Don't re-export new/delete and friends, even if the compiler really wants to.
1737 version_script: "libc.mips.map",
1738 },
1739 mips64: {
1740 // Don't re-export new/delete and friends, even if the compiler really wants to.
1741 version_script: "libc.mips64.map",
1742 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001743 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001744 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1745 ldflags: ["-Wl,--hash-style=both"],
1746
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001747 // Don't re-export new/delete and friends, even if the compiler really wants to.
1748 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001749 },
1750 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001751 // Don't re-export new/delete and friends, even if the compiler really wants to.
1752 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001753 },
1754 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001755}
1756
Dan Willemsen208ae172015-09-16 16:33:27 -07001757// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001758// libstdc++.so + libstdc++.a
1759// ========================================================
1760cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001761 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001762 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001763 srcs: [
1764 "bionic/__cxa_guard.cpp",
1765 "bionic/__cxa_pure_virtual.cpp",
1766 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001767 ],
1768 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001769 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001770 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001771 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001772
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001773 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001774 arch: {
1775 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001776 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001777 version_script: "libstdc++.arm.map",
1778 },
1779 arm64: {
1780 version_script: "libstdc++.arm64.map",
1781 },
1782 mips: {
1783 version_script: "libstdc++.mips.map",
1784 },
1785 mips64: {
1786 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001787 },
1788 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001789 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001790 version_script: "libstdc++.x86.map",
1791 },
1792 x86_64: {
1793 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001794 },
1795 },
1796}
1797
Colin Cross50c21ab2015-10-31 23:03:05 -07001798cc_defaults {
1799 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001800 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001801 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001802
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001803 cflags: [
1804 "-Wno-gcc-compat",
1805 "-Wall",
1806 "-Werror",
1807 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001808}
1809
Colin Cross50c21ab2015-10-31 23:03:05 -07001810cc_defaults {
1811 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001812 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001813
1814 arch: {
1815 mips: {
1816 cflags: ["-fPIC"],
1817 },
1818 mips64: {
1819 cflags: ["-fPIC"],
1820 },
1821 x86: {
1822 cflags: ["-fPIC"],
1823 },
1824 x86_64: {
1825 cflags: ["-fPIC"],
1826 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001827 },
1828}
1829
Dan Willemsena3ed9012017-04-04 15:51:26 -07001830// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001831cc_object {
1832 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001833 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001834 local_include_dirs: ["include"],
1835 product_variables: {
1836 platform_sdk_version: {
1837 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1838 },
1839 },
1840 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001841
Colin Cross7d7b3682017-11-03 13:38:40 -07001842 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001843}
1844
Dan Willemsen208ae172015-09-16 16:33:27 -07001845cc_object {
1846 name: "crtbegin_so1",
1847 local_include_dirs: ["include"],
1848 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001849
Colin Cross7d7b3682017-11-03 13:38:40 -07001850 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001851}
1852
Dan Willemsen208ae172015-09-16 16:33:27 -07001853cc_object {
1854 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001855
Colin Cross7d7b3682017-11-03 13:38:40 -07001856 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001857 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001858 "crtbegin_so1",
1859 "crtbrand",
1860 ],
1861}
1862
Dan Willemsen208ae172015-09-16 16:33:27 -07001863cc_object {
1864 name: "crtend_so",
1865 local_include_dirs: ["include"],
1866 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001867
Colin Cross7d7b3682017-11-03 13:38:40 -07001868 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001869}
1870
Dan Willemsen208ae172015-09-16 16:33:27 -07001871cc_object {
1872 name: "crtbegin_static1",
1873 local_include_dirs: ["include"],
1874 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001875
Colin Cross50c21ab2015-10-31 23:03:05 -07001876 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001877 mips: {
1878 srcs: [
1879 "arch-mips/bionic/crtbegin.c",
1880 ],
1881 exclude_srcs: [
1882 "arch-common/bionic/crtbegin.c",
1883 ],
1884 },
1885 mips64: {
1886 srcs: [
1887 "arch-mips64/bionic/crtbegin.c",
1888 ],
1889 exclude_srcs: [
1890 "arch-common/bionic/crtbegin.c",
1891 ],
1892 },
1893 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001894
1895 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001896}
1897
Dan Willemsen208ae172015-09-16 16:33:27 -07001898cc_object {
1899 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001900
Colin Cross77d57bf2016-04-11 14:34:18 -07001901 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001902 "crtbegin_static1",
1903 "crtbrand",
1904 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001905 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001906}
1907
Dan Willemsen208ae172015-09-16 16:33:27 -07001908cc_object {
1909 name: "crtbegin_dynamic1",
1910 local_include_dirs: ["include"],
1911 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001912
Colin Cross50c21ab2015-10-31 23:03:05 -07001913 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001914 mips: {
1915 srcs: [
1916 "arch-mips/bionic/crtbegin.c",
1917 ],
1918 exclude_srcs: [
1919 "arch-common/bionic/crtbegin.c",
1920 ],
1921 },
1922 mips64: {
1923 srcs: [
1924 "arch-mips64/bionic/crtbegin.c",
1925 ],
1926 exclude_srcs: [
1927 "arch-common/bionic/crtbegin.c",
1928 ],
1929 },
1930 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001931 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001932}
1933
Dan Willemsen208ae172015-09-16 16:33:27 -07001934cc_object {
1935 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001936
Colin Cross77d57bf2016-04-11 14:34:18 -07001937 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001938 "crtbegin_dynamic1",
1939 "crtbrand",
1940 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001941 target: {
1942 linux_bionic: {
1943 generated_sources: ["host_bionic_linker_asm"],
1944 objs: [
1945 "linker_wrapper",
1946 ],
1947 },
1948 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001949 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001950}
1951
Dan Willemsen208ae172015-09-16 16:33:27 -07001952cc_object {
1953 // We rename crtend.o to crtend_android.o to avoid a
1954 // name clash between gcc and bionic.
1955 name: "crtend_android",
1956 local_include_dirs: ["include"],
1957 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001958
Colin Cross50c21ab2015-10-31 23:03:05 -07001959 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001960}
Colin Crossbaa48992016-07-13 11:15:21 -07001961
Dan Albert22805ea2017-03-22 15:28:05 -07001962preprocessed_ndk_headers {
1963 name: "common_libc",
1964 from: "include",
1965 to: "",
1966 license: "NOTICE",
1967}
Dan Albert4238a352016-06-28 11:18:05 -07001968
1969ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08001970 name: "libc_uapi",
1971 from: "kernel/uapi",
1972 to: "",
1973 srcs: [
1974 "kernel/uapi/asm-generic/**/*.h",
1975 "kernel/uapi/drm/**/*.h",
1976 "kernel/uapi/linux/**/*.h",
1977 "kernel/uapi/misc/**/*.h",
1978 "kernel/uapi/mtd/**/*.h",
1979 "kernel/uapi/rdma/**/*.h",
1980 "kernel/uapi/scsi/**/*.h",
1981 "kernel/uapi/sound/**/*.h",
1982 "kernel/uapi/video/**/*.h",
1983 "kernel/uapi/xen/**/*.h",
1984 ],
Dan Albert92592652016-10-20 01:42:54 -07001985 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07001986}
1987
1988ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001989 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07001990 from: "kernel/android/uapi/linux",
1991 to: "linux",
1992 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07001993 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07001994}
1995
1996ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001997 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07001998 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001999 to: "scsi",
2000 srcs: ["kernel/android/scsi/**/*.h"],
2001 license: "NOTICE",
2002}
2003
2004ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002005 name: "libc_asm_arm",
2006 from: "kernel/uapi/asm-arm",
2007 to: "arm-linux-androideabi",
2008 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002009 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002010}
2011
2012ndk_headers {
2013 name: "libc_asm_arm64",
2014 from: "kernel/uapi/asm-arm64",
2015 to: "aarch64-linux-android",
2016 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002017 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002018}
2019
Elliott Hughesee291c02017-12-11 11:32:34 -08002020// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002021ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002022 name: "libc_asm_mips",
2023 from: "kernel/uapi/asm-mips",
2024 to: "mipsel-linux-android",
2025 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2026 license: "NOTICE",
2027}
2028
Elliott Hughesee291c02017-12-11 11:32:34 -08002029// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002030ndk_headers {
2031 name: "libc_asm_mips64",
2032 from: "kernel/uapi/asm-mips",
2033 to: "mips64el-linux-android",
2034 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2035 license: "NOTICE",
2036}
2037
2038ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002039 name: "libc_asm_x86",
2040 from: "kernel/uapi/asm-x86",
2041 to: "i686-linux-android",
2042 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002043 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002044}
2045
2046ndk_headers {
2047 name: "libc_asm_x86_64",
2048 from: "kernel/uapi/asm-x86",
2049 to: "x86_64-linux-android",
2050 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002051 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002052}
2053
Dan Albert4238a352016-06-28 11:18:05 -07002054ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002055 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002056 symbol_file: "libc.map.txt",
2057 first_version: "9",
2058}
2059
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002060llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002061 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002062 symbol_file: "libc.map.txt",
2063 export_headers_as_system: true,
2064 export_preprocessed_headers: ["include"],
2065 arch: {
2066 arm: {
2067 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002068 "kernel/uapi",
2069 "kernel/uapi/asm-arm",
2070 "kernel/android/uapi",
2071 ],
2072 },
2073 arm64: {
2074 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002075 "kernel/uapi",
2076 "kernel/uapi/asm-arm64",
2077 "kernel/android/uapi",
2078 ],
2079 },
2080 mips: {
2081 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002082 "kernel/uapi",
2083 "kernel/uapi/asm-mips",
2084 "kernel/android/uapi",
2085 ],
2086 },
2087 mips64: {
2088 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002089 "kernel/uapi",
2090 "kernel/uapi/asm-mips",
2091 "kernel/android/uapi",
2092 ],
2093 },
2094 x86: {
2095 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002096 "kernel/uapi",
2097 "kernel/uapi/asm-x86",
2098 "kernel/android/uapi",
2099 ],
2100 },
2101 x86_64: {
2102 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002103 "kernel/uapi",
2104 "kernel/uapi/asm-x86",
2105 "kernel/android/uapi",
2106 ],
2107 },
2108 },
2109}
2110
Dan Albertdf31aff2016-10-06 15:50:41 -07002111ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002112 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002113 symbol_file: "libstdc++.map.txt",
2114 first_version: "9",
2115}
2116
Dan Willemsenca056d72018-01-08 14:00:24 -08002117// Export these headers for toolbox to process
2118filegroup {
2119 name: "kernel_input_headers",
2120 srcs: [
2121 "kernel/uapi/linux/input.h",
2122 "kernel/uapi/linux/input-event-codes.h",
2123 ],
2124}