blob: a8c518d7c0fd9f011f1af8b183c9a1a7e551fc68 [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",
13 "bionic/sigblock.c",
14 "bionic/siginterrupt.c",
15 "bionic/sigsetmask.c",
Elliott Hughes3a4c4542017-07-19 17:20:24 -070016 "stdio/fmemopen.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070017 "stdio/parsefloat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070018 "stdio/refill.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080019 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdio/stdio_ext.cpp",
Elliott Hughes38e4aef2018-01-18 10:21:29 -080021 "stdio/vfscanf.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -070022 "stdio/vfwscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070023 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070024]
25
26// Various kinds of cruft.
27// ========================================================
28libc_common_src_files += [
29 "bionic/ndk_cruft.cpp",
30]
31
32libc_common_src_files_32 = [
33 "bionic/legacy_32_bit_support.cpp",
34 "bionic/time64.c",
35]
36
Elliott Hughes53cf3482016-08-09 13:06:41 -070037libc_common_flags = [
38 "-D_LIBC=1",
39 "-Wall",
40 "-Wextra",
41 "-Wunused",
Elliott Hughes3048a362018-01-19 17:58:07 -080042 "-Wno-char-subscripts",
Elliott Hughes53cf3482016-08-09 13:06:41 -070043 "-Wno-deprecated-declarations",
Elliott Hughesb348d5c2017-07-24 16:53:11 -070044 "-Wno-gcc-compat",
Elliott Hughes8e547bd2016-08-16 15:57:47 -070045 "-Wframe-larger-than=2048",
Elliott Hughes53cf3482016-08-09 13:06:41 -070046
47 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
48 "-Werror=pointer-to-int-cast",
49 "-Werror=int-to-pointer-cast",
50 "-Werror=type-limits",
51 "-Werror",
52]
53
Dan Willemsen208ae172015-09-16 16:33:27 -070054// Define some common cflags
55// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070056cc_defaults {
57 name: "libc_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -080058 defaults: ["linux_bionic_supported"],
Elliott Hughes53cf3482016-08-09 13:06:41 -070059 cflags: libc_common_flags,
60 asflags: libc_common_flags,
Colin Cross50c21ab2015-10-31 23:03:05 -070061 conlyflags: ["-std=gnu99"],
62 cppflags: [],
Christopher Ferris7a3681e2017-04-24 17:48:32 -070063 include_dirs: [
64 "bionic/libc/async_safe/include",
65 "external/jemalloc/include",
66 ],
Colin Cross50c21ab2015-10-31 23:03:05 -070067
Colin Cross50c21ab2015-10-31 23:03:05 -070068 stl: "none",
69 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070070 sanitize: {
71 never: true,
72 },
Colin Cross50c21ab2015-10-31 23:03:05 -070073 native_coverage: false,
Dan Willemsen208ae172015-09-16 16:33:27 -070074}
75
Dan Willemsen208ae172015-09-16 16:33:27 -070076// ANDROIDMK TRANSLATION ERROR: unsupported directive
77// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
78//libc_common_cflags += ["-DDEBUG"]
79// ANDROIDMK TRANSLATION ERROR: unsupported directive
80// endif
81
Dan Willemsen208ae172015-09-16 16:33:27 -070082// ========================================================
83// libc_stack_protector.a - stack protector code
84// ========================================================
85//
Colin Crossa3f9fca2016-01-11 13:20:55 -080086// Code that implements the stack protector (or that runs
87// before TLS has been set up) needs to be compiled with
88// -fno-stack-protector, since it accesses the stack canary
89// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070090
91cc_library_static {
92
Colin Crossa3f9fca2016-01-11 13:20:55 -080093 srcs: [
94 "bionic/__libc_init_main_thread.cpp",
95 "bionic/__stack_chk_fail.cpp",
96 ],
97 arch: {
98 arm64: {
99 srcs: ["arch-arm64/bionic/__set_tls.c"],
100 },
101 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800102 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800103 },
104 x86_64: {
105 srcs: ["arch-x86_64/bionic/__set_tls.c"],
106 },
107 },
108
Colin Cross50c21ab2015-10-31 23:03:05 -0700109 defaults: ["libc_defaults"],
110 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700111 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700112}
113
Colin Crossa3f9fca2016-01-11 13:20:55 -0800114// libc_init_static.cpp also needs to be built without stack protector,
115// because it's responsible for setting up TLS for static executables.
116// This isn't the case for dynamic executables because the dynamic linker
117// has already set up the main thread's TLS.
118
119cc_library_static {
120 name: "libc_init_static",
121 defaults: ["libc_defaults"],
122 srcs: ["bionic/libc_init_static.cpp"],
123 cflags: ["-fno-stack-protector"],
124}
125
Stephen Cranef4b1cbd2017-05-09 14:27:43 -0700126cc_library_static {
127 name: "libc_init_dynamic",
128 defaults: ["libc_defaults"],
129 srcs: ["bionic/libc_init_dynamic.cpp"],
130 cflags: ["-fno-stack-protector"],
131}
Colin Crossa3f9fca2016-01-11 13:20:55 -0800132
Dan Willemsen208ae172015-09-16 16:33:27 -0700133// ========================================================
134// libc_tzcode.a - upstream 'tzcode' code
135// ========================================================
136
137cc_library_static {
138
Colin Cross50c21ab2015-10-31 23:03:05 -0700139 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700140 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800141 "tzcode/**/*.c",
Elliott Hughes0e8616a2017-04-11 14:44:51 -0700142 "tzcode/bionic.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700143 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
144 ],
145
Colin Cross50c21ab2015-10-31 23:03:05 -0700146 cflags: [
Dan Willemsen268a6732015-10-15 14:49:45 -0700147 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700148 // Don't use ridiculous amounts of stack.
149 "-DALL_STATE",
150 // Include tzsetwall, timelocal, timegm, time2posix, and posix2time.
151 "-DSTD_INSPIRED",
Colin Crossa35d23d2015-11-19 13:32:49 -0800152 // Obviously, we want to be thread-safe.
Dan Willemsen268a6732015-10-15 14:49:45 -0700153 "-DTHREAD_SAFE",
Dan Willemsen208ae172015-09-16 16:33:27 -0700154 // The name of the tm_gmtoff field in our struct tm.
155 "-DTM_GMTOFF=tm_gmtoff",
156 // Where we store our tzdata.
Colin Cross7b294952016-09-29 14:08:13 -0700157 "-DTZDIR=\"/system/usr/share/zoneinfo\"",
Elliott Hughes0a610d02016-07-29 14:04:17 -0700158 // Include `tzname`, `timezone`, and `daylight` globals.
159 "-DHAVE_POSIX_DECLS=0",
Dan Willemsen208ae172015-09-16 16:33:27 -0700160 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800161 // Use the empty string (instead of " ") as the timezone abbreviation
162 // fallback.
Colin Cross7b294952016-09-29 14:08:13 -0700163 "-DWILDABBR=\"\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700164 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
165 "-Dlint",
166 ],
167
Dan Willemsen208ae172015-09-16 16:33:27 -0700168 local_include_dirs: ["tzcode/"],
169 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700170}
171
172// ========================================================
173// libc_dns.a - modified NetBSD DNS code
174// ========================================================
175
176cc_library_static {
177
Colin Cross50c21ab2015-10-31 23:03:05 -0700178 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700179 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800180 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700181
182 "upstream-netbsd/lib/libc/isc/ev_streams.c",
183 "upstream-netbsd/lib/libc/isc/ev_timers.c",
184 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700185 ],
186
Colin Cross50c21ab2015-10-31 23:03:05 -0700187 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700188 "-DANDROID_CHANGES",
189 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700190 "-Wno-unused-parameter",
191 "-include netbsd-compat.h",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700192 "-Wframe-larger-than=66000",
Dan Willemsen208ae172015-09-16 16:33:27 -0700193 ],
194
Dan Willemsen208ae172015-09-16 16:33:27 -0700195 local_include_dirs: [
196 "dns/include",
197 "private",
198 "upstream-netbsd/lib/libc/include",
199 "upstream-netbsd/android/include",
200 ],
201
202 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700203}
204
205// ========================================================
206// libc_freebsd.a - upstream FreeBSD C library code
207// ========================================================
208//
209// These files are built with the freebsd-compat.h header file
210// automatically included.
211
212cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700213 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700214 srcs: [
215 "upstream-freebsd/lib/libc/gen/ldexp.c",
216 "upstream-freebsd/lib/libc/gen/sleep.c",
217 "upstream-freebsd/lib/libc/gen/usleep.c",
218 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700219 "upstream-freebsd/lib/libc/stdlib/hcreate.c",
220 "upstream-freebsd/lib/libc/stdlib/hcreate_r.c",
221 "upstream-freebsd/lib/libc/stdlib/hdestroy_r.c",
222 "upstream-freebsd/lib/libc/stdlib/hsearch_r.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700223 "upstream-freebsd/lib/libc/stdlib/qsort.c",
224 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700225 "upstream-freebsd/lib/libc/string/wcpcpy.c",
226 "upstream-freebsd/lib/libc/string/wcpncpy.c",
227 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700228 "upstream-freebsd/lib/libc/string/wcscat.c",
229 "upstream-freebsd/lib/libc/string/wcschr.c",
230 "upstream-freebsd/lib/libc/string/wcscmp.c",
231 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700232 "upstream-freebsd/lib/libc/string/wcscspn.c",
233 "upstream-freebsd/lib/libc/string/wcsdup.c",
234 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700235 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700236 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
237 "upstream-freebsd/lib/libc/string/wcsncat.c",
238 "upstream-freebsd/lib/libc/string/wcsncmp.c",
239 "upstream-freebsd/lib/libc/string/wcsncpy.c",
240 "upstream-freebsd/lib/libc/string/wcsnlen.c",
241 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700242 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700243 "upstream-freebsd/lib/libc/string/wcsspn.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700244 "upstream-freebsd/lib/libc/string/wcsstr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700245 "upstream-freebsd/lib/libc/string/wcstok.c",
246 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700247 "upstream-freebsd/lib/libc/string/wmemcmp.c",
Elliott Hughes20f33992017-07-13 09:45:00 -0700248 "upstream-freebsd/lib/libc/string/wmemcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700249 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800250 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700251 ],
252 arch: {
253 arm64: {
254 exclude_srcs: [
255 "upstream-freebsd/lib/libc/string/wmemmove.c",
256 ],
257 },
258 x86: {
259 exclude_srcs: [
260 "upstream-freebsd/lib/libc/string/wcschr.c",
261 "upstream-freebsd/lib/libc/string/wcscmp.c",
262 "upstream-freebsd/lib/libc/string/wcslen.c",
263 "upstream-freebsd/lib/libc/string/wcsrchr.c",
264 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800265 atom: {
266 exclude_srcs: [
267 "upstream-freebsd/lib/libc/string/wmemcmp.c",
268 ],
269 },
270 ssse3: {
271 exclude_srcs: [
272 "upstream-freebsd/lib/libc/string/wcscat.c",
273 "upstream-freebsd/lib/libc/string/wcscpy.c",
274 ],
275 },
276 sse4: {
277 exclude_srcs: [
278 "upstream-freebsd/lib/libc/string/wmemcmp.c",
279 ],
280 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700281 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700282 },
283
Colin Cross50c21ab2015-10-31 23:03:05 -0700284 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700285 "-Wno-sign-compare",
286 "-Wno-uninitialized",
Elliott Hughes5702c6f2017-08-31 17:27:05 -0700287 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700288 "-include freebsd-compat.h",
289 ],
290
Dan Willemsen208ae172015-09-16 16:33:27 -0700291 local_include_dirs: [
292 "upstream-freebsd/android/include",
293 ],
294
295 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700296}
297
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700298cc_library_static {
299 defaults: ["libc_defaults"],
300 srcs: [
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700301 "upstream-freebsd/lib/libc/gen/glob.c",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700302 "upstream-freebsd/lib/libc/stdlib/realpath.c",
303 ],
304
305 cflags: [
306 "-Wno-sign-compare",
307 "-include freebsd-compat.h",
Elliott Hughesf1c568d2017-09-26 17:09:07 -0700308 "-Wframe-larger-than=66000",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700309 ],
310
311 local_include_dirs: [
312 "upstream-freebsd/android/include",
313 ],
314
315 name: "libc_freebsd_large_stack",
316}
317
Dan Willemsen208ae172015-09-16 16:33:27 -0700318// ========================================================
319// libc_netbsd.a - upstream NetBSD C library code
320// ========================================================
321//
322// These files are built with the netbsd-compat.h header file
323// automatically included.
324
325cc_library_static {
326
Colin Cross50c21ab2015-10-31 23:03:05 -0700327 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700328 srcs: [
329 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700330 "upstream-netbsd/lib/libc/gen/nice.c",
331 "upstream-netbsd/lib/libc/gen/popen.c",
332 "upstream-netbsd/lib/libc/gen/psignal.c",
333 "upstream-netbsd/lib/libc/gen/utime.c",
334 "upstream-netbsd/lib/libc/gen/utmp.c",
335 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
336 "upstream-netbsd/lib/libc/regex/regcomp.c",
337 "upstream-netbsd/lib/libc/regex/regerror.c",
338 "upstream-netbsd/lib/libc/regex/regexec.c",
339 "upstream-netbsd/lib/libc/regex/regfree.c",
340 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
341 "upstream-netbsd/lib/libc/stdlib/div.c",
342 "upstream-netbsd/lib/libc/stdlib/drand48.c",
343 "upstream-netbsd/lib/libc/stdlib/erand48.c",
344 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
345 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
346 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
347 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
348 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
349 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
350 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
351 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
352 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
353 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
354 "upstream-netbsd/lib/libc/stdlib/seed48.c",
355 "upstream-netbsd/lib/libc/stdlib/srand48.c",
356 "upstream-netbsd/lib/libc/string/memccpy.c",
357 "upstream-netbsd/lib/libc/string/strcasestr.c",
358 "upstream-netbsd/lib/libc/string/strcoll.c",
359 "upstream-netbsd/lib/libc/string/strxfrm.c",
360 ],
361 multilib: {
362 lib32: {
363 // LP32 cruft
364 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
365 },
366 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700367 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700368 "-Wno-sign-compare",
369 "-Wno-uninitialized",
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/system.c",
483 "upstream-openbsd/lib/libc/stdlib/tfind.c",
484 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
485 "upstream-openbsd/lib/libc/string/strcasecmp.c",
486 "upstream-openbsd/lib/libc/string/strcspn.c",
487 "upstream-openbsd/lib/libc/string/strdup.c",
488 "upstream-openbsd/lib/libc/string/strndup.c",
489 "upstream-openbsd/lib/libc/string/strpbrk.c",
490 "upstream-openbsd/lib/libc/string/strsep.c",
491 "upstream-openbsd/lib/libc/string/strspn.c",
492 "upstream-openbsd/lib/libc/string/strstr.c",
493 "upstream-openbsd/lib/libc/string/strtok.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700494 "upstream-openbsd/lib/libc/string/wcslcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700495 "upstream-openbsd/lib/libc/string/wcswidth.c",
496 ],
497
Colin Cross50c21ab2015-10-31 23:03:05 -0700498 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700499 "-Wno-sign-compare",
500 "-Wno-uninitialized",
501 "-Wno-unused-parameter",
502 "-include openbsd-compat.h",
503 ],
504
Dan Willemsen208ae172015-09-16 16:33:27 -0700505 local_include_dirs: [
506 "private",
507 "stdio",
508 "upstream-openbsd/android/include",
509 "upstream-openbsd/lib/libc/include",
510 "upstream-openbsd/lib/libc/gdtoa/",
511 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700512}
513
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700514cc_library_static {
515 name: "libc_openbsd_large_stack",
516 defaults: ["libc_defaults"],
517 srcs: [
Elliott Hughes2f9c8ce2017-11-01 13:54:47 -0700518 "stdio/vfprintf.cpp",
519 "stdio/vfwprintf.cpp",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700520 ],
521 cflags: [
522 "-include openbsd-compat.h",
523 "-Wno-sign-compare",
524 "-Wframe-larger-than=5000",
525 ],
526
527 local_include_dirs: [
Elliott Hughes3a589c22017-10-30 11:43:58 -0700528 "upstream-openbsd/android/include/",
529 "upstream-openbsd/lib/libc/include/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700530 "upstream-openbsd/lib/libc/gdtoa/",
Elliott Hughes3a589c22017-10-30 11:43:58 -0700531 "upstream-openbsd/lib/libc/stdio/",
Elliott Hughes8e547bd2016-08-16 15:57:47 -0700532 ],
533}
534
Dan Willemsen208ae172015-09-16 16:33:27 -0700535// ========================================================
536// libc_openbsd.a - upstream OpenBSD C library code
537// ========================================================
538//
539// These files are built with the openbsd-compat.h header file
540// automatically included.
541cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700542 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700543 srcs: [
Dan Willemsen35e91a12015-09-17 15:28:45 -0700544 // These two depend on getentropy_linux.c, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700545 "upstream-openbsd/lib/libc/crypt/arc4random.c",
546 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
547
548 // May be overriden by per-arch optimized versions
549 "upstream-openbsd/lib/libc/string/memchr.c",
550 "upstream-openbsd/lib/libc/string/memmove.c",
551 "upstream-openbsd/lib/libc/string/memrchr.c",
552 "upstream-openbsd/lib/libc/string/stpcpy.c",
553 "upstream-openbsd/lib/libc/string/stpncpy.c",
554 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700555 "upstream-openbsd/lib/libc/string/strcpy.c",
556 "upstream-openbsd/lib/libc/string/strlcat.c",
557 "upstream-openbsd/lib/libc/string/strlcpy.c",
558 "upstream-openbsd/lib/libc/string/strncat.c",
559 "upstream-openbsd/lib/libc/string/strncmp.c",
560 "upstream-openbsd/lib/libc/string/strncpy.c",
561 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700562
563 arch: {
564 arm: {
565 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700566 "upstream-openbsd/lib/libc/string/strcpy.c",
567 ],
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800568 neon: {
Christopher Ferris950a9582017-03-29 13:10:56 -0700569 exclude_srcs: [
570 "upstream-openbsd/lib/libc/string/memmove.c",
571 "upstream-openbsd/lib/libc/string/stpcpy.c",
572 "upstream-openbsd/lib/libc/string/strcat.c",
573 ],
574 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700575 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700576 arm64: {
577 exclude_srcs: [
578 "upstream-openbsd/lib/libc/string/memchr.c",
579 "upstream-openbsd/lib/libc/string/memmove.c",
580 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700581 "upstream-openbsd/lib/libc/string/strcpy.c",
582 "upstream-openbsd/lib/libc/string/strncmp.c",
583 ],
584 },
Prashant Patilfcb877a2017-03-16 18:07:00 +0530585 mips: {
586 exclude_srcs: [
587 "upstream-openbsd/lib/libc/string/memchr.c",
588 "upstream-openbsd/lib/libc/string/memmove.c",
589 "upstream-openbsd/lib/libc/string/strcpy.c",
590 "upstream-openbsd/lib/libc/string/strncmp.c",
591 ],
592 },
593 mips64: {
594 exclude_srcs: [
595 "upstream-openbsd/lib/libc/string/memchr.c",
596 "upstream-openbsd/lib/libc/string/memmove.c",
597 "upstream-openbsd/lib/libc/string/strcpy.c",
598 "upstream-openbsd/lib/libc/string/strncmp.c",
599 ],
600 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700601 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800602 exclude_srcs: [
603 "upstream-openbsd/lib/libc/string/memchr.c",
604 "upstream-openbsd/lib/libc/string/memmove.c",
605 "upstream-openbsd/lib/libc/string/memrchr.c",
606 "upstream-openbsd/lib/libc/string/stpcpy.c",
607 "upstream-openbsd/lib/libc/string/stpncpy.c",
608 "upstream-openbsd/lib/libc/string/strcat.c",
609 "upstream-openbsd/lib/libc/string/strcpy.c",
610 "upstream-openbsd/lib/libc/string/strncmp.c",
611 "upstream-openbsd/lib/libc/string/strncpy.c",
612 ],
613 ssse3: {
614 exclude_srcs: [
615 "upstream-openbsd/lib/libc/string/strlcat.c",
616 "upstream-openbsd/lib/libc/string/strlcpy.c",
617 "upstream-openbsd/lib/libc/string/strncat.c",
618 ],
619 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700620 },
621
622 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800623 exclude_srcs: [
624 "upstream-openbsd/lib/libc/string/memmove.c",
625 "upstream-openbsd/lib/libc/string/stpcpy.c",
626 "upstream-openbsd/lib/libc/string/stpncpy.c",
627 "upstream-openbsd/lib/libc/string/strcat.c",
628 "upstream-openbsd/lib/libc/string/strcpy.c",
629 "upstream-openbsd/lib/libc/string/strlcat.c",
630 "upstream-openbsd/lib/libc/string/strlcpy.c",
631 "upstream-openbsd/lib/libc/string/strncat.c",
632 "upstream-openbsd/lib/libc/string/strncmp.c",
633 "upstream-openbsd/lib/libc/string/strncpy.c",
634 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700635 },
636 },
637
Colin Cross50c21ab2015-10-31 23:03:05 -0700638 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700639 "-Wno-sign-compare",
640 "-Wno-uninitialized",
641 "-Wno-unused-parameter",
642 "-include openbsd-compat.h",
643 ],
644
Dan Willemsen208ae172015-09-16 16:33:27 -0700645 local_include_dirs: [
646 "private",
Dan Willemsen208ae172015-09-16 16:33:27 -0700647 "upstream-openbsd/android/include",
Dan Willemsen208ae172015-09-16 16:33:27 -0700648 ],
649
650 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700651}
652
653// ========================================================
654// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
655// ========================================================
656//
657// These files are built with the openbsd-compat.h header file
658// automatically included.
659
660cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700661 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700662 srcs: [
663 "upstream-openbsd/android/gdtoa_support.cpp",
664 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
665 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
666 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
667 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
668 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
669 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
670 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
671 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
672 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
673 "upstream-openbsd/lib/libc/gdtoa/misc.c",
674 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
675 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
676 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
677 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
678 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
679 "upstream-openbsd/lib/libc/gdtoa/sum.c",
680 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
681 ],
682 multilib: {
683 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800684 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700685 },
686 },
687
Colin Cross50c21ab2015-10-31 23:03:05 -0700688 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700689 "-Wno-sign-compare",
690 "-Wno-uninitialized",
Dan Willemsen208ae172015-09-16 16:33:27 -0700691 "-include openbsd-compat.h",
692 ],
693
Dan Willemsen208ae172015-09-16 16:33:27 -0700694 local_include_dirs: [
695 "private",
696 "upstream-openbsd/android/include",
697 "upstream-openbsd/lib/libc/include",
698 ],
699
700 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700701}
702
703// ========================================================
George Burgess IV6cb06872017-07-21 13:28:42 -0700704// libc_fortify.a - container for our FORITFY
705// implementation details
706// ========================================================
707cc_library_static {
708 defaults: ["libc_defaults"],
George Burgess IVd34b0a92017-07-25 11:43:39 -0700709 srcs: ["bionic/fortify.cpp"],
George Burgess IV6cb06872017-07-21 13:28:42 -0700710
711 name: "libc_fortify",
712
713 // Disable FORTIFY for the compilation of these, so we don't end up having
714 // FORTIFY silently call itself.
George Burgess IVb97049c2017-07-24 15:05:05 -0700715 cflags: ["-U_FORTIFY_SOURCE", "-D__BIONIC_DECLARE_FORTIFY_HELPERS"],
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: {
George Burgess IVd34b0a92017-07-25 11:43:39 -0700724 cflags: ["-DNO___STRCAT_CHK", "-DNO___STRCPY_CHK"],
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
Dan Willemsen35e91a12015-09-17 15:28:45 -0700823 // These four require getauxval, which isn't available on older
Dan Willemsen208ae172015-09-16 16:33:27 -0700824 // platforms.
825 "bionic/getentropy_linux.c",
826 "bionic/sysconf.cpp",
827 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700828 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700829
Josh Gao10ec9282017-04-03 15:13:29 -0700830 // The following must not be statically linked into libc_ndk.a, because
831 // debuggerd will look for the abort message in libc.so's copy.
832 "bionic/android_set_abort_message.cpp",
833
Dan Willemsen208ae172015-09-16 16:33:27 -0700834 "bionic/strchr.cpp",
835 "bionic/strnlen.c",
836 "bionic/strrchr.cpp",
837 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700838
839 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700840 arm: {
841 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800842 "arch-arm/generic/bionic/memcmp.S",
843 "arch-arm/generic/bionic/memcpy.S",
844 "arch-arm/generic/bionic/memset.S",
845 "arch-arm/generic/bionic/strcmp.S",
846 "arch-arm/generic/bionic/strcpy.S",
847 "arch-arm/generic/bionic/strlen.c",
848
Dan Willemsen208ae172015-09-16 16:33:27 -0700849 "arch-arm/bionic/atomics_arm.c",
850 "arch-arm/bionic/__bionic_clone.S",
851 "arch-arm/bionic/_exit_with_stack_teardown.S",
852 "arch-arm/bionic/libgcc_compat.c",
853 "arch-arm/bionic/popcount_tab.c",
854 "arch-arm/bionic/__restore.S",
855 "arch-arm/bionic/setjmp.S",
856 "arch-arm/bionic/syscall.S",
857 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700858 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800859 cortex_a7: {
860 srcs: [
861 "arch-arm/cortex-a7/bionic/memset.S",
Christopher Ferrisecebb492016-11-28 11:09:49 -0800862 "arch-arm/cortex-a7/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800863 ],
864 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800865 "arch-arm/cortex-a15/bionic/memcpy.S",
866 "arch-arm/cortex-a15/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800867 ],
868 },
869 cortex_a9: {
870 srcs: [
871 "arch-arm/cortex-a9/bionic/memcpy.S",
872 "arch-arm/cortex-a9/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800873
Colin Cross6ab8f892015-11-23 14:12:15 -0800874 "arch-arm/cortex-a9/bionic/stpcpy.S",
875 "arch-arm/cortex-a9/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800876 "arch-arm/cortex-a9/bionic/strcmp.S",
877 "arch-arm/cortex-a9/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800878 "arch-arm/cortex-a9/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800879 ],
880 exclude_srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -0800881 "arch-arm/cortex-a15/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800882 "arch-arm/cortex-a15/bionic/memcpy.S",
883
Colin Cross6ab8f892015-11-23 14:12:15 -0800884 "arch-arm/cortex-a15/bionic/stpcpy.S",
885 "arch-arm/cortex-a15/bionic/strcat.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800886 "arch-arm/cortex-a15/bionic/strcmp.S",
887 "arch-arm/cortex-a15/bionic/strcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800888 "arch-arm/cortex-a15/bionic/strlen.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800889 ],
890 },
891 krait: {
892 srcs: [
893 "arch-arm/krait/bionic/memcpy.S",
894 "arch-arm/krait/bionic/memset.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800895
Colin Cross6ab8f892015-11-23 14:12:15 -0800896 "arch-arm/krait/bionic/strcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800897 ],
898 exclude_srcs: [
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800899 "arch-arm/cortex-a15/bionic/memset.S",
900 "arch-arm/cortex-a15/bionic/memcpy.S",
901
902 "arch-arm/cortex-a15/bionic/strcmp.S",
903 ],
904 },
905 cortex_a53: {
906 srcs: [
907 "arch-arm/cortex-a53/bionic/memcpy.S",
908 "arch-arm/cortex-a7/bionic/memset.S",
909 ],
910 exclude_srcs: [
911 "arch-arm/cortex-a15/bionic/memset.S",
912 "arch-arm/cortex-a15/bionic/memcpy.S",
913 ],
914 },
915 cortex_a73: {
916 srcs: [
917 "arch-arm/cortex-a7/bionic/memset.S",
918 "arch-arm/denver/bionic/memcpy.S",
919
920 "arch-arm/krait/bionic/strcmp.S",
921 ],
922 exclude_srcs: [
923 "arch-arm/cortex-a15/bionic/memset.S",
924 "arch-arm/cortex-a15/bionic/memcpy.S",
925 "arch-arm/cortex-a15/bionic/strcmp.S",
926 ],
927 },
928 denver: {
929 srcs: [
930 "arch-arm/denver/bionic/memcpy.S",
931 "arch-arm/denver/bionic/memset.S",
932 ],
933 exclude_srcs: [
934 "arch-arm/cortex-a15/bionic/memset.S",
935 "arch-arm/cortex-a15/bionic/memcpy.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800936 ],
937 },
Christopher Ferris950a9582017-03-29 13:10:56 -0700938 kryo: {
939 srcs: [
Jake Weinstein04d99df2016-08-25 20:03:25 -0400940 "arch-arm/kryo/bionic/memcpy.S",
Jake Weinstein4d114f92017-04-07 14:55:53 -0400941 "arch-arm/cortex-a7/bionic/memset.S",
Colin Cross6ab8f892015-11-23 14:12:15 -0800942
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800943 "arch-arm/krait/bionic/strcmp.S",
944 ],
945 exclude_srcs: [
946 "arch-arm/cortex-a15/bionic/memset.S",
947 "arch-arm/cortex-a15/bionic/memcpy.S",
948 "arch-arm/cortex-a15/bionic/strcmp.S",
949 ],
950 },
951 // Cores not listed above (like cortex-a8, cortex-a15) or
952 // "generic" core will use the following implementation.
953 neon: {
954 srcs: [
955 "arch-arm/cortex-a15/bionic/memcpy.S",
956 "arch-arm/cortex-a15/bionic/memset.S",
957
Christopher Ferris950a9582017-03-29 13:10:56 -0700958 "arch-arm/cortex-a15/bionic/stpcpy.S",
959 "arch-arm/cortex-a15/bionic/strcat.S",
Isaac Chen5e7c90b2017-09-20 14:44:42 +0800960 "arch-arm/cortex-a15/bionic/strcmp.S",
Christopher Ferris950a9582017-03-29 13:10:56 -0700961 "arch-arm/cortex-a15/bionic/strcpy.S",
962 "arch-arm/cortex-a15/bionic/strlen.S",
963
964 "arch-arm/denver/bionic/memmove.S",
965 ],
966 exclude_srcs: [
967 "arch-arm/generic/bionic/memcpy.S",
968 "arch-arm/generic/bionic/memset.S",
969 "arch-arm/generic/bionic/strcmp.S",
970 "arch-arm/generic/bionic/strcpy.S",
971 "arch-arm/generic/bionic/strlen.c",
Christopher Ferris950a9582017-03-29 13:10:56 -0700972 ],
973 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700974 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700975 arm64: {
976 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700977 "arch-arm64/generic/bionic/memchr.S",
978 "arch-arm64/generic/bionic/memcmp.S",
979 "arch-arm64/generic/bionic/memcpy.S",
980 "arch-arm64/generic/bionic/memmove.S",
981 "arch-arm64/generic/bionic/memset.S",
982 "arch-arm64/generic/bionic/stpcpy.S",
983 "arch-arm64/generic/bionic/strchr.S",
984 "arch-arm64/generic/bionic/strcmp.S",
985 "arch-arm64/generic/bionic/strcpy.S",
986 "arch-arm64/generic/bionic/strlen.S",
987 "arch-arm64/generic/bionic/strncmp.S",
988 "arch-arm64/generic/bionic/strnlen.S",
989 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -0800990
991 "arch-arm64/bionic/__bionic_clone.S",
992 "arch-arm64/bionic/_exit_with_stack_teardown.S",
993 "arch-arm64/bionic/setjmp.S",
994 "arch-arm64/bionic/syscall.S",
995 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700996 ],
997 exclude_srcs: [
998 "bionic/__memcpy_chk.cpp",
999 "bionic/strchr.cpp",
1000 "bionic/strnlen.c",
1001 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001002 denver64: {
1003 srcs: [
1004 "arch-arm64/denver64/bionic/memcpy.S",
1005 "arch-arm64/denver64/bionic/memset.S",
1006 ],
1007 exclude_srcs: [
1008 "arch-arm64/generic/bionic/memcpy.S",
1009 "arch-arm64/generic/bionic/memset.S",
1010 ],
1011 },
Jake Weinstein372f19e2016-11-17 16:01:25 -05001012 cortex_a53: {
1013 srcs: [
1014 "arch-arm64/cortex-a53/bionic/memmove.S",
1015 ],
1016 exclude_srcs: [
1017 "arch-arm64/generic/bionic/memmove.S",
1018 ],
1019 },
Christopher Ferris94bd2742017-05-08 12:09:03 -07001020 cortex_a73: {
1021 srcs: [
1022 "arch-arm64/cortex-a53/bionic/memmove.S",
1023 ],
1024 exclude_srcs: [
1025 "arch-arm64/generic/bionic/memmove.S",
1026 ],
1027 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001028 },
1029
1030 mips: {
1031 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001032 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301033 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001034 "arch-mips/string/memset.S",
1035 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301036 "arch-mips/string/strncmp.S",
1037 "arch-mips/string/strlen.c",
1038 "arch-mips/string/strnlen.c",
1039 "arch-mips/string/strchr.c",
1040 "arch-mips/string/strcpy.c",
1041 "arch-mips/string/memchr.c",
1042 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001043
Dan Willemsen208ae172015-09-16 16:33:27 -07001044 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001045 "arch-mips/bionic/cacheflush.cpp",
1046 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001047 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001048 "arch-mips/bionic/setjmp.S",
1049 "arch-mips/bionic/syscall.S",
1050 "arch-mips/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001051 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301052 exclude_srcs: [
1053 "bionic/strchr.cpp",
1054 "bionic/strnlen.c",
1055 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001056 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001057 mips64: {
1058 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001059 "arch-mips/string/memcmp.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301060 "arch-mips/string/memcpy.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001061 "arch-mips/string/memset.S",
1062 "arch-mips/string/strcmp.S",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301063 "arch-mips/string/strncmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001064 "arch-mips/string/strlen.c",
Prashant Patilfcb877a2017-03-16 18:07:00 +05301065 "arch-mips/string/strnlen.c",
1066 "arch-mips/string/strchr.c",
1067 "arch-mips/string/strcpy.c",
1068 "arch-mips/string/memchr.c",
1069 "arch-mips/string/memmove.c",
Dan Willemsen3e621712016-02-03 21:48:08 -08001070
Dan Willemsen208ae172015-09-16 16:33:27 -07001071 "arch-mips64/bionic/__bionic_clone.S",
1072 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1073 "arch-mips64/bionic/setjmp.S",
1074 "arch-mips64/bionic/syscall.S",
1075 "arch-mips64/bionic/vfork.S",
1076 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001077 ],
Prashant Patilfcb877a2017-03-16 18:07:00 +05301078 exclude_srcs: [
1079 "bionic/strchr.cpp",
1080 "bionic/strnlen.c",
1081 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001082 },
1083
1084 x86: {
1085 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001086 "arch-x86/generic/string/memcmp.S",
1087 "arch-x86/generic/string/strcmp.S",
1088 "arch-x86/generic/string/strncmp.S",
1089 "arch-x86/generic/string/strcat.S",
1090 "arch-x86/atom/string/sse2-memchr-atom.S",
1091 "arch-x86/atom/string/sse2-memrchr-atom.S",
1092 "arch-x86/atom/string/sse2-strchr-atom.S",
1093 "arch-x86/atom/string/sse2-strnlen-atom.S",
1094 "arch-x86/atom/string/sse2-strrchr-atom.S",
1095 "arch-x86/atom/string/sse2-wcschr-atom.S",
1096 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1097 "arch-x86/atom/string/sse2-wcslen-atom.S",
1098 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001099 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1100 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1101 "arch-x86/silvermont/string/sse2-memset-slm.S",
1102 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1103 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1104 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1105 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1106 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001107
1108 "arch-x86/bionic/__bionic_clone.S",
1109 "arch-x86/bionic/_exit_with_stack_teardown.S",
1110 "arch-x86/bionic/libgcc_compat.c",
1111 "arch-x86/bionic/__restore.S",
1112 "arch-x86/bionic/setjmp.S",
1113 "arch-x86/bionic/syscall.S",
1114 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001115 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001116
1117 exclude_srcs: [
1118 "bionic/strchr.cpp",
1119 "bionic/strnlen.c",
1120 "bionic/strrchr.cpp",
1121 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001122 atom: {
1123 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001124 "arch-x86/atom/string/sse2-memset-atom.S",
1125 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001126 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001127 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001128 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001129 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001130 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1131 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1132 ],
1133 exclude_srcs: [
1134 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001135 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1136 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1137 "arch-x86/silvermont/string/sse2-memset-slm.S",
1138 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1139 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1140 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1141 ],
1142 },
1143 ssse3: {
1144 srcs: [
1145 "arch-x86/atom/string/ssse3-strncat-atom.S",
1146 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1147 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1148 "arch-x86/atom/string/ssse3-strcat-atom.S",
1149 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1150 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1151 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1152 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1153 ],
1154 exclude_srcs: [
1155 "arch-x86/generic/string/strcmp.S",
1156 "arch-x86/generic/string/strncmp.S",
1157 "arch-x86/generic/string/strcat.S",
1158 ],
1159 },
1160 sse4: {
1161 srcs: [
1162 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1163 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1164 ],
1165 exclude_srcs: [
1166 "arch-x86/generic/string/memcmp.S",
1167 ],
1168 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001169 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001170 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001171 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001172 "arch-x86_64/string/sse2-memcpy-slm.S",
1173 "arch-x86_64/string/sse2-memmove-slm.S",
1174 "arch-x86_64/string/sse2-memset-slm.S",
1175 "arch-x86_64/string/sse2-stpcpy-slm.S",
1176 "arch-x86_64/string/sse2-stpncpy-slm.S",
1177 "arch-x86_64/string/sse2-strcat-slm.S",
1178 "arch-x86_64/string/sse2-strcpy-slm.S",
1179 "arch-x86_64/string/sse2-strlcat-slm.S",
1180 "arch-x86_64/string/sse2-strlcpy-slm.S",
1181 "arch-x86_64/string/sse2-strlen-slm.S",
1182 "arch-x86_64/string/sse2-strncat-slm.S",
1183 "arch-x86_64/string/sse2-strncpy-slm.S",
1184 "arch-x86_64/string/sse4-memcmp-slm.S",
1185 "arch-x86_64/string/ssse3-strcmp-slm.S",
1186 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001187
1188 "arch-x86_64/bionic/__bionic_clone.S",
1189 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1190 "arch-x86_64/bionic/__restore_rt.S",
1191 "arch-x86_64/bionic/setjmp.S",
1192 "arch-x86_64/bionic/syscall.S",
1193 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001194 ],
1195 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001196 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001197
Colin Cross50c21ab2015-10-31 23:03:05 -07001198 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001199 include_dirs: ["bionic/libstdc++/include"],
1200 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001201}
1202
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001203genrule {
1204 name: "generated_android_ids",
Colin Cross35bbed82017-01-17 18:16:07 -08001205 out: ["generated_android_ids.h"],
1206 srcs: [":android_filesystem_config_header"],
1207 tool_files: ["fs_config_generator.py"],
1208 cmd: "$(location fs_config_generator.py) aidarray $(in) > $(out)",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001209}
1210
Dan Willemsen268a6732015-10-15 14:49:45 -07001211// ========================================================
1212// libc_bionic_ndk.a- The portions of libc_bionic that can
1213// be safely used in libc_ndk.a (no troublesome global data
1214// or constructors).
1215// ========================================================
1216cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001217 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001218 srcs: [
Dan Alberte2fd0102017-07-11 14:27:07 -07001219 "bionic/NetdClientDispatch.cpp",
Sandeep Patil9b1ca562017-08-21 12:17:19 -07001220 "bionic/__bionic_get_shell_path.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001221 "bionic/__cmsg_nxthdr.cpp",
1222 "bionic/__errno.cpp",
1223 "bionic/__gnu_basename.cpp",
1224 "bionic/__libc_current_sigrtmax.cpp",
1225 "bionic/__libc_current_sigrtmin.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001226 "bionic/abort.cpp",
1227 "bionic/accept.cpp",
1228 "bionic/accept4.cpp",
1229 "bionic/access.cpp",
1230 "bionic/arpa_inet.cpp",
1231 "bionic/assert.cpp",
1232 "bionic/atof.cpp",
Josh Gaoa170d9b2016-11-10 16:08:29 -08001233 "bionic/bionic_arc4random.cpp",
Tom Cherryac49ced2017-08-17 13:18:52 -07001234 "bionic/bionic_futex.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001235 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001236 "bionic/bionic_systrace.cpp",
1237 "bionic/bionic_time_conversions.cpp",
1238 "bionic/brk.cpp",
1239 "bionic/c16rtomb.cpp",
1240 "bionic/c32rtomb.cpp",
1241 "bionic/chmod.cpp",
1242 "bionic/chown.cpp",
1243 "bionic/clearenv.cpp",
1244 "bionic/clock.cpp",
1245 "bionic/clock_getcpuclockid.cpp",
1246 "bionic/clock_nanosleep.cpp",
1247 "bionic/clone.cpp",
1248 "bionic/close.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001249 "bionic/connect.cpp",
1250 "bionic/ctype.cpp",
1251 "bionic/dirent.cpp",
1252 "bionic/dup2.cpp",
Victor Khimenko0a0743f2017-07-10 21:15:37 +02001253 "bionic/environ.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001254 "bionic/epoll_create.cpp",
1255 "bionic/epoll_pwait.cpp",
1256 "bionic/epoll_wait.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",
1339 "bionic/sigaddset.cpp",
1340 "bionic/sigdelset.cpp",
1341 "bionic/sigemptyset.cpp",
1342 "bionic/sigfillset.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001343 "bionic/sighold.cpp",
1344 "bionic/sigignore.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001345 "bionic/sigismember.cpp",
1346 "bionic/signal.cpp",
1347 "bionic/signalfd.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001348 "bionic/sigpause.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001349 "bionic/sigpending.cpp",
1350 "bionic/sigprocmask.cpp",
1351 "bionic/sigqueue.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001352 "bionic/sigrelse.cpp",
1353 "bionic/sigset.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001354 "bionic/sigsuspend.cpp",
1355 "bionic/sigtimedwait.cpp",
1356 "bionic/sigwait.cpp",
1357 "bionic/sigwaitinfo.cpp",
1358 "bionic/socket.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -07001359 "bionic/spawn.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001360 "bionic/stat.cpp",
1361 "bionic/statvfs.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001362 "bionic/stdlib_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001363 "bionic/strchrnul.cpp",
1364 "bionic/strerror.cpp",
1365 "bionic/strerror_r.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001366 "bionic/string_l.cpp",
1367 "bionic/strings_l.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001368 "bionic/strsignal.cpp",
Elliott Hughes1921dce2017-12-19 10:27:27 -08001369 "bionic/strtol.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001370 "bionic/strtold.cpp",
Elliott Hughesfa386e02017-10-18 13:34:32 -07001371 "bionic/swab.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001372 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001373 "bionic/sync_file_range.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -07001374 "bionic/sys_msg.cpp",
1375 "bionic/sys_sem.cpp",
1376 "bionic/sys_shm.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001377 "bionic/sys_siglist.c",
1378 "bionic/sys_signame.c",
Elliott Hughes449eff02016-06-08 19:51:20 -07001379 "bionic/sys_time.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001380 "bionic/sysinfo.cpp",
1381 "bionic/syslog.cpp",
Tom Cherrye275d6d2017-12-11 23:31:33 -08001382 "bionic/system_property_api.cpp",
1383 "bionic/system_property_set.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001384 "bionic/tdestroy.cpp",
1385 "bionic/termios.cpp",
1386 "bionic/thread_private.cpp",
1387 "bionic/tmpfile.cpp",
1388 "bionic/umount.cpp",
1389 "bionic/unlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001390 "bionic/wait.cpp",
1391 "bionic/wchar.cpp",
Dan Alberte2fd0102017-07-11 14:27:07 -07001392 "bionic/wchar_l.cpp",
Elliott Hughes7f0849f2016-08-26 16:17:17 -07001393 "bionic/wcstod.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001394 "bionic/wctype.cpp",
Elliott Hughesc41b5602017-07-27 17:08:08 -07001395 "bionic/wcwidth.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001396 "bionic/wmempcpy.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001397
1398 // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
1399 // which will be overridden by the actual one in libc.so.
1400 "bionic/icu_static.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001401 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001402
Dan Willemsen208ae172015-09-16 16:33:27 -07001403 multilib: {
1404 lib32: {
1405 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001406 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001407 },
1408 },
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001409 product_variables: {
Steven Moreland96bbc5c2017-12-13 14:11:26 -08001410 treble_linker_namespaces: {
1411 cflags: ["-DTREBLE_LINKER_NAMESPACES"],
Jayant Chowdharyab2f79c2017-09-01 16:29:44 -07001412 },
1413 },
Tom Cherrye275d6d2017-12-11 23:31:33 -08001414 whole_static_libs: ["libsystemproperties"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001415 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001416 local_include_dirs: ["stdio"],
1417 include_dirs: ["bionic/libstdc++/include"],
1418 name: "libc_bionic_ndk",
Elliott Hughes3f6eee92016-12-13 23:47:25 +00001419 generated_headers: ["generated_android_ids"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001420}
1421
Dan Willemsen208ae172015-09-16 16:33:27 -07001422// ========================================================
1423// libc_pthread.a - pthreads parts that previously lived in
1424// libc_bionic.a. Relocated to their own library because
1425// they can't be included in libc_ndk.a (as they layout of
1426// pthread_t has changed over the years and has ABI
1427// compatibility issues).
1428// ========================================================
1429
1430cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001431 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001432 srcs: [
1433 "bionic/pthread_atfork.cpp",
1434 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001435 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001436 "bionic/pthread_cond.cpp",
1437 "bionic/pthread_create.cpp",
1438 "bionic/pthread_detach.cpp",
1439 "bionic/pthread_equal.cpp",
1440 "bionic/pthread_exit.cpp",
1441 "bionic/pthread_getcpuclockid.cpp",
1442 "bionic/pthread_getschedparam.cpp",
1443 "bionic/pthread_gettid_np.cpp",
Elliott Hughes7484c212017-02-02 02:41:38 +00001444 "bionic/pthread_internal.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001445 "bionic/pthread_join.cpp",
1446 "bionic/pthread_key.cpp",
1447 "bionic/pthread_kill.cpp",
1448 "bionic/pthread_mutex.cpp",
1449 "bionic/pthread_once.cpp",
1450 "bionic/pthread_rwlock.cpp",
1451 "bionic/pthread_self.cpp",
1452 "bionic/pthread_setname_np.cpp",
1453 "bionic/pthread_setschedparam.cpp",
1454 "bionic/pthread_sigmask.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001455 "bionic/pthread_spinlock.cpp",
Josh Gao0e0e3702017-10-12 13:34:42 -07001456
1457 // The following implementations depend on pthread data or implementation,
1458 // so we can't include them in libc_ndk.a.
1459 "bionic/__cxa_thread_atexit_impl.cpp",
1460 "stdlib/atexit.c",
1461 "bionic/fork.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001462 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001463
Colin Cross50c21ab2015-10-31 23:03:05 -07001464 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001465 include_dirs: ["bionic/libstdc++/include"],
1466 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001467}
1468
1469// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001470// libc_syscalls.a
1471// ========================================================
1472
1473cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001474 defaults: ["libc_defaults"],
Josh Gao0e0e3702017-10-12 13:34:42 -07001475 srcs: ["bionic/__set_errno.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001476 arch: {
1477 arm: {
1478 srcs: ["arch-arm/syscalls/**/*.S"],
1479 },
1480 arm64: {
1481 srcs: ["arch-arm64/syscalls/**/*.S"],
1482 },
1483 mips: {
1484 srcs: ["arch-mips/syscalls/**/*.S"],
1485 },
1486 mips64: {
1487 srcs: ["arch-mips64/syscalls/**/*.S"],
1488 },
1489 x86: {
1490 srcs: ["arch-x86/syscalls/**/*.S"],
1491 },
1492 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001493 srcs: ["arch-x86_64/syscalls/**/*.S"],
1494 },
1495 },
1496 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001497}
1498
1499// ========================================================
1500// libc_aeabi.a
1501// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1502// to avoid infinite recursion. For the other architectures we just build an
1503// empty library to keep this makefile simple.
1504// ========================================================
1505
1506cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001507 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001508 arch: {
1509 arm: {
1510 srcs: ["arch-arm/bionic/__aeabi.c"],
1511 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001512 },
1513 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001514 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001515}
1516
1517// ========================================================
1518// libc_ndk.a
1519// Compatibility library for the NDK. This library contains
1520// all the parts of libc that are safe to statically link.
1521// We can't safely statically link things that can only run
1522// on a certain version of the OS. Examples include
1523// anything that talks to netd (a large portion of the DNS
1524// code) and anything that is dependent on the layout of a
1525// data structure that has changed across releases (such as
1526// pthread_t).
1527// ========================================================
1528
1529cc_library_static {
1530 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001531 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001532 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001533 multilib: {
1534 lib32: {
1535 srcs: libc_common_src_files_32,
1536 },
1537 },
1538 arch: {
1539 arm: {
1540 srcs: [
1541 "arch-arm/bionic/exidx_dynamic.c",
1542 "arch-common/bionic/crtbegin_so.c",
1543 "arch-arm/bionic/atexit_legacy.c",
1544 "arch-common/bionic/crtend_so.S",
1545 ],
1546 whole_static_libs: ["libc_aeabi"],
1547 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001548 },
1549
Colin Cross50c21ab2015-10-31 23:03:05 -07001550 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001551 "-fvisibility=hidden",
1552 "-DLIBC_STATIC",
1553 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001554
1555 whole_static_libs: [
1556 "libc_bionic_ndk",
George Burgess IV6cb06872017-07-21 13:28:42 -07001557 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001558 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001559 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001560 "libc_gdtoa",
1561 "libc_malloc",
1562 "libc_netbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001563 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001564 "libc_openbsd_ndk",
1565 "libc_stack_protector",
1566 "libc_syscalls",
1567 "libc_tzcode",
1568 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001569 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001570 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001571 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001572}
1573
1574// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001575// libc_nopthread.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001576// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001577cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001578 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001579 srcs: libc_common_src_files,
1580 multilib: {
1581 lib32: {
1582 srcs: libc_common_src_files_32,
1583 },
1584 },
Josh Gao0e0e3702017-10-12 13:34:42 -07001585 name: "libc_nopthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001586
1587 whole_static_libs: [
1588 "libc_bionic",
1589 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001590 "libc_dns",
George Burgess IV6cb06872017-07-21 13:28:42 -07001591 "libc_fortify",
Dan Willemsen208ae172015-09-16 16:33:27 -07001592 "libc_freebsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001593 "libc_freebsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001594 "libc_gdtoa",
1595 "libc_malloc",
1596 "libc_netbsd",
1597 "libc_openbsd",
Elliott Hughes8e547bd2016-08-16 15:57:47 -07001598 "libc_openbsd_large_stack",
Dan Willemsen208ae172015-09-16 16:33:27 -07001599 "libc_openbsd_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001600 "libc_stack_protector",
1601 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001602 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001603 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001604 ],
1605
1606 arch: {
1607 arm: {
1608 whole_static_libs: ["libc_aeabi"],
1609 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001610 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001611}
1612
1613// ========================================================
Josh Gao0e0e3702017-10-12 13:34:42 -07001614// libc_common.a
1615// ========================================================
1616
1617cc_library_static {
1618 defaults: ["libc_defaults"],
1619 name: "libc_common",
1620
1621 whole_static_libs: [
1622 "libc_nopthread",
1623 "libc_pthread",
1624 ],
1625}
1626
1627// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001628// libc_nomalloc.a
1629// ========================================================
1630//
1631// This is a version of the static C library that does not
1632// include malloc. It's useful in situations when the user wants
1633// to provide their own malloc implementation, or wants to
1634// explicitly disallow the use of malloc, such as in the
1635// dynamic linker.
1636
1637cc_library_static {
Dimitry Ivanovfc0d4802016-12-06 11:10:09 -08001638 name: "libc_nomalloc",
1639
Colin Cross50c21ab2015-10-31 23:03:05 -07001640 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001641
1642 arch: {
1643 arm: {
1644 srcs: ["arch-arm/bionic/exidx_static.c"],
1645 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001646 },
1647
Colin Cross50c21ab2015-10-31 23:03:05 -07001648 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001649
Colin Crossa3f9fca2016-01-11 13:20:55 -08001650 whole_static_libs: [
1651 "libc_common",
1652 "libc_init_static",
1653 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001654}
1655
1656// ========================================================
1657// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1658// ========================================================
1659cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001660 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001661 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001662 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001663
Dan Willemsen208ae172015-09-16 16:33:27 -07001664 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001665}
1666
1667// ========================================================
1668// libc.a + libc.so
1669// ========================================================
1670cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001671 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001672 name: "libc",
Dan Albert40f15ec2017-10-27 11:21:20 -07001673 static_ndk_lib: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001674 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001675 platform_sdk_version: {
1676 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1677 },
1678 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001679 static: {
1680 srcs: [
1681 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001682 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001683 ],
1684 cflags: ["-DLIBC_STATIC"],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001685 whole_static_libs: ["libc_init_static"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001686 },
1687 shared: {
1688 srcs: [
1689 "arch-common/bionic/crtbegin_so.c",
1690 "arch-common/bionic/crtbrand.S",
Elliott Hughesa57ca0d2016-11-17 18:18:08 -08001691 "bionic/icu.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001692 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001693 "bionic/NetdClient.cpp",
1694 "arch-common/bionic/crtend_so.S",
1695 ],
Stephen Cranef4b1cbd2017-05-09 14:27:43 -07001696 whole_static_libs: ["libc_init_dynamic"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001697 },
1698
1699 required: ["tzdata"],
1700
1701 // Leave the symbols in the shared library so that stack unwinders can produce
1702 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001703 strip: {
1704 keep_symbols: true,
1705 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001706
Colin Cross4ce94d22016-11-15 13:15:43 -08001707 // Do not pack libc.so relocations; see http://b/20645321 for details.
1708 pack_relocations: false,
1709
dimitry06016f22018-01-05 11:39:28 +01001710 // WARNING: The only libraries libc.so should depend on are libdl.so and ld-android.so!
1711 // If you add other libraries, make sure to add -Wl,--exclude-libs=libgcc.a to the
1712 // LOCAL_LDFLAGS for those libraries. This ensures that symbols that are pulled into
1713 // those new libraries from libgcc.a are not declared external; if that were the case,
1714 // then libc would not pull those symbols from libgcc.a as it should, instead relying
1715 // on the external symbols from the dependent libraries. That would create a "cloaked"
1716 // dependency on libgcc.a in libc though the libraries, which is not what you wanted!
Dan Willemsen208ae172015-09-16 16:33:27 -07001717
dimitry06016f22018-01-05 11:39:28 +01001718 shared_libs: [
1719 "ld-android",
1720 "libdl",
1721 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -07001722 whole_static_libs: ["libc_common", "libjemalloc"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001723
1724 nocrt: true,
1725
Dan Willemsen208ae172015-09-16 16:33:27 -07001726 arch: {
1727 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001728 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1729 ldflags: ["-Wl,--hash-style=both"],
1730
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001731 // Don't re-export new/delete and friends, even if the compiler really wants to.
1732 version_script: "libc.arm.map",
1733
Dan Willemsen208ae172015-09-16 16:33:27 -07001734 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001735 srcs: [
1736 "arch-arm/bionic/exidx_dynamic.c",
1737
1738 // special for arm
1739 "arch-arm/bionic/atexit_legacy.c",
1740 ],
1741 // special for arm
1742 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001743 },
1744 static: {
1745 srcs: ["arch-arm/bionic/exidx_static.c"],
1746 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001747 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001748 arm64: {
1749 // Don't re-export new/delete and friends, even if the compiler really wants to.
1750 version_script: "libc.arm64.map",
1751 },
1752 mips: {
1753 // Don't re-export new/delete and friends, even if the compiler really wants to.
1754 version_script: "libc.mips.map",
1755 },
1756 mips64: {
1757 // Don't re-export new/delete and friends, even if the compiler really wants to.
1758 version_script: "libc.mips64.map",
1759 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001760 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001761 //TODO: This is to work around b/24465209. Remove after root cause is fixed
1762 ldflags: ["-Wl,--hash-style=both"],
1763
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001764 // Don't re-export new/delete and friends, even if the compiler really wants to.
1765 version_script: "libc.x86.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001766 },
1767 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001768 // Don't re-export new/delete and friends, even if the compiler really wants to.
1769 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001770 },
1771 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001772}
1773
Dan Willemsen208ae172015-09-16 16:33:27 -07001774// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001775// libstdc++.so + libstdc++.a
1776// ========================================================
1777cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001778 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001779 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001780 srcs: [
1781 "bionic/__cxa_guard.cpp",
1782 "bionic/__cxa_pure_virtual.cpp",
1783 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001784 ],
1785 name: "libstdc++",
Dan Albert40f15ec2017-10-27 11:21:20 -07001786 static_ndk_lib: true,
Dan Willemsen208ae172015-09-16 16:33:27 -07001787 system_shared_libs: ["libc"],
Isaac Chen5e7c90b2017-09-20 14:44:42 +08001788 static_libs: ["libasync_safe"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001789
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001790 //TODO (dimitry): This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001791 arch: {
1792 arm: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001793 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001794 version_script: "libstdc++.arm.map",
1795 },
1796 arm64: {
1797 version_script: "libstdc++.arm64.map",
1798 },
1799 mips: {
1800 version_script: "libstdc++.mips.map",
1801 },
1802 mips64: {
1803 version_script: "libstdc++.mips64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001804 },
1805 x86: {
Ian Pedowitzb6310c22018-01-18 16:26:19 -08001806 ldflags: ["-Wl,--hash-style=both"],
Dimitry Ivanov6cc8d472016-07-28 13:52:17 -07001807 version_script: "libstdc++.x86.map",
1808 },
1809 x86_64: {
1810 version_script: "libstdc++.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001811 },
1812 },
1813}
1814
Colin Cross50c21ab2015-10-31 23:03:05 -07001815cc_defaults {
1816 name: "crt_defaults",
Dan Willemsen7ec52b12016-11-28 17:02:25 -08001817 defaults: ["linux_bionic_supported"],
Dan Willemsen230a7a42017-04-07 14:09:05 -07001818 vendor_available: true,
Colin Cross50c21ab2015-10-31 23:03:05 -07001819
Colin Cross7d7b3682017-11-03 13:38:40 -07001820 cflags: ["-Wno-gcc-compat", "-Wall", "-Werror"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001821}
1822
Colin Cross50c21ab2015-10-31 23:03:05 -07001823cc_defaults {
1824 name: "crt_so_defaults",
Colin Cross7d7b3682017-11-03 13:38:40 -07001825 defaults: ["crt_defaults"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001826
1827 arch: {
1828 mips: {
1829 cflags: ["-fPIC"],
1830 },
1831 mips64: {
1832 cflags: ["-fPIC"],
1833 },
1834 x86: {
1835 cflags: ["-fPIC"],
1836 },
1837 x86_64: {
1838 cflags: ["-fPIC"],
1839 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001840 },
1841}
1842
Dan Willemsena3ed9012017-04-04 15:51:26 -07001843// crt obj files
Dan Willemsen208ae172015-09-16 16:33:27 -07001844cc_object {
1845 name: "crtbrand",
Dan Willemsena3ed9012017-04-04 15:51:26 -07001846 // crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
Dan Willemsen208ae172015-09-16 16:33:27 -07001847 local_include_dirs: ["include"],
1848 product_variables: {
1849 platform_sdk_version: {
1850 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1851 },
1852 },
1853 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001854
Colin Cross7d7b3682017-11-03 13:38:40 -07001855 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001856}
1857
Dan Willemsen208ae172015-09-16 16:33:27 -07001858cc_object {
1859 name: "crtbegin_so1",
1860 local_include_dirs: ["include"],
1861 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001862
Colin Cross7d7b3682017-11-03 13:38:40 -07001863 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001864}
1865
Dan Willemsen208ae172015-09-16 16:33:27 -07001866cc_object {
1867 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001868
Colin Cross7d7b3682017-11-03 13:38:40 -07001869 defaults: ["crt_so_defaults"],
Colin Cross77d57bf2016-04-11 14:34:18 -07001870 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001871 "crtbegin_so1",
1872 "crtbrand",
1873 ],
1874}
1875
Dan Willemsen208ae172015-09-16 16:33:27 -07001876cc_object {
1877 name: "crtend_so",
1878 local_include_dirs: ["include"],
1879 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001880
Colin Cross7d7b3682017-11-03 13:38:40 -07001881 defaults: ["crt_so_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001882}
1883
Dan Willemsen208ae172015-09-16 16:33:27 -07001884cc_object {
1885 name: "crtbegin_static1",
1886 local_include_dirs: ["include"],
1887 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001888
Colin Cross50c21ab2015-10-31 23:03:05 -07001889 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001890 mips: {
1891 srcs: [
1892 "arch-mips/bionic/crtbegin.c",
1893 ],
1894 exclude_srcs: [
1895 "arch-common/bionic/crtbegin.c",
1896 ],
1897 },
1898 mips64: {
1899 srcs: [
1900 "arch-mips64/bionic/crtbegin.c",
1901 ],
1902 exclude_srcs: [
1903 "arch-common/bionic/crtbegin.c",
1904 ],
1905 },
1906 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001907
1908 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001909}
1910
Dan Willemsen208ae172015-09-16 16:33:27 -07001911cc_object {
1912 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001913
Colin Cross77d57bf2016-04-11 14:34:18 -07001914 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001915 "crtbegin_static1",
1916 "crtbrand",
1917 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001918 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001919}
1920
Dan Willemsen208ae172015-09-16 16:33:27 -07001921cc_object {
1922 name: "crtbegin_dynamic1",
1923 local_include_dirs: ["include"],
1924 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001925
Colin Cross50c21ab2015-10-31 23:03:05 -07001926 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001927 mips: {
1928 srcs: [
1929 "arch-mips/bionic/crtbegin.c",
1930 ],
1931 exclude_srcs: [
1932 "arch-common/bionic/crtbegin.c",
1933 ],
1934 },
1935 mips64: {
1936 srcs: [
1937 "arch-mips64/bionic/crtbegin.c",
1938 ],
1939 exclude_srcs: [
1940 "arch-common/bionic/crtbegin.c",
1941 ],
1942 },
1943 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001944 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001945}
1946
Dan Willemsen208ae172015-09-16 16:33:27 -07001947cc_object {
1948 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001949
Colin Cross77d57bf2016-04-11 14:34:18 -07001950 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001951 "crtbegin_dynamic1",
1952 "crtbrand",
1953 ],
Dan Willemsen7ccc50d2017-09-18 21:28:14 -07001954 target: {
1955 linux_bionic: {
1956 generated_sources: ["host_bionic_linker_asm"],
1957 objs: [
1958 "linker_wrapper",
1959 ],
1960 },
1961 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001962 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001963}
1964
Dan Willemsen208ae172015-09-16 16:33:27 -07001965cc_object {
1966 // We rename crtend.o to crtend_android.o to avoid a
1967 // name clash between gcc and bionic.
1968 name: "crtend_android",
1969 local_include_dirs: ["include"],
1970 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001971
Colin Cross50c21ab2015-10-31 23:03:05 -07001972 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001973}
Colin Crossbaa48992016-07-13 11:15:21 -07001974
Dan Albert22805ea2017-03-22 15:28:05 -07001975preprocessed_ndk_headers {
1976 name: "common_libc",
1977 from: "include",
1978 to: "",
1979 license: "NOTICE",
1980}
Dan Albert4238a352016-06-28 11:18:05 -07001981
1982ndk_headers {
Dan Albert063e86a2016-11-29 11:09:12 -08001983 name: "libc_uapi",
1984 from: "kernel/uapi",
1985 to: "",
1986 srcs: [
1987 "kernel/uapi/asm-generic/**/*.h",
1988 "kernel/uapi/drm/**/*.h",
1989 "kernel/uapi/linux/**/*.h",
1990 "kernel/uapi/misc/**/*.h",
1991 "kernel/uapi/mtd/**/*.h",
1992 "kernel/uapi/rdma/**/*.h",
1993 "kernel/uapi/scsi/**/*.h",
1994 "kernel/uapi/sound/**/*.h",
1995 "kernel/uapi/video/**/*.h",
1996 "kernel/uapi/xen/**/*.h",
1997 ],
Dan Albert92592652016-10-20 01:42:54 -07001998 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07001999}
2000
2001ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002002 name: "libc_kernel_android_uapi_linux",
Dan Albertbae16ef2016-09-14 17:15:48 -07002003 from: "kernel/android/uapi/linux",
2004 to: "linux",
2005 srcs: ["kernel/android/uapi/linux/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002006 license: "NOTICE",
Dan Albertbae16ef2016-09-14 17:15:48 -07002007}
2008
2009ndk_headers {
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002010 name: "libc_kernel_android_scsi",
Elliott Hughes50599392017-05-25 17:13:32 -07002011 from: "kernel/android/scsi/scsi",
Elliott Hughes2fad0d52017-04-27 16:26:55 -07002012 to: "scsi",
2013 srcs: ["kernel/android/scsi/**/*.h"],
2014 license: "NOTICE",
2015}
2016
2017ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002018 name: "libc_asm_arm",
2019 from: "kernel/uapi/asm-arm",
2020 to: "arm-linux-androideabi",
2021 srcs: ["kernel/uapi/asm-arm/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002022 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002023}
2024
2025ndk_headers {
2026 name: "libc_asm_arm64",
2027 from: "kernel/uapi/asm-arm64",
2028 to: "aarch64-linux-android",
2029 srcs: ["kernel/uapi/asm-arm64/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002030 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002031}
2032
Elliott Hughesee291c02017-12-11 11:32:34 -08002033// Not actually used in the NDK, but needed to build AOSP for mips.
Dan Albert4238a352016-06-28 11:18:05 -07002034ndk_headers {
Lazar Trsic790d2f72017-11-27 11:54:11 +01002035 name: "libc_asm_mips",
2036 from: "kernel/uapi/asm-mips",
2037 to: "mipsel-linux-android",
2038 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2039 license: "NOTICE",
2040}
2041
Elliott Hughesee291c02017-12-11 11:32:34 -08002042// Not actually used in the NDK, but needed to build AOSP for mips64.
Lazar Trsic790d2f72017-11-27 11:54:11 +01002043ndk_headers {
2044 name: "libc_asm_mips64",
2045 from: "kernel/uapi/asm-mips",
2046 to: "mips64el-linux-android",
2047 srcs: ["kernel/uapi/asm-mips/**/*.h"],
2048 license: "NOTICE",
2049}
2050
2051ndk_headers {
Dan Albert4238a352016-06-28 11:18:05 -07002052 name: "libc_asm_x86",
2053 from: "kernel/uapi/asm-x86",
2054 to: "i686-linux-android",
2055 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002056 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002057}
2058
2059ndk_headers {
2060 name: "libc_asm_x86_64",
2061 from: "kernel/uapi/asm-x86",
2062 to: "x86_64-linux-android",
2063 srcs: ["kernel/uapi/asm-x86/**/*.h"],
Dan Albert92592652016-10-20 01:42:54 -07002064 license: "NOTICE",
Dan Albert4238a352016-06-28 11:18:05 -07002065}
2066
Dan Albert4238a352016-06-28 11:18:05 -07002067ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002068 name: "libc",
Dan Albert4238a352016-06-28 11:18:05 -07002069 symbol_file: "libc.map.txt",
2070 first_version: "9",
2071}
2072
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002073llndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002074 name: "libc",
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002075 symbol_file: "libc.map.txt",
2076 export_headers_as_system: true,
2077 export_preprocessed_headers: ["include"],
2078 arch: {
2079 arm: {
2080 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002081 "kernel/uapi",
2082 "kernel/uapi/asm-arm",
2083 "kernel/android/uapi",
2084 ],
2085 },
2086 arm64: {
2087 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002088 "kernel/uapi",
2089 "kernel/uapi/asm-arm64",
2090 "kernel/android/uapi",
2091 ],
2092 },
2093 mips: {
2094 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002095 "kernel/uapi",
2096 "kernel/uapi/asm-mips",
2097 "kernel/android/uapi",
2098 ],
2099 },
2100 mips64: {
2101 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002102 "kernel/uapi",
2103 "kernel/uapi/asm-mips",
2104 "kernel/android/uapi",
2105 ],
2106 },
2107 x86: {
2108 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002109 "kernel/uapi",
2110 "kernel/uapi/asm-x86",
2111 "kernel/android/uapi",
2112 ],
2113 },
2114 x86_64: {
2115 export_include_dirs: [
Dan Willemsenb8f7fde2017-03-20 14:07:47 -07002116 "kernel/uapi",
2117 "kernel/uapi/asm-x86",
2118 "kernel/android/uapi",
2119 ],
2120 },
2121 },
2122}
2123
Dan Albertdf31aff2016-10-06 15:50:41 -07002124ndk_library {
Dan Willemsen51a9bf12017-04-07 14:09:18 -07002125 name: "libstdc++",
Dan Albertdf31aff2016-10-06 15:50:41 -07002126 symbol_file: "libstdc++.map.txt",
2127 first_version: "9",
2128}
2129
Dan Willemsenca056d72018-01-08 14:00:24 -08002130// Export these headers for toolbox to process
2131filegroup {
2132 name: "kernel_input_headers",
2133 srcs: [
2134 "kernel/uapi/linux/input.h",
2135 "kernel/uapi/linux/input-event-codes.h",
2136 ],
2137}