blob: 2508ff7db1d5ea6d8b8a9b761b3dca5405f4fcaf [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",
36 "-Wall",
37 "-Wextra",
38 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080039 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070040 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070041 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070042 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070043
44 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
45 "-Werror=pointer-to-int-cast",
46 "-Werror=int-to-pointer-cast",
47 "-Werror=type-limits",
48 "-Werror",
49]
50
Dan Willemsen208ae172015-09-16 16:33:27 -070051// Define some common cflags
52// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070053cc_defaults {
54 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080055 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070056 cflags: libc_common_flags,
57 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070058 conlyflags: ["-std=gnu99"],
59 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070060 include_dirs: [
61 "bionic/libc/async_safe/include",
62 "external/jemalloc/include",
63 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070064
Colin Cross50c21ab2015-10-31 23:03:05 -070065 stl: "none",
66 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070067 sanitize: {
68 never: true,
69 },
Colin Cross50c21ab2015-10-31 23:03:05 -070070 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070071}
72
Dan Willemsen208ae172015-09-16 16:33:27 -070073// ANDROIDMK TRANSLATION ERROR: unsupported directive
74// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
75//libc_common_cflags += ["-DDEBUG"]
76// ANDROIDMK TRANSLATION ERROR: unsupported directive
77// endif
78
Dan Willemsen208ae172015-09-16 16:33:27 -070079// ========================================================
80// libc_stack_protector.a - stack protector code
81// ========================================================
82//
Colin Crossa3f9fca2016-01-11 13:20:55 -080083// Code that implements the stack protector (or that runs
84// before TLS has been set up) needs to be compiled with
85// -fno-stack-protector, since it accesses the stack canary
86// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070087
88cc_library_static {
89
Colin Crossa3f9fca2016-01-11 13:20:55 -080090 srcs: [
91 "bionic/__libc_init_main_thread.cpp",
92 "bionic/__stack_chk_fail.cpp",
93 ],
94 arch: {
95 arm64: {
96 srcs: ["arch-arm64/bionic/__set_tls.c"],
97 },
98 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -080099 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800100 },
101 x86_64: {
102 srcs: ["arch-x86_64/bionic/__set_tls.c"],
103 },
104 },
105
Colin Cross50c21ab2015-10-31 23:03:05 -0700106 defaults: ["libc_defaults"],
107 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700108 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700109}
110
Colin Crossa3f9fca2016-01-11 13:20:55 -0800111// libc_init_static.cpp also needs to be built without stack protector,
112// because it's responsible for setting up TLS for static executables.
113// This isn't the case for dynamic executables because the dynamic linker
114// has already set up the main thread's TLS.
115
116cc_library_static {
117 name: "libc_init_static",
118 defaults: ["libc_defaults"],
119 srcs: ["bionic/libc_init_static.cpp"],
120 cflags: ["-fno-stack-protector"],
121}
122
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700123cc_library_static {
124 name: "libc_init_dynamic",
125 defaults: ["libc_defaults"],
126 srcs: ["bionic/libc_init_dynamic.cpp"],
127 cflags: ["-fno-stack-protector"],
128}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800129
Dan Willemsen208ae172015-09-16 16:33:27 -0700130// ========================================================
131// libc_tzcode.a - upstream 'tzcode' code
132// ========================================================
133
134cc_library_static {
135
Colin Cross50c21ab2015-10-31 23:03:05 -0700136 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700137 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800138 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700139 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700140 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
141 ],
142
Colin Cross50c21ab2015-10-31 23:03:05 -0700143 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700144 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700145 // Don't use ridiculous amounts of stack.
146 "-DALL_STATE",
147 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
148 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800149 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700150 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700151 // The name of the tm_gmtoff field in our struct tm.
152 "-DTM_GMTOFF=tm_gmtoff",
153 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700154 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700155 // Include `tzname`, `timezone`, and `daylight` globals.
156 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700157 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800158 // Use the empty string (instead of " ") as the timezone abbreviation
159 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700160 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700161 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
162 "-Dlint",
163 ],
164
Dan Willemsen208ae172015-09-16 16:33:27 -0700165 local_include_dirs: ["tzcode/"],
166 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700167}
168
169// ========================================================
170// libc_dns.a - modified NetBSD DNS code
171// ========================================================
172
173cc_library_static {
174
Colin Cross50c21ab2015-10-31 23:03:05 -0700175 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700176 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800177 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700178
179 "upstream-netbsd/lib/libc/isc/ev_streams.c",
180 "upstream-netbsd/lib/libc/isc/ev_timers.c",
181 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700182 ],
183
Colin Cross50c21ab2015-10-31 23:03:05 -0700184 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700185 "-DANDROID_CHANGES",
186 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700187 "-Wno-unused-parameter",
188 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700189 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700190 ],
191
Dan Willemsen208ae172015-09-16 16:33:27 -0700192 local_include_dirs: [
193 "dns/include",
194 "private",
195 "upstream-netbsd/lib/libc/include",
196 "upstream-netbsd/android/include",
197 ],
198
199 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700200}
201
202// ========================================================
203// libc_freebsd.a - upstream FreeBSD C library code
204// ========================================================
205//
206// These files are built with the freebsd-compat.h header file
207// automatically included.
208
209cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700210 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700211 srcs: [
212 "upstream-freebsd/lib/libc/gen/ldexp.c",
213 "upstream-freebsd/lib/libc/gen/sleep.c",
214 "upstream-freebsd/lib/libc/gen/usleep.c",
215 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700216 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
217 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
218 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
219 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700220 "upstream-freebsd/lib/libc/stdlib/qsort.c",
221 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700222 "upstream-freebsd/lib/libc/string/wcpcpy.c",
223 "upstream-freebsd/lib/libc/string/wcpncpy.c",
224 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700225 "upstream-freebsd/lib/libc/string/wcscat.c",
226 "upstream-freebsd/lib/libc/string/wcschr.c",
227 "upstream-freebsd/lib/libc/string/wcscmp.c",
228 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700229 "upstream-freebsd/lib/libc/string/wcscspn.c",
230 "upstream-freebsd/lib/libc/string/wcsdup.c",
231 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700232 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700233 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
234 "upstream-freebsd/lib/libc/string/wcsncat.c",
235 "upstream-freebsd/lib/libc/string/wcsncmp.c",
236 "upstream-freebsd/lib/libc/string/wcsncpy.c",
237 "upstream-freebsd/lib/libc/string/wcsnlen.c",
238 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700239 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700240 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700241 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700242 "upstream-freebsd/lib/libc/string/wcstok.c",
243 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700244 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700245 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700246 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800247 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700248 ],
249 arch: {
250 arm64: {
251 exclude_srcs: [
252 "upstream-freebsd/lib/libc/string/wmemmove.c",
253 ],
254 },
255 x86: {
256 exclude_srcs: [
257 "upstream-freebsd/lib/libc/string/wcschr.c",
258 "upstream-freebsd/lib/libc/string/wcscmp.c",
259 "upstream-freebsd/lib/libc/string/wcslen.c",
260 "upstream-freebsd/lib/libc/string/wcsrchr.c",
261 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800262 atom: {
263 exclude_srcs: [
264 "upstream-freebsd/lib/libc/string/wmemcmp.c",
265 ],
266 },
267 ssse3: {
268 exclude_srcs: [
269 "upstream-freebsd/lib/libc/string/wcscat.c",
270 "upstream-freebsd/lib/libc/string/wcscpy.c",
271 ],
272 },
273 sse4: {
274 exclude_srcs: [
275 "upstream-freebsd/lib/libc/string/wmemcmp.c",
276 ],
277 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700278 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700279 },
280
Colin Cross50c21ab2015-10-31 23:03:05 -0700281 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700282 "-Wno-sign-compare",
283 "-Wno-uninitialized",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700284 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700285 "-include freebsd-compat.h",
286 ],
287
Dan Willemsen208ae172015-09-16 16:33:27 -0700288 local_include_dirs: [
289 "upstream-freebsd/android/include",
290 ],
291
292 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700293}
294
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700295cc_library_static {
296 defaults: ["libc_defaults"],
297 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700298 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700299 "upstream-freebsd/lib/libc/stdlib/realpath.c",
300 ],
301
302 cflags: [
303 "-Wno-sign-compare",
304 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700305 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700306 ],
307
308 local_include_dirs: [
309 "upstream-freebsd/android/include",
310 ],
311
312 name: "libc_freebsd_large_stack",
313}
314
Dan Willemsen208ae172015-09-16 16:33:27 -0700315// ========================================================
316// libc_netbsd.a - upstream NetBSD C library code
317// ========================================================
318//
319// These files are built with the netbsd-compat.h header file
320// automatically included.
321
322cc_library_static {
323
Colin Cross50c21ab2015-10-31 23:03:05 -0700324 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700325 srcs: [
326 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700327 "upstream-netbsd/lib/libc/gen/nice.c",
328 "upstream-netbsd/lib/libc/gen/popen.c",
329 "upstream-netbsd/lib/libc/gen/psignal.c",
330 "upstream-netbsd/lib/libc/gen/utime.c",
331 "upstream-netbsd/lib/libc/gen/utmp.c",
332 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
333 "upstream-netbsd/lib/libc/regex/regcomp.c",
334 "upstream-netbsd/lib/libc/regex/regerror.c",
335 "upstream-netbsd/lib/libc/regex/regexec.c",
336 "upstream-netbsd/lib/libc/regex/regfree.c",
337 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
338 "upstream-netbsd/lib/libc/stdlib/div.c",
339 "upstream-netbsd/lib/libc/stdlib/drand48.c",
340 "upstream-netbsd/lib/libc/stdlib/erand48.c",
341 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
342 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
343 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
344 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
345 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
346 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
347 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
348 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
349 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
350 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
351 "upstream-netbsd/lib/libc/stdlib/seed48.c",
352 "upstream-netbsd/lib/libc/stdlib/srand48.c",
353 "upstream-netbsd/lib/libc/string/memccpy.c",
354 "upstream-netbsd/lib/libc/string/strcasestr.c",
355 "upstream-netbsd/lib/libc/string/strcoll.c",
356 "upstream-netbsd/lib/libc/string/strxfrm.c",
357 ],
358 multilib: {
359 lib32: {
360 // LP32 cruft
361 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
362 },
363 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700364 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700365 "-Wno-sign-compare",
366 "-Wno-uninitialized",
Dan Willemsen879cec22016-02-29 10:37:56 -0800367 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700368 "-DPOSIX_MISTAKE",
369 "-include netbsd-compat.h",
370 ],
371
Dan Willemsen208ae172015-09-16 16:33:27 -0700372 local_include_dirs: [
373 "upstream-netbsd/android/include",
374 "upstream-netbsd/lib/libc/include",
375 ],
376
377 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700378}
379
380// ========================================================
381// libc_openbsd_ndk.a - upstream OpenBSD C library code
382// that can be safely included in the libc_ndk.a (doesn't
383// contain any troublesome global data or constructors).
384// ========================================================
385//
386// These files are built with the openbsd-compat.h header file
387// automatically included.
388
389cc_library_static {
390 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700391 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700392 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700393 "upstream-openbsd/lib/libc/gen/alarm.c",
394 "upstream-openbsd/lib/libc/gen/ctype_.c",
395 "upstream-openbsd/lib/libc/gen/daemon.c",
396 "upstream-openbsd/lib/libc/gen/err.c",
397 "upstream-openbsd/lib/libc/gen/errx.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700398 "upstream-openbsd/lib/libc/gen/fnmatch.c",
399 "upstream-openbsd/lib/libc/gen/ftok.c",
400 "upstream-openbsd/lib/libc/gen/getprogname.c",
401 "upstream-openbsd/lib/libc/gen/isctype.c",
402 "upstream-openbsd/lib/libc/gen/setprogname.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700403 "upstream-openbsd/lib/libc/gen/tolower_.c",
404 "upstream-openbsd/lib/libc/gen/toupper_.c",
405 "upstream-openbsd/lib/libc/gen/verr.c",
406 "upstream-openbsd/lib/libc/gen/verrx.c",
407 "upstream-openbsd/lib/libc/gen/vwarn.c",
408 "upstream-openbsd/lib/libc/gen/vwarnx.c",
409 "upstream-openbsd/lib/libc/gen/warn.c",
410 "upstream-openbsd/lib/libc/gen/warnx.c",
411 "upstream-openbsd/lib/libc/locale/btowc.c",
412 "upstream-openbsd/lib/libc/locale/mbrlen.c",
413 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
414 "upstream-openbsd/lib/libc/locale/mbtowc.c",
415 "upstream-openbsd/lib/libc/locale/wcscoll.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700416 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
417 "upstream-openbsd/lib/libc/locale/wcstol.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700418 "upstream-openbsd/lib/libc/locale/wcstoll.c",
419 "upstream-openbsd/lib/libc/locale/wcstombs.c",
420 "upstream-openbsd/lib/libc/locale/wcstoul.c",
421 "upstream-openbsd/lib/libc/locale/wcstoull.c",
422 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
423 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
424 "upstream-openbsd/lib/libc/locale/wctob.c",
425 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700426 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700427 "upstream-openbsd/lib/libc/net/htonl.c",
428 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700429 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
430 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
431 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700432 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
433 "upstream-openbsd/lib/libc/net/inet_ntop.c",
434 "upstream-openbsd/lib/libc/net/inet_pton.c",
435 "upstream-openbsd/lib/libc/net/ntohl.c",
436 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800437 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700438 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700439 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
440 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700441 "upstream-openbsd/lib/libc/stdio/flags.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700442 "upstream-openbsd/lib/libc/stdio/fpurge.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700443 "upstream-openbsd/lib/libc/stdio/fputwc.c",
444 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700445 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
446 "upstream-openbsd/lib/libc/stdio/fwalk.c",
447 "upstream-openbsd/lib/libc/stdio/fwide.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700448 "upstream-openbsd/lib/libc/stdio/getdelim.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700449 "upstream-openbsd/lib/libc/stdio/gets.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700450 "upstream-openbsd/lib/libc/stdio/makebuf.c",
451 "upstream-openbsd/lib/libc/stdio/mktemp.c",
452 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
453 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700454 "upstream-openbsd/lib/libc/stdio/rget.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700455 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700456 "upstream-openbsd/lib/libc/stdio/tempnam.c",
457 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
458 "upstream-openbsd/lib/libc/stdio/ungetc.c",
459 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
460 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
461 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700462 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
463 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
464 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700465 "upstream-openbsd/lib/libc/stdio/wbuf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700466 "upstream-openbsd/lib/libc/stdio/wsetup.c",
467 "upstream-openbsd/lib/libc/stdlib/abs.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700468 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700469 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700470 "upstream-openbsd/lib/libc/stdlib/insque.c",
471 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
472 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
473 "upstream-openbsd/lib/libc/stdlib/labs.c",
474 "upstream-openbsd/lib/libc/stdlib/llabs.c",
475 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
476 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
477 "upstream-openbsd/lib/libc/stdlib/remque.c",
478 "upstream-openbsd/lib/libc/stdlib/setenv.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700479 "upstream-openbsd/lib/libc/stdlib/system.c",
480 "upstream-openbsd/lib/libc/stdlib/tfind.c",
481 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
482 "upstream-openbsd/lib/libc/string/strcasecmp.c",
483 "upstream-openbsd/lib/libc/string/strcspn.c",
484 "upstream-openbsd/lib/libc/string/strdup.c",
485 "upstream-openbsd/lib/libc/string/strndup.c",
486 "upstream-openbsd/lib/libc/string/strpbrk.c",
487 "upstream-openbsd/lib/libc/string/strsep.c",
488 "upstream-openbsd/lib/libc/string/strspn.c",
489 "upstream-openbsd/lib/libc/string/strstr.c",
490 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700491 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700492 "upstream-openbsd/lib/libc/string/wcswidth.c",
493 ],
494
Colin Cross50c21ab2015-10-31 23:03:05 -0700495 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700496 "-Wno-sign-compare",
497 "-Wno-uninitialized",
498 "-Wno-unused-parameter",
499 "-include openbsd-compat.h",
500 ],
501
Dan Willemsen208ae172015-09-16 16:33:27 -0700502 local_include_dirs: [
503 "private",
504 "stdio",
505 "upstream-openbsd/android/include",
506 "upstream-openbsd/lib/libc/include",
507 "upstream-openbsd/lib/libc/gdtoa/",
508 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700509}
510
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700511cc_library_static {
512 name: "libc_openbsd_large_stack",
513 defaults: ["libc_defaults"],
514 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700515 "stdio/vfprintf.cpp",
516 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700517 ],
518 cflags: [
519 "-include openbsd-compat.h",
520 "-Wno-sign-compare",
521 "-Wframe-larger-than=5000",
522 ],
523
524 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700525 "upstream-openbsd/android/include/",
526 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700527 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700528 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700529 ],
530}
531
Dan Willemsen208ae172015-09-16 16:33:27 -0700532// ========================================================
533// libc_openbsd.a - upstream OpenBSD C library code
534// ========================================================
535//
536// These files are built with the openbsd-compat.h header file
537// automatically included.
538cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700539 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700540 srcs: [
Dan Willemsen35e91a12015-09-17 15:28:45 -0700541 // These two depend on getentropy_linux.c, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700542 "upstream-openbsd/lib/libc/crypt/arc4random.c",
543 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
544
545 // May be overriden by per-arch optimized versions
546 "upstream-openbsd/lib/libc/string/memchr.c",
547 "upstream-openbsd/lib/libc/string/memmove.c",
548 "upstream-openbsd/lib/libc/string/memrchr.c",
549 "upstream-openbsd/lib/libc/string/stpcpy.c",
550 "upstream-openbsd/lib/libc/string/stpncpy.c",
551 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700552 "upstream-openbsd/lib/libc/string/strcpy.c",
553 "upstream-openbsd/lib/libc/string/strlcat.c",
554 "upstream-openbsd/lib/libc/string/strlcpy.c",
555 "upstream-openbsd/lib/libc/string/strncat.c",
556 "upstream-openbsd/lib/libc/string/strncmp.c",
557 "upstream-openbsd/lib/libc/string/strncpy.c",
558 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700559
560 arch: {
561 arm: {
562 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700563 "upstream-openbsd/lib/libc/string/strcpy.c",
564 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800565 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700566 exclude_srcs: [
567 "upstream-openbsd/lib/libc/string/memmove.c",
568 "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",
576 "upstream-openbsd/lib/libc/string/memmove.c",
577 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700578 "upstream-openbsd/lib/libc/string/strcpy.c",
579 "upstream-openbsd/lib/libc/string/strncmp.c",
580 ],
581 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530582 mips: {
583 exclude_srcs: [
584 "upstream-openbsd/lib/libc/string/memchr.c",
585 "upstream-openbsd/lib/libc/string/memmove.c",
586 "upstream-openbsd/lib/libc/string/strcpy.c",
587 "upstream-openbsd/lib/libc/string/strncmp.c",
588 ],
589 },
590 mips64: {
591 exclude_srcs: [
592 "upstream-openbsd/lib/libc/string/memchr.c",
593 "upstream-openbsd/lib/libc/string/memmove.c",
594 "upstream-openbsd/lib/libc/string/strcpy.c",
595 "upstream-openbsd/lib/libc/string/strncmp.c",
596 ],
597 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700598 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800599 exclude_srcs: [
600 "upstream-openbsd/lib/libc/string/memchr.c",
601 "upstream-openbsd/lib/libc/string/memmove.c",
602 "upstream-openbsd/lib/libc/string/memrchr.c",
603 "upstream-openbsd/lib/libc/string/stpcpy.c",
604 "upstream-openbsd/lib/libc/string/stpncpy.c",
605 "upstream-openbsd/lib/libc/string/strcat.c",
606 "upstream-openbsd/lib/libc/string/strcpy.c",
607 "upstream-openbsd/lib/libc/string/strncmp.c",
608 "upstream-openbsd/lib/libc/string/strncpy.c",
609 ],
610 ssse3: {
611 exclude_srcs: [
612 "upstream-openbsd/lib/libc/string/strlcat.c",
613 "upstream-openbsd/lib/libc/string/strlcpy.c",
614 "upstream-openbsd/lib/libc/string/strncat.c",
615 ],
616 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700617 },
618
619 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800620 exclude_srcs: [
621 "upstream-openbsd/lib/libc/string/memmove.c",
622 "upstream-openbsd/lib/libc/string/stpcpy.c",
623 "upstream-openbsd/lib/libc/string/stpncpy.c",
624 "upstream-openbsd/lib/libc/string/strcat.c",
625 "upstream-openbsd/lib/libc/string/strcpy.c",
626 "upstream-openbsd/lib/libc/string/strlcat.c",
627 "upstream-openbsd/lib/libc/string/strlcpy.c",
628 "upstream-openbsd/lib/libc/string/strncat.c",
629 "upstream-openbsd/lib/libc/string/strncmp.c",
630 "upstream-openbsd/lib/libc/string/strncpy.c",
631 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700632 },
633 },
634
Colin Cross50c21ab2015-10-31 23:03:05 -0700635 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700636 "-Wno-sign-compare",
637 "-Wno-uninitialized",
638 "-Wno-unused-parameter",
639 "-include openbsd-compat.h",
640 ],
641
Dan Willemsen208ae172015-09-16 16:33:27 -0700642 local_include_dirs: [
643 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700644 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700645 ],
646
647 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700648}
649
650// ========================================================
651// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
652// ========================================================
653//
654// These files are built with the openbsd-compat.h header file
655// automatically included.
656
657cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700658 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700659 srcs: [
660 "upstream-openbsd/android/gdtoa_support.cpp",
661 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
662 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
663 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
664 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
665 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
666 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
667 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
668 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
669 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
670 "upstream-openbsd/lib/libc/gdtoa/misc.c",
671 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
672 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
673 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
674 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
675 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
676 "upstream-openbsd/lib/libc/gdtoa/sum.c",
677 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
678 ],
679 multilib: {
680 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800681 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700682 },
683 },
684
Colin Cross50c21ab2015-10-31 23:03:05 -0700685 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700686 "-Wno-sign-compare",
687 "-Wno-uninitialized",
Dan Willemsen208ae172015-09-16 16:33:27 -0700688 "-include openbsd-compat.h",
689 ],
690
Dan Willemsen208ae172015-09-16 16:33:27 -0700691 local_include_dirs: [
692 "private",
693 "upstream-openbsd/android/include",
694 "upstream-openbsd/lib/libc/include",
695 ],
696
697 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700698}
699
700// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700701// libc_fortify.a - container for our FORITFY
702// implementation details
703// ========================================================
704cc_library_static {
705 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700706 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700707
708 name: "libc_fortify",
709
710 // Disable FORTIFY for the compilation of these, so we don't end up having
711 // FORTIFY silently call itself.
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800712 cflags: [
713 "-U_FORTIFY_SOURCE",
714 "-D__BIONIC_DECLARE_FORTIFY_HELPERS",
715 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700716
717 arch: {
718 arm: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700719 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700720 srcs: [
721 "arch-arm/generic/bionic/__memcpy_chk.S",
722 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800723 neon: {
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800724 cflags: [
725 "-DNO___STRCAT_CHK",
726 "-DNO___STRCPY_CHK",
727 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700728 srcs: [
729 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
730 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
731 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700732 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800733 cortex_a7: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700734 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800735 "arch-arm/cortex-a7/bionic/__strcat_chk.S",
736 "arch-arm/cortex-a7/bionic/__strcpy_chk.S",
737 ],
738 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700739 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
740 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
741 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700742 },
743 cortex_a9: {
744 srcs: [
745 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
746 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
747 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800748 exclude_srcs: [
749 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
750 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
751 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700752 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800753 krait: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700754 srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800755 "arch-arm/krait/bionic/__strcat_chk.S",
756 "arch-arm/krait/bionic/__strcpy_chk.S",
757 ],
758 exclude_srcs: [
759 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
760 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
761 ],
762 },
763 cortex_a53: {
764 srcs: [
765 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
766 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
767 ],
768 exclude_srcs: [
George Burgess IV6cb06872017-07-21 13:28:42 -0700769 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
770 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
771 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700772 },
773 cortex_a73: {
774 srcs: [
775 "arch-arm/denver/bionic/__strcat_chk.S",
776 "arch-arm/denver/bionic/__strcpy_chk.S",
777 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800778 exclude_srcs: [
779 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
780 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
781 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700782 },
783 denver: {
784 srcs: [
785 "arch-arm/denver/bionic/__strcat_chk.S",
786 "arch-arm/denver/bionic/__strcpy_chk.S",
787 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800788 exclude_srcs: [
789 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
790 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
791 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700792 },
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800793 kryo: {
George Burgess IV6cb06872017-07-21 13:28:42 -0700794 srcs: [
795 "arch-arm/krait/bionic/__strcat_chk.S",
796 "arch-arm/krait/bionic/__strcpy_chk.S",
797 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800798 exclude_srcs: [
799 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
800 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
George Burgess IV6cb06872017-07-21 13:28:42 -0700801 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700802 },
803 },
804 arm64: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700805 cflags: ["-DNO___MEMCPY_CHK"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700806 srcs: [
807 "arch-arm64/generic/bionic/__memcpy_chk.S",
808 ],
George Burgess IV6cb06872017-07-21 13:28:42 -0700809 },
810 },
811}
812
813// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -0700814// libc_bionic.a - home-grown C library code
815// ========================================================
816
817cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700818 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700819 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700820 // The data that backs getauxval is initialized in the libc init
821 // functions which are invoked by the linker. If this file is included
822 // in libc_ndk.a, only one of the copies of the global data will be
823 // initialized, resulting in nullptr dereferences.
824 "bionic/getauxval.cpp",
825
Dan Willemsen35e91a12015-09-17 15:28:45 -0700826 // These four require getauxval, which isn't available on older
Dan Willemsen208ae172015-09-16 16:33:27 -0700827 // platforms.
828 "bionic/getentropy_linux.c",
829 "bionic/sysconf.cpp",
830 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700831 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700832
Josh Gao10ec9282017-04-03 15:13:29 -0700833 // The following must not be statically linked into libc_ndk.a, because
834 // debuggerd will look for the abort message in libc.so's copy.
835 "bionic/android_set_abort_message.cpp",
836
Dan Willemsen208ae172015-09-16 16:33:27 -0700837 "bionic/strchr.cpp",
838 "bionic/strnlen.c",
839 "bionic/strrchr.cpp",
840 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700841
842 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700843 arm: {
844 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800845 "arch-arm/generic/bionic/memcmp.S",
846 "arch-arm/generic/bionic/memcpy.S",
847 "arch-arm/generic/bionic/memset.S",
848 "arch-arm/generic/bionic/strcmp.S",
849 "arch-arm/generic/bionic/strcpy.S",
850 "arch-arm/generic/bionic/strlen.c",
851
Dan Willemsen208ae172015-09-16 16:33:27 -0700852 "arch-arm/bionic/atomics_arm.c",
853 "arch-arm/bionic/__bionic_clone.S",
854 "arch-arm/bionic/_exit_with_stack_teardown.S",
855 "arch-arm/bionic/libgcc_compat.c",
856 "arch-arm/bionic/popcount_tab.c",
857 "arch-arm/bionic/__restore.S",
858 "arch-arm/bionic/setjmp.S",
859 "arch-arm/bionic/syscall.S",
860 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700861 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800862 cortex_a7: {
863 srcs: [
864 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800865 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800866 ],
867 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800868 "arch-arm/cortex-a15/bionic/memcpy.S",
869 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800870 ],
871 },
872 cortex_a9: {
873 srcs: [
874 "arch-arm/cortex-a9/bionic/memcpy.S",
875 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800876
Colin Cross6ab8f892015-11-23 14:12:15 -0800877 "arch-arm/cortex-a9/bionic/stpcpy.S",
878 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800879 "arch-arm/cortex-a9/bionic/strcmp.S",
880 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800881 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800882 ],
883 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800884 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800885 "arch-arm/cortex-a15/bionic/memcpy.S",
886
Colin Cross6ab8f892015-11-23 14:12:15 -0800887 "arch-arm/cortex-a15/bionic/stpcpy.S",
888 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800889 "arch-arm/cortex-a15/bionic/strcmp.S",
890 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800891 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800892 ],
893 },
894 krait: {
895 srcs: [
896 "arch-arm/krait/bionic/memcpy.S",
897 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800898
Colin Cross6ab8f892015-11-23 14:12:15 -0800899 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800900 ],
901 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800902 "arch-arm/cortex-a15/bionic/memset.S",
903 "arch-arm/cortex-a15/bionic/memcpy.S",
904
905 "arch-arm/cortex-a15/bionic/strcmp.S",
906 ],
907 },
908 cortex_a53: {
909 srcs: [
910 "arch-arm/cortex-a53/bionic/memcpy.S",
911 "arch-arm/cortex-a7/bionic/memset.S",
912 ],
913 exclude_srcs: [
914 "arch-arm/cortex-a15/bionic/memset.S",
915 "arch-arm/cortex-a15/bionic/memcpy.S",
916 ],
917 },
918 cortex_a73: {
919 srcs: [
920 "arch-arm/cortex-a7/bionic/memset.S",
921 "arch-arm/denver/bionic/memcpy.S",
922
923 "arch-arm/krait/bionic/strcmp.S",
924 ],
925 exclude_srcs: [
926 "arch-arm/cortex-a15/bionic/memset.S",
927 "arch-arm/cortex-a15/bionic/memcpy.S",
928 "arch-arm/cortex-a15/bionic/strcmp.S",
929 ],
930 },
931 denver: {
932 srcs: [
933 "arch-arm/denver/bionic/memcpy.S",
934 "arch-arm/denver/bionic/memset.S",
935 ],
936 exclude_srcs: [
937 "arch-arm/cortex-a15/bionic/memset.S",
938 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800939 ],
940 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700941 kryo: {
942 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400943 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400944 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800945
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800946 "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 },
954 // Cores not listed above (like cortex-a8, cortex-a15) or
955 // "generic" core will use the following implementation.
956 neon: {
957 srcs: [
958 "arch-arm/cortex-a15/bionic/memcpy.S",
959 "arch-arm/cortex-a15/bionic/memset.S",
960
Christopher Ferris950a9582017-03-29 13:10:56 -0700961 "arch-arm/cortex-a15/bionic/stpcpy.S",
962 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800963 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -0700964 "arch-arm/cortex-a15/bionic/strcpy.S",
965 "arch-arm/cortex-a15/bionic/strlen.S",
966
967 "arch-arm/denver/bionic/memmove.S",
968 ],
969 exclude_srcs: [
970 "arch-arm/generic/bionic/memcpy.S",
971 "arch-arm/generic/bionic/memset.S",
972 "arch-arm/generic/bionic/strcmp.S",
973 "arch-arm/generic/bionic/strcpy.S",
974 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -0700975 ],
976 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700977 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700978 arm64: {
979 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700980 "arch-arm64/generic/bionic/memchr.S",
981 "arch-arm64/generic/bionic/memcmp.S",
982 "arch-arm64/generic/bionic/memcpy.S",
983 "arch-arm64/generic/bionic/memmove.S",
984 "arch-arm64/generic/bionic/memset.S",
985 "arch-arm64/generic/bionic/stpcpy.S",
986 "arch-arm64/generic/bionic/strchr.S",
987 "arch-arm64/generic/bionic/strcmp.S",
988 "arch-arm64/generic/bionic/strcpy.S",
989 "arch-arm64/generic/bionic/strlen.S",
990 "arch-arm64/generic/bionic/strncmp.S",
991 "arch-arm64/generic/bionic/strnlen.S",
992 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800993
994 "arch-arm64/bionic/__bionic_clone.S",
995 "arch-arm64/bionic/_exit_with_stack_teardown.S",
996 "arch-arm64/bionic/setjmp.S",
997 "arch-arm64/bionic/syscall.S",
998 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700999 ],
1000 exclude_srcs: [
1001 "bionic/__memcpy_chk.cpp",
1002 "bionic/strchr.cpp",
1003 "bionic/strnlen.c",
1004 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001005 denver64: {
1006 srcs: [
1007 "arch-arm64/denver64/bionic/memcpy.S",
1008 "arch-arm64/denver64/bionic/memset.S",
1009 ],
1010 exclude_srcs: [
1011 "arch-arm64/generic/bionic/memcpy.S",
1012 "arch-arm64/generic/bionic/memset.S",
1013 ],
1014 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001015 cortex_a53: {
1016 srcs: [
1017 "arch-arm64/cortex-a53/bionic/memmove.S",
1018 ],
1019 exclude_srcs: [
1020 "arch-arm64/generic/bionic/memmove.S",
1021 ],
1022 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001023 cortex_a73: {
1024 srcs: [
1025 "arch-arm64/cortex-a53/bionic/memmove.S",
1026 ],
1027 exclude_srcs: [
1028 "arch-arm64/generic/bionic/memmove.S",
1029 ],
1030 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001031 },
1032
1033 mips: {
1034 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001035 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301036 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001037 "arch-mips/string/memset.S",
1038 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301039 "arch-mips/string/strncmp.S",
1040 "arch-mips/string/strlen.c",
1041 "arch-mips/string/strnlen.c",
1042 "arch-mips/string/strchr.c",
1043 "arch-mips/string/strcpy.c",
1044 "arch-mips/string/memchr.c",
1045 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001046
Dan Willemsen208ae172015-09-16 16:33:27 -07001047 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001048 "arch-mips/bionic/cacheflush.cpp",
1049 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001050 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001051 "arch-mips/bionic/setjmp.S",
1052 "arch-mips/bionic/syscall.S",
1053 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001054 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301055 exclude_srcs: [
1056 "bionic/strchr.cpp",
1057 "bionic/strnlen.c",
1058 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001059 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001060 mips64: {
1061 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001062 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301063 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001064 "arch-mips/string/memset.S",
1065 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301066 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001067 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301068 "arch-mips/string/strnlen.c",
1069 "arch-mips/string/strchr.c",
1070 "arch-mips/string/strcpy.c",
1071 "arch-mips/string/memchr.c",
1072 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001073
Dan Willemsen208ae172015-09-16 16:33:27 -07001074 "arch-mips64/bionic/__bionic_clone.S",
1075 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1076 "arch-mips64/bionic/setjmp.S",
1077 "arch-mips64/bionic/syscall.S",
1078 "arch-mips64/bionic/vfork.S",
1079 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001080 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301081 exclude_srcs: [
1082 "bionic/strchr.cpp",
1083 "bionic/strnlen.c",
1084 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001085 },
1086
1087 x86: {
1088 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001089 "arch-x86/generic/string/memcmp.S",
1090 "arch-x86/generic/string/strcmp.S",
1091 "arch-x86/generic/string/strncmp.S",
1092 "arch-x86/generic/string/strcat.S",
1093 "arch-x86/atom/string/sse2-memchr-atom.S",
1094 "arch-x86/atom/string/sse2-memrchr-atom.S",
1095 "arch-x86/atom/string/sse2-strchr-atom.S",
1096 "arch-x86/atom/string/sse2-strnlen-atom.S",
1097 "arch-x86/atom/string/sse2-strrchr-atom.S",
1098 "arch-x86/atom/string/sse2-wcschr-atom.S",
1099 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1100 "arch-x86/atom/string/sse2-wcslen-atom.S",
1101 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001102 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1103 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1104 "arch-x86/silvermont/string/sse2-memset-slm.S",
1105 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1106 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1107 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1108 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1109 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001110
1111 "arch-x86/bionic/__bionic_clone.S",
1112 "arch-x86/bionic/_exit_with_stack_teardown.S",
1113 "arch-x86/bionic/libgcc_compat.c",
1114 "arch-x86/bionic/__restore.S",
1115 "arch-x86/bionic/setjmp.S",
1116 "arch-x86/bionic/syscall.S",
1117 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001118 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001119
1120 exclude_srcs: [
1121 "bionic/strchr.cpp",
1122 "bionic/strnlen.c",
1123 "bionic/strrchr.cpp",
1124 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001125 atom: {
1126 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001127 "arch-x86/atom/string/sse2-memset-atom.S",
1128 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001129 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001130 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001131 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001132 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001133 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1134 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1135 ],
1136 exclude_srcs: [
1137 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001138 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1139 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1140 "arch-x86/silvermont/string/sse2-memset-slm.S",
1141 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1142 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1143 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1144 ],
1145 },
1146 ssse3: {
1147 srcs: [
1148 "arch-x86/atom/string/ssse3-strncat-atom.S",
1149 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1150 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1151 "arch-x86/atom/string/ssse3-strcat-atom.S",
1152 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1153 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1154 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1155 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1156 ],
1157 exclude_srcs: [
1158 "arch-x86/generic/string/strcmp.S",
1159 "arch-x86/generic/string/strncmp.S",
1160 "arch-x86/generic/string/strcat.S",
1161 ],
1162 },
1163 sse4: {
1164 srcs: [
1165 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1166 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1167 ],
1168 exclude_srcs: [
1169 "arch-x86/generic/string/memcmp.S",
1170 ],
1171 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001172 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001173 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001174 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001175 "arch-x86_64/string/sse2-memcpy-slm.S",
1176 "arch-x86_64/string/sse2-memmove-slm.S",
1177 "arch-x86_64/string/sse2-memset-slm.S",
1178 "arch-x86_64/string/sse2-stpcpy-slm.S",
1179 "arch-x86_64/string/sse2-stpncpy-slm.S",
1180 "arch-x86_64/string/sse2-strcat-slm.S",
1181 "arch-x86_64/string/sse2-strcpy-slm.S",
1182 "arch-x86_64/string/sse2-strlcat-slm.S",
1183 "arch-x86_64/string/sse2-strlcpy-slm.S",
1184 "arch-x86_64/string/sse2-strlen-slm.S",
1185 "arch-x86_64/string/sse2-strncat-slm.S",
1186 "arch-x86_64/string/sse2-strncpy-slm.S",
1187 "arch-x86_64/string/sse4-memcmp-slm.S",
1188 "arch-x86_64/string/ssse3-strcmp-slm.S",
1189 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001190
1191 "arch-x86_64/bionic/__bionic_clone.S",
1192 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1193 "arch-x86_64/bionic/__restore_rt.S",
1194 "arch-x86_64/bionic/setjmp.S",
1195 "arch-x86_64/bionic/syscall.S",
1196 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001197 ],
1198 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001199 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001200
Colin Cross50c21ab2015-10-31 23:03:05 -07001201 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001202 include_dirs: ["bionic/libstdc++/include"],
1203 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001204}
1205
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001206genrule {
1207 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001208 out: ["generated_android_ids.h"],
1209 srcs: [":android_filesystem_config_header"],
1210 tool_files: ["fs_config_generator.py"],
1211 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001212}
1213
Dan Willemsen268a6732015-10-15 14:49:45 -07001214// ========================================================
1215// libc_bionic_ndk.a- The portions of libc_bionic that can
1216// be safely used in libc_ndk.a (no troublesome global data
1217// or constructors).
1218// ========================================================
1219cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001220 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001221 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001222 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001223 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001224 "bionic/__cmsg_nxthdr.cpp",
1225 "bionic/__errno.cpp",
1226 "bionic/__gnu_basename.cpp",
1227 "bionic/__libc_current_sigrtmax.cpp",
1228 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001229 "bionic/abort.cpp",
1230 "bionic/accept.cpp",
1231 "bionic/accept4.cpp",
1232 "bionic/access.cpp",
1233 "bionic/arpa_inet.cpp",
1234 "bionic/assert.cpp",
1235 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001236 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001237 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001238 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001239 "bionic/bionic_systrace.cpp",
1240 "bionic/bionic_time_conversions.cpp",
1241 "bionic/brk.cpp",
1242 "bionic/c16rtomb.cpp",
1243 "bionic/c32rtomb.cpp",
1244 "bionic/chmod.cpp",
1245 "bionic/chown.cpp",
1246 "bionic/clearenv.cpp",
1247 "bionic/clock.cpp",
1248 "bionic/clock_getcpuclockid.cpp",
1249 "bionic/clock_nanosleep.cpp",
1250 "bionic/clone.cpp",
1251 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001252 "bionic/connect.cpp",
1253 "bionic/ctype.cpp",
1254 "bionic/dirent.cpp",
1255 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001256 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001257 "bionic/error.cpp",
1258 "bionic/eventfd_read.cpp",
1259 "bionic/eventfd_write.cpp",
Elliott Hughese19c6722016-08-26 16:15:57 +00001260 "bionic/exec.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001261 "bionic/faccessat.cpp",
1262 "bionic/fchmod.cpp",
1263 "bionic/fchmodat.cpp",
1264 "bionic/ffs.cpp",
1265 "bionic/fgetxattr.cpp",
1266 "bionic/flistxattr.cpp",
1267 "bionic/flockfile.cpp",
1268 "bionic/fpclassify.cpp",
1269 "bionic/fsetxattr.cpp",
1270 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001271 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001272 "bionic/futimens.cpp",
1273 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001274 "bionic/getdomainname.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001275 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001276 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001277 "bionic/getpgrp.cpp",
1278 "bionic/getpid.cpp",
Elliott Hughes8f0e42f2016-11-29 15:10:29 -08001279 "bionic/getpriority.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001280 "bionic/gettid.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001281 "bionic/grp_pwd.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -07001282 "bionic/iconv.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001283 "bionic/icu_wrappers.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001284 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001285 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001286 "bionic/ioctl.cpp",
Elliott Hughes7532b322017-07-11 15:00:17 -07001287 "bionic/killpg.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -08001288 "bionic/langinfo.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001289 "bionic/lchown.cpp",
1290 "bionic/lfs64_support.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001291 "bionic/libc_init_common.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001292 "bionic/libgen.cpp",
1293 "bionic/link.cpp",
1294 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001295 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001296 "bionic/lstat.cpp",
1297 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001298 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001299 "bionic/mbrtoc16.cpp",
1300 "bionic/mbrtoc32.cpp",
Elliott Hughescae33ad2016-08-15 14:14:40 -07001301 "bionic/memmem.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001302 "bionic/mempcpy.cpp",
1303 "bionic/mkdir.cpp",
1304 "bionic/mkfifo.cpp",
1305 "bionic/mknod.cpp",
1306 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001307 "bionic/mremap.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001308 "bionic/net_if.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001309 "bionic/netdb.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001310 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001311 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001312 "bionic/open.cpp",
1313 "bionic/pathconf.cpp",
1314 "bionic/pause.cpp",
1315 "bionic/pipe.cpp",
1316 "bionic/poll.cpp",
1317 "bionic/posix_fadvise.cpp",
1318 "bionic/posix_fallocate.cpp",
1319 "bionic/posix_madvise.cpp",
1320 "bionic/posix_timers.cpp",
1321 "bionic/ptrace.cpp",
1322 "bionic/pty.cpp",
1323 "bionic/raise.cpp",
1324 "bionic/rand.cpp",
1325 "bionic/readlink.cpp",
1326 "bionic/reboot.cpp",
1327 "bionic/recv.cpp",
1328 "bionic/rename.cpp",
1329 "bionic/rmdir.cpp",
1330 "bionic/scandir.cpp",
1331 "bionic/sched_getaffinity.cpp",
1332 "bionic/sched_getcpu.cpp",
1333 "bionic/semaphore.cpp",
1334 "bionic/send.cpp",
1335 "bionic/setegid.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001336 "bionic/seteuid.cpp",
1337 "bionic/setpgrp.cpp",
1338 "bionic/sigaction.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001339 "bionic/signal.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001340 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001341 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001342 "bionic/stat.cpp",
1343 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001344 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001345 "bionic/strchrnul.cpp",
1346 "bionic/strerror.cpp",
1347 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001348 "bionic/string_l.cpp",
1349 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001350 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001351 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001352 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001353 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001354 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001355 "bionic/sync_file_range.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -08001356 "bionic/sys_epoll.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001357 "bionic/sys_msg.cpp",
1358 "bionic/sys_sem.cpp",
1359 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001360 "bionic/sys_siglist.c",
Elliott Hughes6dafb4a2018-01-26 17:47:56 -08001361 "bionic/sys_signalfd.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001362 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001363 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001364 "bionic/sysinfo.cpp",
1365 "bionic/syslog.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001366 "bionic/system_property_api.cpp",
1367 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001368 "bionic/tdestroy.cpp",
1369 "bionic/termios.cpp",
1370 "bionic/thread_private.cpp",
1371 "bionic/tmpfile.cpp",
1372 "bionic/umount.cpp",
1373 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001374 "bionic/wait.cpp",
1375 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001376 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001377 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001378 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001379 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001380 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001381
1382 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1383 // which will be overridden by the actual one in libc.so.
1384 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001385 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001386
Dan Willemsen208ae172015-09-16 16:33:27 -07001387 multilib: {
1388 lib32: {
1389 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001390 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001391 },
1392 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001393 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001394 treble_linker_namespaces: {
1395 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001396 },
1397 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001398 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001399 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001400 local_include_dirs: ["stdio"],
1401 include_dirs: ["bionic/libstdc++/include"],
1402 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001403 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001404}
1405
Dan Willemsen208ae172015-09-16 16:33:27 -07001406// ========================================================
1407// libc_pthread.a - pthreads parts that previously lived in
1408// libc_bionic.a. Relocated to their own library because
1409// they can't be included in libc_ndk.a (as they layout of
1410// pthread_t has changed over the years and has ABI
1411// compatibility issues).
1412// ========================================================
1413
1414cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001415 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001416 srcs: [
1417 "bionic/pthread_atfork.cpp",
1418 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001419 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001420 "bionic/pthread_cond.cpp",
1421 "bionic/pthread_create.cpp",
1422 "bionic/pthread_detach.cpp",
1423 "bionic/pthread_equal.cpp",
1424 "bionic/pthread_exit.cpp",
1425 "bionic/pthread_getcpuclockid.cpp",
1426 "bionic/pthread_getschedparam.cpp",
1427 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001428 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001429 "bionic/pthread_join.cpp",
1430 "bionic/pthread_key.cpp",
1431 "bionic/pthread_kill.cpp",
1432 "bionic/pthread_mutex.cpp",
1433 "bionic/pthread_once.cpp",
1434 "bionic/pthread_rwlock.cpp",
1435 "bionic/pthread_self.cpp",
1436 "bionic/pthread_setname_np.cpp",
1437 "bionic/pthread_setschedparam.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001438 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001439
1440 // The following implementations depend on pthread data or implementation,
1441 // so we can't include them in libc_ndk.a.
1442 "bionic/__cxa_thread_atexit_impl.cpp",
1443 "stdlib/atexit.c",
1444 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001445 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001446
Colin Cross50c21ab2015-10-31 23:03:05 -07001447 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001448 include_dirs: ["bionic/libstdc++/include"],
1449 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001450}
1451
1452// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001453// libc_syscalls.a
1454// ========================================================
1455
1456cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001457 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001458 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001459 arch: {
1460 arm: {
1461 srcs: ["arch-arm/syscalls/**/*.S"],
1462 },
1463 arm64: {
1464 srcs: ["arch-arm64/syscalls/**/*.S"],
1465 },
1466 mips: {
1467 srcs: ["arch-mips/syscalls/**/*.S"],
1468 },
1469 mips64: {
1470 srcs: ["arch-mips64/syscalls/**/*.S"],
1471 },
1472 x86: {
1473 srcs: ["arch-x86/syscalls/**/*.S"],
1474 },
1475 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001476 srcs: ["arch-x86_64/syscalls/**/*.S"],
1477 },
1478 },
1479 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001480}
1481
1482// ========================================================
1483// libc_aeabi.a
1484// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1485// to avoid infinite recursion. For the other architectures we just build an
1486// empty library to keep this makefile simple.
1487// ========================================================
1488
1489cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001490 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001491 arch: {
1492 arm: {
1493 srcs: ["arch-arm/bionic/__aeabi.c"],
1494 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001495 },
1496 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001497 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001498}
1499
1500// ========================================================
1501// libc_ndk.a
1502// Compatibility library for the NDK. This library contains
1503// all the parts of libc that are safe to statically link.
1504// We can't safely statically link things that can only run
1505// on a certain version of the OS. Examples include
1506// anything that talks to netd (a large portion of the DNS
1507// code) and anything that is dependent on the layout of a
1508// data structure that has changed across releases (such as
1509// pthread_t).
1510// ========================================================
1511
1512cc_library_static {
1513 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001514 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001515 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001516 multilib: {
1517 lib32: {
1518 srcs: libc_common_src_files_32,
1519 },
1520 },
1521 arch: {
1522 arm: {
1523 srcs: [
1524 "arch-arm/bionic/exidx_dynamic.c",
1525 "arch-common/bionic/crtbegin_so.c",
1526 "arch-arm/bionic/atexit_legacy.c",
1527 "arch-common/bionic/crtend_so.S",
1528 ],
1529 whole_static_libs: ["libc_aeabi"],
1530 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001531 },
1532
Colin Cross50c21ab2015-10-31 23:03:05 -07001533 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001534 "-fvisibility=hidden",
1535 "-DLIBC_STATIC",
1536 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001537
1538 whole_static_libs: [
1539 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001540 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001541 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001542 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001543 "libc_gdtoa",
1544 "libc_malloc",
1545 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001546 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001547 "libc_openbsd_ndk",
1548 "libc_stack_protector",
1549 "libc_syscalls",
1550 "libc_tzcode",
1551 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001552 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001553 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001554 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001555}
1556
1557// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001558// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001559// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001560cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001561 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001562 srcs: libc_common_src_files,
1563 multilib: {
1564 lib32: {
1565 srcs: libc_common_src_files_32,
1566 },
1567 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001568 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001569
1570 whole_static_libs: [
1571 "libc_bionic",
1572 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001573 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001574 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001575 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001576 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001577 "libc_gdtoa",
1578 "libc_malloc",
1579 "libc_netbsd",
1580 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001581 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001582 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001583 "libc_stack_protector",
1584 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001585 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001586 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001587 ],
1588
1589 arch: {
1590 arm: {
1591 whole_static_libs: ["libc_aeabi"],
1592 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001593 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001594}
1595
1596// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001597// libc_common.a
1598// ========================================================
1599
1600cc_library_static {
1601 defaults: ["libc_defaults"],
1602 name: "libc_common",
1603
1604 whole_static_libs: [
1605 "libc_nopthread",
1606 "libc_pthread",
1607 ],
1608}
1609
1610// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001611// libc_nomalloc.a
1612// ========================================================
1613//
1614// This is a version of the static C library that does not
1615// include malloc. It's useful in situations when the user wants
1616// to provide their own malloc implementation, or wants to
1617// explicitly disallow the use of malloc, such as in the
1618// dynamic linker.
1619
1620cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001621 name: "libc_nomalloc",
1622
Colin Cross50c21ab2015-10-31 23:03:05 -07001623 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001624
1625 arch: {
1626 arm: {
1627 srcs: ["arch-arm/bionic/exidx_static.c"],
1628 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001629 },
1630
Colin Cross50c21ab2015-10-31 23:03:05 -07001631 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001632
Colin Crossa3f9fca2016-01-11 13:20:55 -08001633 whole_static_libs: [
1634 "libc_common",
1635 "libc_init_static",
1636 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001637}
1638
1639// ========================================================
1640// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1641// ========================================================
1642cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001643 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001644 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001645 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001646
Dan Willemsen208ae172015-09-16 16:33:27 -07001647 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001648}
1649
1650// ========================================================
1651// libc.a + libc.so
1652// ========================================================
1653cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001654 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001655 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001656 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001657 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001658 platform_sdk_version: {
1659 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1660 },
1661 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001662 static: {
1663 srcs: [
1664 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001665 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001666 ],
1667 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001668 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001669 },
1670 shared: {
1671 srcs: [
1672 "arch-common/bionic/crtbegin_so.c",
1673 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001674 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001675 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001676 "bionic/NetdClient.cpp",
1677 "arch-common/bionic/crtend_so.S",
1678 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001679 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001680 },
1681
1682 required: ["tzdata"],
1683
1684 // Leave the symbols in the shared library so that stack unwinders can produce
1685 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001686 strip: {
1687 keep_symbols: true,
1688 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001689
Colin Cross4ce94d22016-11-15 13:15:43 -08001690 // Do not pack libc.so relocations; see http://b/20645321 for details.
1691 pack_relocations: false,
1692
dimitry06016f22018-01-05 11:39:28 +01001693 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1694 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1695 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1696 // those new libraries from libgcc.a are not declared external; if that were the case,
1697 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1698 // on the external symbols from the dependent libraries. That would create a "cloaked"
1699 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001700
dimitry06016f22018-01-05 11:39:28 +01001701 shared_libs: [
1702 "ld-android",
1703 "libdl",
1704 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001705 whole_static_libs: [
1706 "libc_common",
1707 "libjemalloc",
1708 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001709
1710 nocrt: true,
1711
Dan Willemsen208ae172015-09-16 16:33:27 -07001712 arch: {
1713 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001714 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1715 ldflags: ["-Wl,--hash-style=both"],
1716
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001717 // Don't re-export new/delete and friends, even if the compiler really wants to.
1718 version_script: "libc.arm.map",
1719
Dan Willemsen208ae172015-09-16 16:33:27 -07001720 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001721 srcs: [
1722 "arch-arm/bionic/exidx_dynamic.c",
1723
1724 // special for arm
1725 "arch-arm/bionic/atexit_legacy.c",
1726 ],
1727 // special for arm
1728 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001729 },
1730 static: {
1731 srcs: ["arch-arm/bionic/exidx_static.c"],
1732 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001733 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001734 arm64: {
1735 // Don't re-export new/delete and friends, even if the compiler really wants to.
1736 version_script: "libc.arm64.map",
1737 },
1738 mips: {
1739 // Don't re-export new/delete and friends, even if the compiler really wants to.
1740 version_script: "libc.mips.map",
1741 },
1742 mips64: {
1743 // Don't re-export new/delete and friends, even if the compiler really wants to.
1744 version_script: "libc.mips64.map",
1745 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001746 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001747 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1748 ldflags: ["-Wl,--hash-style=both"],
1749
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001750 // Don't re-export new/delete and friends, even if the compiler really wants to.
1751 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001752 },
1753 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001754 // Don't re-export new/delete and friends, even if the compiler really wants to.
1755 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001756 },
1757 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001758}
1759
Dan Willemsen208ae172015-09-16 16:33:27 -07001760// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001761// libstdc++.so + libstdc++.a
1762// ========================================================
1763cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001764 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001765 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001766 srcs: [
1767 "bionic/__cxa_guard.cpp",
1768 "bionic/__cxa_pure_virtual.cpp",
1769 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001770 ],
1771 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001772 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001773 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001774 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001775
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001776 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001777 arch: {
1778 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001779 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001780 version_script: "libstdc++.arm.map",
1781 },
1782 arm64: {
1783 version_script: "libstdc++.arm64.map",
1784 },
1785 mips: {
1786 version_script: "libstdc++.mips.map",
1787 },
1788 mips64: {
1789 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001790 },
1791 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001792 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001793 version_script: "libstdc++.x86.map",
1794 },
1795 x86_64: {
1796 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001797 },
1798 },
1799}
1800
Colin Cross50c21ab2015-10-31 23:03:05 -07001801cc_defaults {
1802 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001803 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001804 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001805
Elliott Hughesd50a1de2018-02-05 17:30:57 -08001806 cflags: [
1807 "-Wno-gcc-compat",
1808 "-Wall",
1809 "-Werror",
1810 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001811}
1812
Colin Cross50c21ab2015-10-31 23:03:05 -07001813cc_defaults {
1814 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001815 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001816
1817 arch: {
1818 mips: {
1819 cflags: ["-fPIC"],
1820 },
1821 mips64: {
1822 cflags: ["-fPIC"],
1823 },
1824 x86: {
1825 cflags: ["-fPIC"],
1826 },
1827 x86_64: {
1828 cflags: ["-fPIC"],
1829 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001830 },
1831}
1832
Dan Willemsena3ed9012017-04-04 15:51:26 -07001833// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001834cc_object {
1835 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001836 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001837 local_include_dirs: ["include"],
1838 product_variables: {
1839 platform_sdk_version: {
1840 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1841 },
1842 },
1843 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001844
Colin Cross7d7b3682017-11-03 13:38:40 -07001845 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001846}
1847
Dan Willemsen208ae172015-09-16 16:33:27 -07001848cc_object {
1849 name: "crtbegin_so1",
1850 local_include_dirs: ["include"],
1851 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001852
Colin Cross7d7b3682017-11-03 13:38:40 -07001853 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001854}
1855
Dan Willemsen208ae172015-09-16 16:33:27 -07001856cc_object {
1857 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001858
Colin Cross7d7b3682017-11-03 13:38:40 -07001859 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001860 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001861 "crtbegin_so1",
1862 "crtbrand",
1863 ],
1864}
1865
Dan Willemsen208ae172015-09-16 16:33:27 -07001866cc_object {
1867 name: "crtend_so",
1868 local_include_dirs: ["include"],
1869 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001870
Colin Cross7d7b3682017-11-03 13:38:40 -07001871 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001872}
1873
Dan Willemsen208ae172015-09-16 16:33:27 -07001874cc_object {
1875 name: "crtbegin_static1",
1876 local_include_dirs: ["include"],
1877 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001878
Colin Cross50c21ab2015-10-31 23:03:05 -07001879 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001880 mips: {
1881 srcs: [
1882 "arch-mips/bionic/crtbegin.c",
1883 ],
1884 exclude_srcs: [
1885 "arch-common/bionic/crtbegin.c",
1886 ],
1887 },
1888 mips64: {
1889 srcs: [
1890 "arch-mips64/bionic/crtbegin.c",
1891 ],
1892 exclude_srcs: [
1893 "arch-common/bionic/crtbegin.c",
1894 ],
1895 },
1896 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001897
1898 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001899}
1900
Dan Willemsen208ae172015-09-16 16:33:27 -07001901cc_object {
1902 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001903
Colin Cross77d57bf2016-04-11 14:34:18 -07001904 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001905 "crtbegin_static1",
1906 "crtbrand",
1907 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001908 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001909}
1910
Dan Willemsen208ae172015-09-16 16:33:27 -07001911cc_object {
1912 name: "crtbegin_dynamic1",
1913 local_include_dirs: ["include"],
1914 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001915
Colin Cross50c21ab2015-10-31 23:03:05 -07001916 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001917 mips: {
1918 srcs: [
1919 "arch-mips/bionic/crtbegin.c",
1920 ],
1921 exclude_srcs: [
1922 "arch-common/bionic/crtbegin.c",
1923 ],
1924 },
1925 mips64: {
1926 srcs: [
1927 "arch-mips64/bionic/crtbegin.c",
1928 ],
1929 exclude_srcs: [
1930 "arch-common/bionic/crtbegin.c",
1931 ],
1932 },
1933 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001934 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001935}
1936
Dan Willemsen208ae172015-09-16 16:33:27 -07001937cc_object {
1938 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001939
Colin Cross77d57bf2016-04-11 14:34:18 -07001940 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001941 "crtbegin_dynamic1",
1942 "crtbrand",
1943 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001944 target: {
1945 linux_bionic: {
1946 generated_sources: ["host_bionic_linker_asm"],
1947 objs: [
1948 "linker_wrapper",
1949 ],
1950 },
1951 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001952 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001953}
1954
Dan Willemsen208ae172015-09-16 16:33:27 -07001955cc_object {
1956 // We rename crtend.o to crtend_android.o to avoid a
1957 // name clash between gcc and bionic.
1958 name: "crtend_android",
1959 local_include_dirs: ["include"],
1960 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001961
Colin Cross50c21ab2015-10-31 23:03:05 -07001962 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001963}
Colin Crossbaa48992016-07-13 11:15:21 -07001964
Dan Albert22805ea2017-03-22 15:28:05 -07001965preprocessed_ndk_headers {
1966 name: "common_libc",
1967 from: "include",
1968 to: "",
1969 license: "NOTICE",
1970}
Dan Albert4238a352016-06-28 11:18:05 -07001971
1972ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08001973 name: "libc_uapi",
1974 from: "kernel/uapi",
1975 to: "",
1976 srcs: [
1977 "kernel/uapi/asm-generic/**/*.h",
1978 "kernel/uapi/drm/**/*.h",
1979 "kernel/uapi/linux/**/*.h",
1980 "kernel/uapi/misc/**/*.h",
1981 "kernel/uapi/mtd/**/*.h",
1982 "kernel/uapi/rdma/**/*.h",
1983 "kernel/uapi/scsi/**/*.h",
1984 "kernel/uapi/sound/**/*.h",
1985 "kernel/uapi/video/**/*.h",
1986 "kernel/uapi/xen/**/*.h",
1987 ],
Dan Albert92592652016-10-20 01:42:54 -07001988 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07001989}
1990
1991ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07001992 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07001993 from: "kernel/android/uapi/linux",
1994 to: "linux",
1995 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07001996 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07001997}
1998
1999ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002000 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002001 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002002 to: "scsi",
2003 srcs: ["kernel/android/scsi/**/*.h"],
2004 license: "NOTICE",
2005}
2006
2007ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002008 name: "libc_asm_arm",
2009 from: "kernel/uapi/asm-arm",
2010 to: "arm-linux-androideabi",
2011 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002012 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002013}
2014
2015ndk_headers {
2016 name: "libc_asm_arm64",
2017 from: "kernel/uapi/asm-arm64",
2018 to: "aarch64-linux-android",
2019 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002020 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002021}
2022
Elliott Hughesee291c02017-12-11 11:32:34 -08002023// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002024ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002025 name: "libc_asm_mips",
2026 from: "kernel/uapi/asm-mips",
2027 to: "mipsel-linux-android",
2028 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2029 license: "NOTICE",
2030}
2031
Elliott Hughesee291c02017-12-11 11:32:34 -08002032// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002033ndk_headers {
2034 name: "libc_asm_mips64",
2035 from: "kernel/uapi/asm-mips",
2036 to: "mips64el-linux-android",
2037 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2038 license: "NOTICE",
2039}
2040
2041ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002042 name: "libc_asm_x86",
2043 from: "kernel/uapi/asm-x86",
2044 to: "i686-linux-android",
2045 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002046 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002047}
2048
2049ndk_headers {
2050 name: "libc_asm_x86_64",
2051 from: "kernel/uapi/asm-x86",
2052 to: "x86_64-linux-android",
2053 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002054 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002055}
2056
Dan Albert4238a352016-06-28 11:18:05 -07002057ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002058 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002059 symbol_file: "libc.map.txt",
2060 first_version: "9",
2061}
2062
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002063llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002064 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002065 symbol_file: "libc.map.txt",
2066 export_headers_as_system: true,
2067 export_preprocessed_headers: ["include"],
2068 arch: {
2069 arm: {
2070 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002071 "kernel/uapi",
2072 "kernel/uapi/asm-arm",
2073 "kernel/android/uapi",
2074 ],
2075 },
2076 arm64: {
2077 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002078 "kernel/uapi",
2079 "kernel/uapi/asm-arm64",
2080 "kernel/android/uapi",
2081 ],
2082 },
2083 mips: {
2084 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002085 "kernel/uapi",
2086 "kernel/uapi/asm-mips",
2087 "kernel/android/uapi",
2088 ],
2089 },
2090 mips64: {
2091 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002092 "kernel/uapi",
2093 "kernel/uapi/asm-mips",
2094 "kernel/android/uapi",
2095 ],
2096 },
2097 x86: {
2098 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002099 "kernel/uapi",
2100 "kernel/uapi/asm-x86",
2101 "kernel/android/uapi",
2102 ],
2103 },
2104 x86_64: {
2105 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002106 "kernel/uapi",
2107 "kernel/uapi/asm-x86",
2108 "kernel/android/uapi",
2109 ],
2110 },
2111 },
2112}
2113
Dan Albertdf31aff2016-10-06 15:50:41 -07002114ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002115 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002116 symbol_file: "libstdc++.map.txt",
2117 first_version: "9",
2118}
2119
Dan Willemsenca056d72018-01-08 14:00:24 -08002120// Export these headers for toolbox to process
2121filegroup {
2122 name: "kernel_input_headers",
2123 srcs: [
2124 "kernel/uapi/linux/input.h",
2125 "kernel/uapi/linux/input-event-codes.h",
2126 ],
2127}