blob: 4a44fc6e4ce8288497630b2bfce9fed2ad07670d [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 = [
Dan Willemsen208ae172015-09-16 16:33:27 -07004 "bionic/ether_aton.c",
5 "bionic/ether_ntoa.c",
6 "bionic/fts.c",
7 "bionic/getpriority.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07008 "bionic/initgroups.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07009 "bionic/isatty.c",
10 "bionic/memmem.c",
11 "bionic/pututline.c",
12 "bionic/sched_cpualloc.c",
13 "bionic/sched_cpucount.c",
14 "bionic/sigblock.c",
15 "bionic/siginterrupt.c",
16 "bionic/sigsetmask.c",
17 "bionic/system_properties_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070018 "stdio/fread.c",
Dan Willemsen268a6732015-10-15 14:49:45 -070019 "stdio/refill.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070020 "stdio/snprintf.c",
21 "stdio/sprintf.c",
Dan Willemsen3e621712016-02-03 21:48:08 -080022 "stdio/stdio.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -070023 "stdio/stdio_ext.cpp",
24 "stdlib/atexit.c",
25 "stdlib/exit.c",
Dan Willemsen208ae172015-09-16 16:33:27 -070026]
27
28// Various kinds of cruft.
29// ========================================================
30libc_common_src_files += [
31 "bionic/ndk_cruft.cpp",
32]
33
34libc_common_src_files_32 = [
35 "bionic/legacy_32_bit_support.cpp",
36 "bionic/time64.c",
37]
38
39// Define some common cflags
40// ========================================================
Colin Cross50c21ab2015-10-31 23:03:05 -070041cc_defaults {
42 name: "libc_defaults",
43 cflags: [
44 "-D_LIBC=1",
45 "-Wall",
46 "-Wextra",
47 "-Wunused",
Dan Willemsenbe45b222016-04-04 13:18:46 -070048 "-Wno-deprecated-declarations",
Dan Willemsen208ae172015-09-16 16:33:27 -070049
Colin Cross50c21ab2015-10-31 23:03:05 -070050 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
51 "-Werror=pointer-to-int-cast",
52 "-Werror=int-to-pointer-cast",
53 "-Werror=type-limits",
54 "-Werror",
55 ],
56 // TODO: split out the asflags.
57 asflags: [
58 "-D_LIBC=1",
59 "-Wall",
60 "-Wextra",
61 "-Wunused",
Dan Willemsen208ae172015-09-16 16:33:27 -070062
Colin Cross50c21ab2015-10-31 23:03:05 -070063 // Try to catch typical 32-bit assumptions that break with 64-bit pointers.
64 "-Werror=pointer-to-int-cast",
65 "-Werror=int-to-pointer-cast",
66 "-Werror=type-limits",
67 "-Werror",
68 ],
69 conlyflags: ["-std=gnu99"],
70 cppflags: [],
Dan Willemsen3e621712016-02-03 21:48:08 -080071 include_dirs: ["external/jemalloc/include"],
Colin Cross50c21ab2015-10-31 23:03:05 -070072
Colin Cross50c21ab2015-10-31 23:03:05 -070073 stl: "none",
74 system_shared_libs: [],
Colin Cross27c43c52016-04-07 13:27:24 -070075 sanitize: {
76 never: true,
77 },
Colin Cross50c21ab2015-10-31 23:03:05 -070078 native_coverage: false,
Colin Cross5a22d3e2016-05-18 14:06:22 -070079 clang: true,
Dan Willemsen208ae172015-09-16 16:33:27 -070080}
81
Dan Willemsen208ae172015-09-16 16:33:27 -070082// ANDROIDMK TRANSLATION ERROR: unsupported directive
83// ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
84//libc_common_cflags += ["-DDEBUG"]
85// ANDROIDMK TRANSLATION ERROR: unsupported directive
86// endif
87
Dan Willemsen208ae172015-09-16 16:33:27 -070088// ========================================================
89// libc_stack_protector.a - stack protector code
90// ========================================================
91//
Colin Crossa3f9fca2016-01-11 13:20:55 -080092// Code that implements the stack protector (or that runs
93// before TLS has been set up) needs to be compiled with
94// -fno-stack-protector, since it accesses the stack canary
95// TLS slot.
Dan Willemsen208ae172015-09-16 16:33:27 -070096
97cc_library_static {
98
Colin Crossa3f9fca2016-01-11 13:20:55 -080099 srcs: [
100 "bionic/__libc_init_main_thread.cpp",
101 "bionic/__stack_chk_fail.cpp",
102 ],
103 arch: {
104 arm64: {
105 srcs: ["arch-arm64/bionic/__set_tls.c"],
106 },
107 x86: {
Dan Willemsen879cec22016-02-29 10:37:56 -0800108 srcs: ["arch-x86/bionic/__set_tls.cpp"],
Colin Crossa3f9fca2016-01-11 13:20:55 -0800109 },
110 x86_64: {
111 srcs: ["arch-x86_64/bionic/__set_tls.c"],
112 },
113 },
114
Colin Cross50c21ab2015-10-31 23:03:05 -0700115 defaults: ["libc_defaults"],
116 cflags: ["-fno-stack-protector"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700117 name: "libc_stack_protector",
Dan Willemsen208ae172015-09-16 16:33:27 -0700118}
119
Colin Crossa3f9fca2016-01-11 13:20:55 -0800120// libc_init_static.cpp also needs to be built without stack protector,
121// because it's responsible for setting up TLS for static executables.
122// This isn't the case for dynamic executables because the dynamic linker
123// has already set up the main thread's TLS.
124
125cc_library_static {
126 name: "libc_init_static",
127 defaults: ["libc_defaults"],
128 srcs: ["bionic/libc_init_static.cpp"],
129 cflags: ["-fno-stack-protector"],
130}
131
132
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",
Dan Willemsen208ae172015-09-16 16:33:27 -0700142 "upstream-openbsd/lib/libc/time/wcsftime.c", // tzcode doesn't include wcsftime, so we use the OpenBSD one.
143 ],
144
Colin Cross50c21ab2015-10-31 23:03:05 -0700145 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700146 "-fvisibility=hidden",
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.
157 "-DTZDIR=\\\"/system/usr/share/zoneinfo\\\"",
158 // Include timezone and daylight globals.
159 "-DUSG_COMPAT=1",
Colin Crossa35d23d2015-11-19 13:32:49 -0800160 // Use the empty string (instead of " ") as the timezone abbreviation
161 // fallback.
162 "-DWILDABBR=\\\"\\\"",
Dan Willemsen208ae172015-09-16 16:33:27 -0700163 "-DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU",
164 "-Dlint",
165 ],
166
Dan Willemsen208ae172015-09-16 16:33:27 -0700167 local_include_dirs: ["tzcode/"],
168 name: "libc_tzcode",
Dan Willemsen208ae172015-09-16 16:33:27 -0700169}
170
171// ========================================================
172// libc_dns.a - modified NetBSD DNS code
173// ========================================================
174
175cc_library_static {
176
Colin Cross50c21ab2015-10-31 23:03:05 -0700177 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700178 srcs: [
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800179 "dns/**/*.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700180
181 "upstream-netbsd/lib/libc/isc/ev_streams.c",
182 "upstream-netbsd/lib/libc/isc/ev_timers.c",
183 "upstream-netbsd/lib/libc/resolv/mtctxres.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700184 ],
185
Colin Cross50c21ab2015-10-31 23:03:05 -0700186 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700187 "-DANDROID_CHANGES",
188 "-DINET6",
Dan Willemsen208ae172015-09-16 16:33:27 -0700189 "-Wno-unused-parameter",
190 "-include netbsd-compat.h",
191 ],
192
Dan Willemsen208ae172015-09-16 16:33:27 -0700193 local_include_dirs: [
194 "dns/include",
195 "private",
196 "upstream-netbsd/lib/libc/include",
197 "upstream-netbsd/android/include",
198 ],
199
200 name: "libc_dns",
Dan Willemsen208ae172015-09-16 16:33:27 -0700201}
202
203// ========================================================
204// libc_freebsd.a - upstream FreeBSD C library code
205// ========================================================
206//
207// These files are built with the freebsd-compat.h header file
208// automatically included.
209
210cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700211 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700212 srcs: [
213 "upstream-freebsd/lib/libc/gen/ldexp.c",
214 "upstream-freebsd/lib/libc/gen/sleep.c",
215 "upstream-freebsd/lib/libc/gen/usleep.c",
216 "upstream-freebsd/lib/libc/stdlib/getopt_long.c",
217 "upstream-freebsd/lib/libc/stdlib/qsort.c",
218 "upstream-freebsd/lib/libc/stdlib/quick_exit.c",
219 "upstream-freebsd/lib/libc/stdlib/realpath.c",
220 "upstream-freebsd/lib/libc/string/wcpcpy.c",
221 "upstream-freebsd/lib/libc/string/wcpncpy.c",
222 "upstream-freebsd/lib/libc/string/wcscasecmp.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700223 "upstream-freebsd/lib/libc/string/wcscat.c",
224 "upstream-freebsd/lib/libc/string/wcschr.c",
225 "upstream-freebsd/lib/libc/string/wcscmp.c",
226 "upstream-freebsd/lib/libc/string/wcscpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700227 "upstream-freebsd/lib/libc/string/wcscspn.c",
228 "upstream-freebsd/lib/libc/string/wcsdup.c",
229 "upstream-freebsd/lib/libc/string/wcslcat.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700230 "upstream-freebsd/lib/libc/string/wcslen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700231 "upstream-freebsd/lib/libc/string/wcsncasecmp.c",
232 "upstream-freebsd/lib/libc/string/wcsncat.c",
233 "upstream-freebsd/lib/libc/string/wcsncmp.c",
234 "upstream-freebsd/lib/libc/string/wcsncpy.c",
235 "upstream-freebsd/lib/libc/string/wcsnlen.c",
236 "upstream-freebsd/lib/libc/string/wcspbrk.c",
Dan Willemsen268a6732015-10-15 14:49:45 -0700237 "upstream-freebsd/lib/libc/string/wcsrchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700238 "upstream-freebsd/lib/libc/string/wcsspn.c",
239 "upstream-freebsd/lib/libc/string/wcstok.c",
240 "upstream-freebsd/lib/libc/string/wmemchr.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700241 "upstream-freebsd/lib/libc/string/wmemcmp.c",
242 "upstream-freebsd/lib/libc/string/wmemmove.c",
Dan Willemsen9c9aa742016-01-15 16:00:57 -0800243 "upstream-freebsd/lib/libc/string/wmemset.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700244 ],
245 arch: {
246 arm64: {
247 exclude_srcs: [
248 "upstream-freebsd/lib/libc/string/wmemmove.c",
249 ],
250 },
251 x86: {
252 exclude_srcs: [
253 "upstream-freebsd/lib/libc/string/wcschr.c",
254 "upstream-freebsd/lib/libc/string/wcscmp.c",
255 "upstream-freebsd/lib/libc/string/wcslen.c",
256 "upstream-freebsd/lib/libc/string/wcsrchr.c",
257 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800258 atom: {
259 exclude_srcs: [
260 "upstream-freebsd/lib/libc/string/wmemcmp.c",
261 ],
262 },
263 ssse3: {
264 exclude_srcs: [
265 "upstream-freebsd/lib/libc/string/wcscat.c",
266 "upstream-freebsd/lib/libc/string/wcscpy.c",
267 ],
268 },
269 sse4: {
270 exclude_srcs: [
271 "upstream-freebsd/lib/libc/string/wmemcmp.c",
272 ],
273 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700274 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700275 },
276
Colin Cross50c21ab2015-10-31 23:03:05 -0700277 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700278 "-Wno-sign-compare",
279 "-Wno-uninitialized",
280 "-include freebsd-compat.h",
281 ],
282
Dan Willemsen208ae172015-09-16 16:33:27 -0700283 local_include_dirs: [
284 "upstream-freebsd/android/include",
285 ],
286
287 name: "libc_freebsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700288}
289
290// ========================================================
291// libc_netbsd.a - upstream NetBSD C library code
292// ========================================================
293//
294// These files are built with the netbsd-compat.h header file
295// automatically included.
296
297cc_library_static {
298
Colin Cross50c21ab2015-10-31 23:03:05 -0700299 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700300 srcs: [
301 "upstream-netbsd/common/lib/libc/stdlib/random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700302 "upstream-netbsd/lib/libc/gen/nice.c",
303 "upstream-netbsd/lib/libc/gen/popen.c",
304 "upstream-netbsd/lib/libc/gen/psignal.c",
305 "upstream-netbsd/lib/libc/gen/utime.c",
306 "upstream-netbsd/lib/libc/gen/utmp.c",
307 "upstream-netbsd/lib/libc/inet/nsap_addr.c",
308 "upstream-netbsd/lib/libc/regex/regcomp.c",
309 "upstream-netbsd/lib/libc/regex/regerror.c",
310 "upstream-netbsd/lib/libc/regex/regexec.c",
311 "upstream-netbsd/lib/libc/regex/regfree.c",
312 "upstream-netbsd/lib/libc/stdlib/bsearch.c",
313 "upstream-netbsd/lib/libc/stdlib/div.c",
314 "upstream-netbsd/lib/libc/stdlib/drand48.c",
315 "upstream-netbsd/lib/libc/stdlib/erand48.c",
316 "upstream-netbsd/lib/libc/stdlib/jrand48.c",
317 "upstream-netbsd/lib/libc/stdlib/lcong48.c",
318 "upstream-netbsd/lib/libc/stdlib/ldiv.c",
319 "upstream-netbsd/lib/libc/stdlib/lldiv.c",
320 "upstream-netbsd/lib/libc/stdlib/lrand48.c",
321 "upstream-netbsd/lib/libc/stdlib/mrand48.c",
322 "upstream-netbsd/lib/libc/stdlib/nrand48.c",
323 "upstream-netbsd/lib/libc/stdlib/_rand48.c",
324 "upstream-netbsd/lib/libc/stdlib/rand_r.c",
325 "upstream-netbsd/lib/libc/stdlib/reallocarr.c",
326 "upstream-netbsd/lib/libc/stdlib/seed48.c",
327 "upstream-netbsd/lib/libc/stdlib/srand48.c",
328 "upstream-netbsd/lib/libc/string/memccpy.c",
329 "upstream-netbsd/lib/libc/string/strcasestr.c",
330 "upstream-netbsd/lib/libc/string/strcoll.c",
331 "upstream-netbsd/lib/libc/string/strxfrm.c",
332 ],
333 multilib: {
334 lib32: {
335 // LP32 cruft
336 srcs: ["upstream-netbsd/common/lib/libc/hash/sha1/sha1.c"],
337 },
338 },
Colin Cross50c21ab2015-10-31 23:03:05 -0700339 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700340 "-Wno-sign-compare",
341 "-Wno-uninitialized",
Dan Willemsen879cec22016-02-29 10:37:56 -0800342 "-Wno-unused-parameter",
Dan Willemsen208ae172015-09-16 16:33:27 -0700343 "-DPOSIX_MISTAKE",
344 "-include netbsd-compat.h",
345 ],
346
Dan Willemsen208ae172015-09-16 16:33:27 -0700347 local_include_dirs: [
348 "upstream-netbsd/android/include",
349 "upstream-netbsd/lib/libc/include",
350 ],
351
352 name: "libc_netbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700353}
354
355// ========================================================
356// libc_openbsd_ndk.a - upstream OpenBSD C library code
357// that can be safely included in the libc_ndk.a (doesn't
358// contain any troublesome global data or constructors).
359// ========================================================
360//
361// These files are built with the openbsd-compat.h header file
362// automatically included.
363
364cc_library_static {
365 name: "libc_openbsd_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -0700366 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700367 srcs: [
368 "upstream-openbsd/lib/libc/compat-43/killpg.c",
369 "upstream-openbsd/lib/libc/gen/alarm.c",
370 "upstream-openbsd/lib/libc/gen/ctype_.c",
371 "upstream-openbsd/lib/libc/gen/daemon.c",
372 "upstream-openbsd/lib/libc/gen/err.c",
373 "upstream-openbsd/lib/libc/gen/errx.c",
374 "upstream-openbsd/lib/libc/gen/exec.c",
375 "upstream-openbsd/lib/libc/gen/fnmatch.c",
376 "upstream-openbsd/lib/libc/gen/ftok.c",
377 "upstream-openbsd/lib/libc/gen/getprogname.c",
378 "upstream-openbsd/lib/libc/gen/isctype.c",
379 "upstream-openbsd/lib/libc/gen/setprogname.c",
380 "upstream-openbsd/lib/libc/gen/time.c",
381 "upstream-openbsd/lib/libc/gen/tolower_.c",
382 "upstream-openbsd/lib/libc/gen/toupper_.c",
383 "upstream-openbsd/lib/libc/gen/verr.c",
384 "upstream-openbsd/lib/libc/gen/verrx.c",
385 "upstream-openbsd/lib/libc/gen/vwarn.c",
386 "upstream-openbsd/lib/libc/gen/vwarnx.c",
387 "upstream-openbsd/lib/libc/gen/warn.c",
388 "upstream-openbsd/lib/libc/gen/warnx.c",
389 "upstream-openbsd/lib/libc/locale/btowc.c",
390 "upstream-openbsd/lib/libc/locale/mbrlen.c",
391 "upstream-openbsd/lib/libc/locale/mbstowcs.c",
392 "upstream-openbsd/lib/libc/locale/mbtowc.c",
393 "upstream-openbsd/lib/libc/locale/wcscoll.c",
394 "upstream-openbsd/lib/libc/locale/wcstod.c",
395 "upstream-openbsd/lib/libc/locale/wcstof.c",
396 "upstream-openbsd/lib/libc/locale/wcstoimax.c",
397 "upstream-openbsd/lib/libc/locale/wcstol.c",
398 "upstream-openbsd/lib/libc/locale/wcstold.c",
399 "upstream-openbsd/lib/libc/locale/wcstoll.c",
400 "upstream-openbsd/lib/libc/locale/wcstombs.c",
401 "upstream-openbsd/lib/libc/locale/wcstoul.c",
402 "upstream-openbsd/lib/libc/locale/wcstoull.c",
403 "upstream-openbsd/lib/libc/locale/wcstoumax.c",
404 "upstream-openbsd/lib/libc/locale/wcsxfrm.c",
405 "upstream-openbsd/lib/libc/locale/wctob.c",
406 "upstream-openbsd/lib/libc/locale/wctomb.c",
Elliott Hughes26fda772016-04-06 11:56:41 -0700407 "upstream-openbsd/lib/libc/net/base64.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700408 "upstream-openbsd/lib/libc/net/htonl.c",
409 "upstream-openbsd/lib/libc/net/htons.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700410 "upstream-openbsd/lib/libc/net/inet_lnaof.c",
411 "upstream-openbsd/lib/libc/net/inet_makeaddr.c",
412 "upstream-openbsd/lib/libc/net/inet_netof.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700413 "upstream-openbsd/lib/libc/net/inet_ntoa.c",
414 "upstream-openbsd/lib/libc/net/inet_ntop.c",
415 "upstream-openbsd/lib/libc/net/inet_pton.c",
416 "upstream-openbsd/lib/libc/net/ntohl.c",
417 "upstream-openbsd/lib/libc/net/ntohs.c",
Colin Cross8ce38af2016-01-19 12:50:20 -0800418 "upstream-openbsd/lib/libc/net/res_random.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700419 "upstream-openbsd/lib/libc/stdio/asprintf.c",
420 "upstream-openbsd/lib/libc/stdio/clrerr.c",
421 "upstream-openbsd/lib/libc/stdio/dprintf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700422 "upstream-openbsd/lib/libc/stdio/feof.c",
423 "upstream-openbsd/lib/libc/stdio/ferror.c",
424 "upstream-openbsd/lib/libc/stdio/fflush.c",
425 "upstream-openbsd/lib/libc/stdio/fgetc.c",
426 "upstream-openbsd/lib/libc/stdio/fgetln.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700427 "upstream-openbsd/lib/libc/stdio/fgets.c",
428 "upstream-openbsd/lib/libc/stdio/fgetwc.c",
429 "upstream-openbsd/lib/libc/stdio/fgetws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700430 "upstream-openbsd/lib/libc/stdio/flags.c",
431 "upstream-openbsd/lib/libc/stdio/fmemopen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700432 "upstream-openbsd/lib/libc/stdio/fprintf.c",
433 "upstream-openbsd/lib/libc/stdio/fpurge.c",
434 "upstream-openbsd/lib/libc/stdio/fputc.c",
435 "upstream-openbsd/lib/libc/stdio/fputs.c",
436 "upstream-openbsd/lib/libc/stdio/fputwc.c",
437 "upstream-openbsd/lib/libc/stdio/fputws.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700438 "upstream-openbsd/lib/libc/stdio/fscanf.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700439 "upstream-openbsd/lib/libc/stdio/fvwrite.c",
440 "upstream-openbsd/lib/libc/stdio/fwalk.c",
441 "upstream-openbsd/lib/libc/stdio/fwide.c",
442 "upstream-openbsd/lib/libc/stdio/fwprintf.c",
443 "upstream-openbsd/lib/libc/stdio/fwrite.c",
444 "upstream-openbsd/lib/libc/stdio/fwscanf.c",
445 "upstream-openbsd/lib/libc/stdio/getc.c",
446 "upstream-openbsd/lib/libc/stdio/getchar.c",
447 "upstream-openbsd/lib/libc/stdio/getdelim.c",
448 "upstream-openbsd/lib/libc/stdio/getline.c",
449 "upstream-openbsd/lib/libc/stdio/gets.c",
450 "upstream-openbsd/lib/libc/stdio/getwc.c",
451 "upstream-openbsd/lib/libc/stdio/getwchar.c",
452 "upstream-openbsd/lib/libc/stdio/makebuf.c",
453 "upstream-openbsd/lib/libc/stdio/mktemp.c",
454 "upstream-openbsd/lib/libc/stdio/open_memstream.c",
455 "upstream-openbsd/lib/libc/stdio/open_wmemstream.c",
456 "upstream-openbsd/lib/libc/stdio/perror.c",
457 "upstream-openbsd/lib/libc/stdio/printf.c",
458 "upstream-openbsd/lib/libc/stdio/putc.c",
459 "upstream-openbsd/lib/libc/stdio/putchar.c",
460 "upstream-openbsd/lib/libc/stdio/puts.c",
461 "upstream-openbsd/lib/libc/stdio/putwc.c",
462 "upstream-openbsd/lib/libc/stdio/putwchar.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700463 "upstream-openbsd/lib/libc/stdio/remove.c",
464 "upstream-openbsd/lib/libc/stdio/rewind.c",
465 "upstream-openbsd/lib/libc/stdio/rget.c",
466 "upstream-openbsd/lib/libc/stdio/scanf.c",
467 "upstream-openbsd/lib/libc/stdio/setbuf.c",
468 "upstream-openbsd/lib/libc/stdio/setbuffer.c",
469 "upstream-openbsd/lib/libc/stdio/setvbuf.c",
470 "upstream-openbsd/lib/libc/stdio/sscanf.c",
471 "upstream-openbsd/lib/libc/stdio/swprintf.c",
472 "upstream-openbsd/lib/libc/stdio/swscanf.c",
473 "upstream-openbsd/lib/libc/stdio/tempnam.c",
474 "upstream-openbsd/lib/libc/stdio/tmpnam.c",
475 "upstream-openbsd/lib/libc/stdio/ungetc.c",
476 "upstream-openbsd/lib/libc/stdio/ungetwc.c",
477 "upstream-openbsd/lib/libc/stdio/vasprintf.c",
478 "upstream-openbsd/lib/libc/stdio/vdprintf.c",
479 "upstream-openbsd/lib/libc/stdio/vfprintf.c",
480 "upstream-openbsd/lib/libc/stdio/vfscanf.c",
481 "upstream-openbsd/lib/libc/stdio/vfwprintf.c",
482 "upstream-openbsd/lib/libc/stdio/vfwscanf.c",
483 "upstream-openbsd/lib/libc/stdio/vprintf.c",
484 "upstream-openbsd/lib/libc/stdio/vscanf.c",
485 "upstream-openbsd/lib/libc/stdio/vsnprintf.c",
486 "upstream-openbsd/lib/libc/stdio/vsprintf.c",
487 "upstream-openbsd/lib/libc/stdio/vsscanf.c",
488 "upstream-openbsd/lib/libc/stdio/vswprintf.c",
489 "upstream-openbsd/lib/libc/stdio/vswscanf.c",
490 "upstream-openbsd/lib/libc/stdio/vwprintf.c",
491 "upstream-openbsd/lib/libc/stdio/vwscanf.c",
492 "upstream-openbsd/lib/libc/stdio/wbuf.c",
493 "upstream-openbsd/lib/libc/stdio/wprintf.c",
494 "upstream-openbsd/lib/libc/stdio/wscanf.c",
495 "upstream-openbsd/lib/libc/stdio/wsetup.c",
496 "upstream-openbsd/lib/libc/stdlib/abs.c",
497 "upstream-openbsd/lib/libc/stdlib/atoi.c",
498 "upstream-openbsd/lib/libc/stdlib/atol.c",
499 "upstream-openbsd/lib/libc/stdlib/atoll.c",
500 "upstream-openbsd/lib/libc/stdlib/getenv.c",
Colin Crossb8396102016-04-07 13:24:50 -0700501 "upstream-openbsd/lib/libc/stdlib/getsubopt.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700502 "upstream-openbsd/lib/libc/stdlib/insque.c",
503 "upstream-openbsd/lib/libc/stdlib/imaxabs.c",
504 "upstream-openbsd/lib/libc/stdlib/imaxdiv.c",
505 "upstream-openbsd/lib/libc/stdlib/labs.c",
506 "upstream-openbsd/lib/libc/stdlib/llabs.c",
507 "upstream-openbsd/lib/libc/stdlib/lsearch.c",
508 "upstream-openbsd/lib/libc/stdlib/reallocarray.c",
509 "upstream-openbsd/lib/libc/stdlib/remque.c",
510 "upstream-openbsd/lib/libc/stdlib/setenv.c",
511 "upstream-openbsd/lib/libc/stdlib/strtoimax.c",
512 "upstream-openbsd/lib/libc/stdlib/strtol.c",
513 "upstream-openbsd/lib/libc/stdlib/strtoll.c",
514 "upstream-openbsd/lib/libc/stdlib/strtoul.c",
515 "upstream-openbsd/lib/libc/stdlib/strtoull.c",
516 "upstream-openbsd/lib/libc/stdlib/strtoumax.c",
517 "upstream-openbsd/lib/libc/stdlib/system.c",
518 "upstream-openbsd/lib/libc/stdlib/tfind.c",
519 "upstream-openbsd/lib/libc/stdlib/tsearch.c",
520 "upstream-openbsd/lib/libc/string/strcasecmp.c",
521 "upstream-openbsd/lib/libc/string/strcspn.c",
522 "upstream-openbsd/lib/libc/string/strdup.c",
523 "upstream-openbsd/lib/libc/string/strndup.c",
524 "upstream-openbsd/lib/libc/string/strpbrk.c",
525 "upstream-openbsd/lib/libc/string/strsep.c",
526 "upstream-openbsd/lib/libc/string/strspn.c",
527 "upstream-openbsd/lib/libc/string/strstr.c",
528 "upstream-openbsd/lib/libc/string/strtok.c",
529 "upstream-openbsd/lib/libc/string/wmemcpy.c",
530 "upstream-openbsd/lib/libc/string/wcslcpy.c",
531 "upstream-openbsd/lib/libc/string/wcsstr.c",
532 "upstream-openbsd/lib/libc/string/wcswidth.c",
533 ],
534
Colin Cross50c21ab2015-10-31 23:03:05 -0700535 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700536 "-Wno-sign-compare",
537 "-Wno-uninitialized",
538 "-Wno-unused-parameter",
539 "-include openbsd-compat.h",
540 ],
541
Dan Willemsen208ae172015-09-16 16:33:27 -0700542 local_include_dirs: [
543 "private",
544 "stdio",
545 "upstream-openbsd/android/include",
546 "upstream-openbsd/lib/libc/include",
547 "upstream-openbsd/lib/libc/gdtoa/",
548 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700549}
550
551// ========================================================
552// libc_openbsd.a - upstream OpenBSD C library code
553// ========================================================
554//
555// These files are built with the openbsd-compat.h header file
556// automatically included.
557cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700558 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700559 srcs: [
Dan Willemsen35e91a12015-09-17 15:28:45 -0700560 // These two depend on getentropy_linux.c, which isn't in libc_ndk.a.
Dan Willemsen208ae172015-09-16 16:33:27 -0700561 "upstream-openbsd/lib/libc/crypt/arc4random.c",
562 "upstream-openbsd/lib/libc/crypt/arc4random_uniform.c",
563
564 // May be overriden by per-arch optimized versions
565 "upstream-openbsd/lib/libc/string/memchr.c",
566 "upstream-openbsd/lib/libc/string/memmove.c",
567 "upstream-openbsd/lib/libc/string/memrchr.c",
568 "upstream-openbsd/lib/libc/string/stpcpy.c",
569 "upstream-openbsd/lib/libc/string/stpncpy.c",
570 "upstream-openbsd/lib/libc/string/strcat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700571 "upstream-openbsd/lib/libc/string/strcpy.c",
572 "upstream-openbsd/lib/libc/string/strlcat.c",
573 "upstream-openbsd/lib/libc/string/strlcpy.c",
574 "upstream-openbsd/lib/libc/string/strncat.c",
575 "upstream-openbsd/lib/libc/string/strncmp.c",
576 "upstream-openbsd/lib/libc/string/strncpy.c",
577 ],
578 multilib: {
579 lib32: {
580 // LP32 cruft
581 srcs: ["upstream-openbsd/lib/libc/stdio/putw.c"],
582 },
583 },
584
585 arch: {
586 arm: {
587 exclude_srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700588 "upstream-openbsd/lib/libc/string/strcpy.c",
589 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800590 cortex_a7: {
591 exclude_srcs: [
592 "upstream-openbsd/lib/libc/string/memmove.c",
593 "upstream-openbsd/lib/libc/string/stpcpy.c",
594 "upstream-openbsd/lib/libc/string/strcat.c",
595 ],
596 },
597 cortex_a53: {
598 exclude_srcs: [
599 "upstream-openbsd/lib/libc/string/memmove.c",
600 "upstream-openbsd/lib/libc/string/stpcpy.c",
601 "upstream-openbsd/lib/libc/string/strcat.c",
602 ],
603 },
604 cortex_a53_a57: {
605 exclude_srcs: [
606 "upstream-openbsd/lib/libc/string/memmove.c",
607 "upstream-openbsd/lib/libc/string/stpcpy.c",
608 "upstream-openbsd/lib/libc/string/strcat.c",
609 ],
610 },
611 cortex_a8: {
612 exclude_srcs: [
613 "upstream-openbsd/lib/libc/string/memmove.c",
614 "upstream-openbsd/lib/libc/string/stpcpy.c",
615 "upstream-openbsd/lib/libc/string/strcat.c",
616 ],
617 },
618 cortex_a9: {
619 exclude_srcs: [
620 "upstream-openbsd/lib/libc/string/memmove.c",
621 "upstream-openbsd/lib/libc/string/stpcpy.c",
622 "upstream-openbsd/lib/libc/string/strcat.c",
623 ],
624 },
625 cortex_a15: {
626 exclude_srcs: [
627 "upstream-openbsd/lib/libc/string/memmove.c",
628 "upstream-openbsd/lib/libc/string/stpcpy.c",
629 "upstream-openbsd/lib/libc/string/strcat.c",
630 ],
631 },
632 denver: {
633 exclude_srcs: [
634 "upstream-openbsd/lib/libc/string/memmove.c",
635 "upstream-openbsd/lib/libc/string/stpcpy.c",
636 "upstream-openbsd/lib/libc/string/strcat.c",
637 ],
638 },
639 krait: {
640 exclude_srcs: [
641 "upstream-openbsd/lib/libc/string/memmove.c",
642 "upstream-openbsd/lib/libc/string/stpcpy.c",
643 "upstream-openbsd/lib/libc/string/strcat.c",
644 ],
645 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700646 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700647 arm64: {
648 exclude_srcs: [
649 "upstream-openbsd/lib/libc/string/memchr.c",
650 "upstream-openbsd/lib/libc/string/memmove.c",
651 "upstream-openbsd/lib/libc/string/stpcpy.c",
Dan Willemsen208ae172015-09-16 16:33:27 -0700652 "upstream-openbsd/lib/libc/string/strcpy.c",
653 "upstream-openbsd/lib/libc/string/strncmp.c",
654 ],
655 },
656
Dan Willemsen208ae172015-09-16 16:33:27 -0700657 x86: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800658 exclude_srcs: [
659 "upstream-openbsd/lib/libc/string/memchr.c",
660 "upstream-openbsd/lib/libc/string/memmove.c",
661 "upstream-openbsd/lib/libc/string/memrchr.c",
662 "upstream-openbsd/lib/libc/string/stpcpy.c",
663 "upstream-openbsd/lib/libc/string/stpncpy.c",
664 "upstream-openbsd/lib/libc/string/strcat.c",
665 "upstream-openbsd/lib/libc/string/strcpy.c",
666 "upstream-openbsd/lib/libc/string/strncmp.c",
667 "upstream-openbsd/lib/libc/string/strncpy.c",
668 ],
669 ssse3: {
670 exclude_srcs: [
671 "upstream-openbsd/lib/libc/string/strlcat.c",
672 "upstream-openbsd/lib/libc/string/strlcpy.c",
673 "upstream-openbsd/lib/libc/string/strncat.c",
674 ],
675 },
Dan Willemsen208ae172015-09-16 16:33:27 -0700676 },
677
678 x86_64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800679 exclude_srcs: [
680 "upstream-openbsd/lib/libc/string/memmove.c",
681 "upstream-openbsd/lib/libc/string/stpcpy.c",
682 "upstream-openbsd/lib/libc/string/stpncpy.c",
683 "upstream-openbsd/lib/libc/string/strcat.c",
684 "upstream-openbsd/lib/libc/string/strcpy.c",
685 "upstream-openbsd/lib/libc/string/strlcat.c",
686 "upstream-openbsd/lib/libc/string/strlcpy.c",
687 "upstream-openbsd/lib/libc/string/strncat.c",
688 "upstream-openbsd/lib/libc/string/strncmp.c",
689 "upstream-openbsd/lib/libc/string/strncpy.c",
690 ],
Dan Willemsen208ae172015-09-16 16:33:27 -0700691 },
692 },
693
Colin Cross50c21ab2015-10-31 23:03:05 -0700694 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700695 "-Wno-sign-compare",
696 "-Wno-uninitialized",
697 "-Wno-unused-parameter",
698 "-include openbsd-compat.h",
699 ],
700
Dan Willemsen208ae172015-09-16 16:33:27 -0700701 local_include_dirs: [
702 "private",
703 "stdio",
704 "upstream-openbsd/android/include",
705 "upstream-openbsd/lib/libc/include",
706 "upstream-openbsd/lib/libc/gdtoa/",
707 ],
708
709 name: "libc_openbsd",
Dan Willemsen208ae172015-09-16 16:33:27 -0700710}
711
712// ========================================================
713// libc_gdtoa.a - upstream OpenBSD C library gdtoa code
714// ========================================================
715//
716// These files are built with the openbsd-compat.h header file
717// automatically included.
718
719cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700720 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700721 srcs: [
722 "upstream-openbsd/android/gdtoa_support.cpp",
723 "upstream-openbsd/lib/libc/gdtoa/dmisc.c",
724 "upstream-openbsd/lib/libc/gdtoa/dtoa.c",
725 "upstream-openbsd/lib/libc/gdtoa/gdtoa.c",
726 "upstream-openbsd/lib/libc/gdtoa/gethex.c",
727 "upstream-openbsd/lib/libc/gdtoa/gmisc.c",
728 "upstream-openbsd/lib/libc/gdtoa/hd_init.c",
729 "upstream-openbsd/lib/libc/gdtoa/hdtoa.c",
730 "upstream-openbsd/lib/libc/gdtoa/hexnan.c",
731 "upstream-openbsd/lib/libc/gdtoa/ldtoa.c",
732 "upstream-openbsd/lib/libc/gdtoa/misc.c",
733 "upstream-openbsd/lib/libc/gdtoa/smisc.c",
734 "upstream-openbsd/lib/libc/gdtoa/strtod.c",
735 "upstream-openbsd/lib/libc/gdtoa/strtodg.c",
736 "upstream-openbsd/lib/libc/gdtoa/strtof.c",
737 "upstream-openbsd/lib/libc/gdtoa/strtord.c",
738 "upstream-openbsd/lib/libc/gdtoa/sum.c",
739 "upstream-openbsd/lib/libc/gdtoa/ulp.c",
740 ],
741 multilib: {
742 lib64: {
Colin Cross6ab8f892015-11-23 14:12:15 -0800743 srcs: ["upstream-openbsd/lib/libc/gdtoa/strtorQ.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700744 },
745 },
746
Colin Cross50c21ab2015-10-31 23:03:05 -0700747 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -0700748 "-Wno-sign-compare",
749 "-Wno-uninitialized",
750 "-fvisibility=hidden",
751 "-include openbsd-compat.h",
752 ],
753
Dan Willemsen208ae172015-09-16 16:33:27 -0700754 local_include_dirs: [
755 "private",
756 "upstream-openbsd/android/include",
757 "upstream-openbsd/lib/libc/include",
758 ],
759
760 name: "libc_gdtoa",
Dan Willemsen208ae172015-09-16 16:33:27 -0700761}
762
763// ========================================================
764// libc_bionic.a - home-grown C library code
765// ========================================================
766
767cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -0700768 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700769 srcs: [
Yabin Cui9b687dc2015-11-30 14:07:58 -0800770 // The following implementations depend on pthread data, so we can't
771 // include them in libc_ndk.a.
772 "bionic/__cxa_thread_atexit_impl.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700773 "bionic/fork.cpp",
774
775 // The data that backs getauxval is initialized in the libc init
776 // functions which are invoked by the linker. If this file is included
777 // in libc_ndk.a, only one of the copies of the global data will be
778 // initialized, resulting in nullptr dereferences.
779 "bionic/getauxval.cpp",
780
Dan Willemsen35e91a12015-09-17 15:28:45 -0700781 // These four require getauxval, which isn't available on older
Dan Willemsen208ae172015-09-16 16:33:27 -0700782 // platforms.
783 "bionic/getentropy_linux.c",
784 "bionic/sysconf.cpp",
785 "bionic/vdso.cpp",
Dan Willemsen35e91a12015-09-17 15:28:45 -0700786 "bionic/setjmp_cookie.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700787
Dan Willemsen208ae172015-09-16 16:33:27 -0700788 "bionic/__memcpy_chk.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700789 "bionic/__strcat_chk.cpp",
790 "bionic/__strcpy_chk.cpp",
791 "bionic/strchr.cpp",
792 "bionic/strnlen.c",
793 "bionic/strrchr.cpp",
794 ],
Colin Cross50c21ab2015-10-31 23:03:05 -0700795 cflags: ["-Wframe-larger-than=2048"],
Dan Willemsen208ae172015-09-16 16:33:27 -0700796
797 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -0700798 arm: {
799 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -0800800 "arch-arm/generic/bionic/memcmp.S",
801 "arch-arm/generic/bionic/memcpy.S",
802 "arch-arm/generic/bionic/memset.S",
803 "arch-arm/generic/bionic/strcmp.S",
804 "arch-arm/generic/bionic/strcpy.S",
805 "arch-arm/generic/bionic/strlen.c",
806
Dan Willemsen208ae172015-09-16 16:33:27 -0700807 "arch-arm/bionic/abort_arm.S",
808 "arch-arm/bionic/atomics_arm.c",
809 "arch-arm/bionic/__bionic_clone.S",
810 "arch-arm/bionic/_exit_with_stack_teardown.S",
811 "arch-arm/bionic/libgcc_compat.c",
812 "arch-arm/bionic/popcount_tab.c",
813 "arch-arm/bionic/__restore.S",
814 "arch-arm/bionic/setjmp.S",
815 "arch-arm/bionic/syscall.S",
816 "arch-arm/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -0700817 ],
818 exclude_srcs: [
819 "bionic/__memcpy_chk.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -0700820 ],
Colin Cross6ab8f892015-11-23 14:12:15 -0800821 cortex_a7: {
822 srcs: [
823 "arch-arm/cortex-a7/bionic/memset.S",
824
825 "arch-arm/cortex-a15/bionic/memcpy.S",
826 "arch-arm/cortex-a15/bionic/stpcpy.S",
827 "arch-arm/cortex-a15/bionic/strcat.S",
828 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
829 "arch-arm/cortex-a15/bionic/strcmp.S",
830 "arch-arm/cortex-a15/bionic/strcpy.S",
831 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
832 "arch-arm/cortex-a15/bionic/strlen.S",
833
834 "arch-arm/denver/bionic/memmove.S",
835 ],
836 exclude_srcs: [
837 "arch-arm/generic/bionic/memcpy.S",
838 "arch-arm/generic/bionic/memset.S",
839 "arch-arm/generic/bionic/strcmp.S",
840 "arch-arm/generic/bionic/strcpy.S",
841 "arch-arm/generic/bionic/strlen.c",
842 "bionic/__strcat_chk.cpp",
843 "bionic/__strcpy_chk.cpp",
844 ],
845 },
846 cortex_a53: {
847 srcs: [
848 "arch-arm/cortex-a53/bionic/memcpy.S",
849 "arch-arm/cortex-a53/bionic/__strcat_chk.S",
850 "arch-arm/cortex-a53/bionic/__strcpy_chk.S",
851
852 "arch-arm/cortex-a7/bionic/memset.S",
853
854 "arch-arm/cortex-a15/bionic/stpcpy.S",
855 "arch-arm/cortex-a15/bionic/strcat.S",
856 "arch-arm/cortex-a15/bionic/strcmp.S",
857 "arch-arm/cortex-a15/bionic/strcpy.S",
858 "arch-arm/cortex-a15/bionic/strlen.S",
859
860 "arch-arm/denver/bionic/memmove.S",
861 ],
862 exclude_srcs: [
863 "arch-arm/generic/bionic/memcpy.S",
864 "arch-arm/generic/bionic/memset.S",
865 "arch-arm/generic/bionic/strcmp.S",
866 "arch-arm/generic/bionic/strcpy.S",
867 "arch-arm/generic/bionic/strlen.c",
868 "bionic/__strcat_chk.cpp",
869 "bionic/__strcpy_chk.cpp",
870 ],
871 },
872 cortex_a53_a57: {
873 srcs: [
874 "arch-arm/cortex-a15/bionic/memcpy.S",
875 "arch-arm/cortex-a15/bionic/memset.S",
876 "arch-arm/cortex-a15/bionic/stpcpy.S",
877 "arch-arm/cortex-a15/bionic/strcat.S",
878 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
879 "arch-arm/cortex-a15/bionic/strcmp.S",
880 "arch-arm/cortex-a15/bionic/strcpy.S",
881 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
882 "arch-arm/cortex-a15/bionic/strlen.S",
883
884 "arch-arm/denver/bionic/memmove.S",
885 ],
886 exclude_srcs: [
887 "arch-arm/generic/bionic/memcpy.S",
888 "arch-arm/generic/bionic/memset.S",
889 "arch-arm/generic/bionic/strcmp.S",
890 "arch-arm/generic/bionic/strcpy.S",
891 "arch-arm/generic/bionic/strlen.c",
892 "bionic/__strcat_chk.cpp",
893 "bionic/__strcpy_chk.cpp",
894 ],
895 },
896 cortex_a8: {
897 srcs: [
898 "arch-arm/cortex-a15/bionic/memcpy.S",
899 "arch-arm/cortex-a15/bionic/memset.S",
900 "arch-arm/cortex-a15/bionic/stpcpy.S",
901 "arch-arm/cortex-a15/bionic/strcat.S",
902 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
903 "arch-arm/cortex-a15/bionic/strcmp.S",
904 "arch-arm/cortex-a15/bionic/strcpy.S",
905 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
906 "arch-arm/cortex-a15/bionic/strlen.S",
907
908 "arch-arm/denver/bionic/memmove.S",
909 ],
910 exclude_srcs: [
911 "arch-arm/generic/bionic/memcpy.S",
912 "arch-arm/generic/bionic/memset.S",
913 "arch-arm/generic/bionic/strcmp.S",
914 "arch-arm/generic/bionic/strcpy.S",
915 "arch-arm/generic/bionic/strlen.c",
916 "bionic/__strcat_chk.cpp",
917 "bionic/__strcpy_chk.cpp",
918 ],
919 },
920 cortex_a9: {
921 srcs: [
922 "arch-arm/cortex-a9/bionic/memcpy.S",
923 "arch-arm/cortex-a9/bionic/memset.S",
924 "arch-arm/cortex-a9/bionic/stpcpy.S",
925 "arch-arm/cortex-a9/bionic/strcat.S",
926 "arch-arm/cortex-a9/bionic/__strcat_chk.S",
927 "arch-arm/cortex-a9/bionic/strcmp.S",
928 "arch-arm/cortex-a9/bionic/strcpy.S",
929 "arch-arm/cortex-a9/bionic/__strcpy_chk.S",
930 "arch-arm/cortex-a9/bionic/strlen.S",
931
932 "arch-arm/denver/bionic/memmove.S",
933 ],
934 exclude_srcs: [
935 "arch-arm/generic/bionic/memcpy.S",
936 "arch-arm/generic/bionic/memset.S",
937 "arch-arm/generic/bionic/strcmp.S",
938 "arch-arm/generic/bionic/strcpy.S",
939 "arch-arm/generic/bionic/strlen.c",
940 "bionic/__strcat_chk.cpp",
941 "bionic/__strcpy_chk.cpp",
942 ],
943 },
944 cortex_a15: {
945 srcs: [
946 "arch-arm/cortex-a15/bionic/memcpy.S",
947 "arch-arm/cortex-a15/bionic/memset.S",
948 "arch-arm/cortex-a15/bionic/stpcpy.S",
949 "arch-arm/cortex-a15/bionic/strcat.S",
950 "arch-arm/cortex-a15/bionic/__strcat_chk.S",
951 "arch-arm/cortex-a15/bionic/strcmp.S",
952 "arch-arm/cortex-a15/bionic/strcpy.S",
953 "arch-arm/cortex-a15/bionic/__strcpy_chk.S",
954 "arch-arm/cortex-a15/bionic/strlen.S",
955
956 "arch-arm/denver/bionic/memmove.S",
957 ],
958 exclude_srcs: [
959 "arch-arm/generic/bionic/memcpy.S",
960 "arch-arm/generic/bionic/memset.S",
961 "arch-arm/generic/bionic/strcmp.S",
962 "arch-arm/generic/bionic/strcpy.S",
963 "arch-arm/generic/bionic/strlen.c",
964 "bionic/__strcat_chk.cpp",
965 "bionic/__strcpy_chk.cpp",
966 ],
967 },
968 denver: {
969 srcs: [
970 "arch-arm/denver/bionic/memcpy.S",
971 "arch-arm/denver/bionic/memmove.S",
972 "arch-arm/denver/bionic/memset.S",
973 "arch-arm/denver/bionic/__strcat_chk.S",
974 "arch-arm/denver/bionic/__strcpy_chk.S",
975
976 // Use cortex-a15 versions of strcat/strcpy/strlen.
977 "arch-arm/cortex-a15/bionic/stpcpy.S",
978 "arch-arm/cortex-a15/bionic/strcat.S",
979 "arch-arm/cortex-a15/bionic/strcmp.S",
980 "arch-arm/cortex-a15/bionic/strcpy.S",
981 "arch-arm/cortex-a15/bionic/strlen.S",
982 ],
983 exclude_srcs: [
984 "arch-arm/generic/bionic/memcpy.S",
985 "arch-arm/generic/bionic/memset.S",
986 "arch-arm/generic/bionic/strcmp.S",
987 "arch-arm/generic/bionic/strcpy.S",
988 "arch-arm/generic/bionic/strlen.c",
989 "bionic/__strcat_chk.cpp",
990 "bionic/__strcpy_chk.cpp",
991 ],
992 },
993 krait: {
994 srcs: [
995 "arch-arm/krait/bionic/memcpy.S",
996 "arch-arm/krait/bionic/memset.S",
997 "arch-arm/krait/bionic/strcmp.S",
998 "arch-arm/krait/bionic/__strcat_chk.S",
999 "arch-arm/krait/bionic/__strcpy_chk.S",
1000
1001 // Use cortex-a15 versions of strcat/strcpy/strlen.
1002 "arch-arm/cortex-a15/bionic/stpcpy.S",
1003 "arch-arm/cortex-a15/bionic/strcat.S",
1004 "arch-arm/cortex-a15/bionic/strcpy.S",
1005 "arch-arm/cortex-a15/bionic/strlen.S",
1006
1007 "arch-arm/denver/bionic/memmove.S",
1008 ],
1009 exclude_srcs: [
1010 "arch-arm/generic/bionic/memcpy.S",
1011 "arch-arm/generic/bionic/memset.S",
1012 "arch-arm/generic/bionic/strcmp.S",
1013 "arch-arm/generic/bionic/strcpy.S",
1014 "arch-arm/generic/bionic/strlen.c",
1015 "bionic/__strcat_chk.cpp",
1016 "bionic/__strcpy_chk.cpp",
1017 ],
1018 },
1019
Dan Willemsen208ae172015-09-16 16:33:27 -07001020 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001021 arm64: {
1022 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001023 "arch-arm64/generic/bionic/memchr.S",
1024 "arch-arm64/generic/bionic/memcmp.S",
1025 "arch-arm64/generic/bionic/memcpy.S",
1026 "arch-arm64/generic/bionic/memmove.S",
1027 "arch-arm64/generic/bionic/memset.S",
1028 "arch-arm64/generic/bionic/stpcpy.S",
1029 "arch-arm64/generic/bionic/strchr.S",
1030 "arch-arm64/generic/bionic/strcmp.S",
1031 "arch-arm64/generic/bionic/strcpy.S",
1032 "arch-arm64/generic/bionic/strlen.S",
1033 "arch-arm64/generic/bionic/strncmp.S",
1034 "arch-arm64/generic/bionic/strnlen.S",
1035 "arch-arm64/generic/bionic/wmemmove.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001036
1037 "arch-arm64/bionic/__bionic_clone.S",
1038 "arch-arm64/bionic/_exit_with_stack_teardown.S",
1039 "arch-arm64/bionic/setjmp.S",
1040 "arch-arm64/bionic/syscall.S",
1041 "arch-arm64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001042 ],
1043 exclude_srcs: [
1044 "bionic/__memcpy_chk.cpp",
1045 "bionic/strchr.cpp",
1046 "bionic/strnlen.c",
1047 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001048 denver64: {
1049 srcs: [
1050 "arch-arm64/denver64/bionic/memcpy.S",
1051 "arch-arm64/denver64/bionic/memset.S",
1052 ],
1053 exclude_srcs: [
1054 "arch-arm64/generic/bionic/memcpy.S",
1055 "arch-arm64/generic/bionic/memset.S",
1056 ],
1057 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001058 },
1059
1060 mips: {
1061 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001062 "arch-mips/string/memcmp.c",
1063 "arch-mips/string/memcpy.S",
1064 "arch-mips/string/memset.S",
1065 "arch-mips/string/strcmp.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001066
Dan Willemsen208ae172015-09-16 16:33:27 -07001067 "arch-mips/bionic/__bionic_clone.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001068 "arch-mips/bionic/cacheflush.cpp",
1069 "arch-mips/bionic/_exit_with_stack_teardown.S",
Dan Willemsen879cec22016-02-29 10:37:56 -08001070 "arch-mips/bionic/libgcc_compat.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001071 "arch-mips/bionic/setjmp.S",
1072 "arch-mips/bionic/syscall.S",
1073 "arch-mips/bionic/vfork.S",
Dan Willemsen0c657082016-05-12 01:43:07 -07001074
1075 "arch-mips/string/mips_strlen.c",
Dan Willemsen208ae172015-09-16 16:33:27 -07001076 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001077 rev6: {
1078 srcs: [
Dan Willemsen0c657082016-05-12 01:43:07 -07001079 "arch-mips/string/strlen.c",
Colin Cross6ab8f892015-11-23 14:12:15 -08001080 ],
1081 exclude_srcs: [
Dan Willemsen0c657082016-05-12 01:43:07 -07001082 "arch-mips/string/mips_strlen.c",
Colin Cross6ab8f892015-11-23 14:12:15 -08001083 ],
1084 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001085 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001086 mips64: {
1087 srcs: [
Dan Willemsen3e621712016-02-03 21:48:08 -08001088 "arch-mips/string/memcmp.c",
1089 "arch-mips/string/memcpy.S",
1090 "arch-mips/string/memset.S",
1091 "arch-mips/string/strcmp.S",
1092 "arch-mips/string/strlen.c",
1093
Dan Willemsen208ae172015-09-16 16:33:27 -07001094 "arch-mips64/bionic/__bionic_clone.S",
1095 "arch-mips64/bionic/_exit_with_stack_teardown.S",
1096 "arch-mips64/bionic/setjmp.S",
1097 "arch-mips64/bionic/syscall.S",
1098 "arch-mips64/bionic/vfork.S",
1099 "arch-mips64/bionic/stat.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001100 ],
1101 },
1102
1103 x86: {
1104 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001105 "arch-x86/generic/string/memcmp.S",
1106 "arch-x86/generic/string/strcmp.S",
1107 "arch-x86/generic/string/strncmp.S",
1108 "arch-x86/generic/string/strcat.S",
1109 "arch-x86/atom/string/sse2-memchr-atom.S",
1110 "arch-x86/atom/string/sse2-memrchr-atom.S",
1111 "arch-x86/atom/string/sse2-strchr-atom.S",
1112 "arch-x86/atom/string/sse2-strnlen-atom.S",
1113 "arch-x86/atom/string/sse2-strrchr-atom.S",
1114 "arch-x86/atom/string/sse2-wcschr-atom.S",
1115 "arch-x86/atom/string/sse2-wcsrchr-atom.S",
1116 "arch-x86/atom/string/sse2-wcslen-atom.S",
1117 "arch-x86/atom/string/sse2-wcscmp-atom.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001118 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1119 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1120 "arch-x86/silvermont/string/sse2-memset-slm.S",
1121 "arch-x86/silvermont/string/sse2-stpcpy-slm.S",
1122 "arch-x86/silvermont/string/sse2-stpncpy-slm.S",
1123 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1124 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1125 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001126
1127 "arch-x86/bionic/__bionic_clone.S",
1128 "arch-x86/bionic/_exit_with_stack_teardown.S",
1129 "arch-x86/bionic/libgcc_compat.c",
1130 "arch-x86/bionic/__restore.S",
1131 "arch-x86/bionic/setjmp.S",
1132 "arch-x86/bionic/syscall.S",
1133 "arch-x86/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001134 ],
Dan Willemsen268a6732015-10-15 14:49:45 -07001135
1136 exclude_srcs: [
1137 "bionic/strchr.cpp",
1138 "bionic/strnlen.c",
1139 "bionic/strrchr.cpp",
1140 ],
Colin Cross6ab8f892015-11-23 14:12:15 -08001141 atom: {
1142 srcs: [
Colin Cross6ab8f892015-11-23 14:12:15 -08001143 "arch-x86/atom/string/sse2-memset-atom.S",
1144 "arch-x86/atom/string/sse2-strlen-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001145 "arch-x86/atom/string/ssse3-memcmp-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001146 "arch-x86/atom/string/ssse3-memcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001147 "arch-x86/atom/string/ssse3-memmove-atom.S",
Dan Willemsen701b5452016-01-12 19:35:40 -08001148 "arch-x86/atom/string/ssse3-strcpy-atom.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001149 "arch-x86/atom/string/ssse3-strncpy-atom.S",
1150 "arch-x86/atom/string/ssse3-wmemcmp-atom.S",
1151 ],
1152 exclude_srcs: [
1153 "arch-x86/generic/string/memcmp.S",
Colin Cross6ab8f892015-11-23 14:12:15 -08001154 "arch-x86/silvermont/string/sse2-memcpy-slm.S",
1155 "arch-x86/silvermont/string/sse2-memmove-slm.S",
1156 "arch-x86/silvermont/string/sse2-memset-slm.S",
1157 "arch-x86/silvermont/string/sse2-strcpy-slm.S",
1158 "arch-x86/silvermont/string/sse2-strlen-slm.S",
1159 "arch-x86/silvermont/string/sse2-strncpy-slm.S",
1160 ],
1161 },
1162 ssse3: {
1163 srcs: [
1164 "arch-x86/atom/string/ssse3-strncat-atom.S",
1165 "arch-x86/atom/string/ssse3-strlcat-atom.S",
1166 "arch-x86/atom/string/ssse3-strlcpy-atom.S",
1167 "arch-x86/atom/string/ssse3-strcat-atom.S",
1168 "arch-x86/atom/string/ssse3-strcmp-atom.S",
1169 "arch-x86/atom/string/ssse3-strncmp-atom.S",
1170 "arch-x86/atom/string/ssse3-wcscat-atom.S",
1171 "arch-x86/atom/string/ssse3-wcscpy-atom.S",
1172 ],
1173 exclude_srcs: [
1174 "arch-x86/generic/string/strcmp.S",
1175 "arch-x86/generic/string/strncmp.S",
1176 "arch-x86/generic/string/strcat.S",
1177 ],
1178 },
1179 sse4: {
1180 srcs: [
1181 "arch-x86/silvermont/string/sse4-memcmp-slm.S",
1182 "arch-x86/silvermont/string/sse4-wmemcmp-slm.S",
1183 ],
1184 exclude_srcs: [
1185 "arch-x86/generic/string/memcmp.S",
1186 ],
1187 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001188 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001189 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001190 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001191 "arch-x86_64/string/sse2-memcpy-slm.S",
1192 "arch-x86_64/string/sse2-memmove-slm.S",
1193 "arch-x86_64/string/sse2-memset-slm.S",
1194 "arch-x86_64/string/sse2-stpcpy-slm.S",
1195 "arch-x86_64/string/sse2-stpncpy-slm.S",
1196 "arch-x86_64/string/sse2-strcat-slm.S",
1197 "arch-x86_64/string/sse2-strcpy-slm.S",
1198 "arch-x86_64/string/sse2-strlcat-slm.S",
1199 "arch-x86_64/string/sse2-strlcpy-slm.S",
1200 "arch-x86_64/string/sse2-strlen-slm.S",
1201 "arch-x86_64/string/sse2-strncat-slm.S",
1202 "arch-x86_64/string/sse2-strncpy-slm.S",
1203 "arch-x86_64/string/sse4-memcmp-slm.S",
1204 "arch-x86_64/string/ssse3-strcmp-slm.S",
1205 "arch-x86_64/string/ssse3-strncmp-slm.S",
Dan Willemsen3e621712016-02-03 21:48:08 -08001206
1207 "arch-x86_64/bionic/__bionic_clone.S",
1208 "arch-x86_64/bionic/_exit_with_stack_teardown.S",
1209 "arch-x86_64/bionic/__restore_rt.S",
1210 "arch-x86_64/bionic/setjmp.S",
1211 "arch-x86_64/bionic/syscall.S",
1212 "arch-x86_64/bionic/vfork.S",
Dan Willemsen208ae172015-09-16 16:33:27 -07001213 ],
1214 },
Dan Willemsen268a6732015-10-15 14:49:45 -07001215 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001216
Colin Cross50c21ab2015-10-31 23:03:05 -07001217 cppflags: ["-Wold-style-cast"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001218 include_dirs: ["bionic/libstdc++/include"],
1219 name: "libc_bionic",
Dan Willemsen268a6732015-10-15 14:49:45 -07001220}
1221
1222// ========================================================
1223// libc_bionic_ndk.a- The portions of libc_bionic that can
1224// be safely used in libc_ndk.a (no troublesome global data
1225// or constructors).
1226// ========================================================
1227cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001228 defaults: ["libc_defaults"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001229 srcs: [
1230 "bionic/abort.cpp",
1231 "bionic/accept.cpp",
1232 "bionic/accept4.cpp",
1233 "bionic/access.cpp",
1234 "bionic/arpa_inet.cpp",
1235 "bionic/assert.cpp",
1236 "bionic/atof.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001237 "bionic/bionic_netlink.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001238 "bionic/bionic_systrace.cpp",
1239 "bionic/bionic_time_conversions.cpp",
1240 "bionic/brk.cpp",
1241 "bionic/c16rtomb.cpp",
1242 "bionic/c32rtomb.cpp",
1243 "bionic/chmod.cpp",
1244 "bionic/chown.cpp",
1245 "bionic/clearenv.cpp",
1246 "bionic/clock.cpp",
1247 "bionic/clock_getcpuclockid.cpp",
1248 "bionic/clock_nanosleep.cpp",
1249 "bionic/clone.cpp",
1250 "bionic/close.cpp",
1251 "bionic/__cmsg_nxthdr.cpp",
1252 "bionic/connect.cpp",
1253 "bionic/ctype.cpp",
1254 "bionic/dirent.cpp",
1255 "bionic/dup2.cpp",
1256 "bionic/epoll_create.cpp",
1257 "bionic/epoll_pwait.cpp",
1258 "bionic/epoll_wait.cpp",
1259 "bionic/__errno.cpp",
1260 "bionic/error.cpp",
1261 "bionic/eventfd_read.cpp",
1262 "bionic/eventfd_write.cpp",
1263 "bionic/faccessat.cpp",
1264 "bionic/fchmod.cpp",
1265 "bionic/fchmodat.cpp",
1266 "bionic/ffs.cpp",
1267 "bionic/fgetxattr.cpp",
1268 "bionic/flistxattr.cpp",
1269 "bionic/flockfile.cpp",
Dan Willemsen879cec22016-02-29 10:37:56 -08001270 "bionic/fortify.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001271 "bionic/fpclassify.cpp",
1272 "bionic/fsetxattr.cpp",
1273 "bionic/ftruncate.cpp",
Elliott Hughes13d79ab2016-04-15 17:40:33 -07001274 "bionic/ftw.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001275 "bionic/futimens.cpp",
1276 "bionic/getcwd.cpp",
Dan Willemsen23aae1c2016-03-29 15:21:38 -07001277 "bionic/getdomainname.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001278 "bionic/gethostname.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001279 "bionic/getpagesize.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001280 "bionic/getpgrp.cpp",
1281 "bionic/getpid.cpp",
1282 "bionic/gettid.cpp",
1283 "bionic/__gnu_basename.cpp",
Mark Salyzynb38347a2016-04-05 09:09:46 -07001284 "bionic/grp_pwd.cpp",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001285 "bionic/ifaddrs.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001286 "bionic/inotify_init.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001287 "bionic/ioctl.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001288 "bionic/lchown.cpp",
1289 "bionic/lfs64_support.cpp",
1290 "bionic/__libc_current_sigrtmax.cpp",
1291 "bionic/__libc_current_sigrtmin.cpp",
1292 "bionic/libc_init_common.cpp",
1293 "bionic/libc_logging.cpp",
1294 "bionic/libgen.cpp",
1295 "bionic/link.cpp",
1296 "bionic/locale.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001297 "bionic/lockf.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001298 "bionic/lstat.cpp",
1299 "bionic/malloc_info.cpp",
Colin Crossee847862016-04-29 14:06:07 -07001300 "bionic/mblen.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001301 "bionic/mbrtoc16.cpp",
1302 "bionic/mbrtoc32.cpp",
1303 "bionic/mbstate.cpp",
1304 "bionic/mempcpy.cpp",
1305 "bionic/mkdir.cpp",
1306 "bionic/mkfifo.cpp",
1307 "bionic/mknod.cpp",
1308 "bionic/mntent.cpp",
Dan Willemsendc6b0a72015-11-09 14:03:46 -08001309 "bionic/mremap.cpp",
Elliott Hughese4510a22016-04-06 08:34:58 -07001310 "bionic/netdb.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001311 "bionic/NetdClientDispatch.cpp",
Colin Cross8ce38af2016-01-19 12:50:20 -08001312 "bionic/net_if.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001313 "bionic/netinet_in.cpp",
Elliott Hughes6cfb84b2016-04-06 17:14:45 -07001314 "bionic/nl_types.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001315 "bionic/open.cpp",
1316 "bionic/pathconf.cpp",
1317 "bionic/pause.cpp",
1318 "bionic/pipe.cpp",
1319 "bionic/poll.cpp",
1320 "bionic/posix_fadvise.cpp",
1321 "bionic/posix_fallocate.cpp",
1322 "bionic/posix_madvise.cpp",
1323 "bionic/posix_timers.cpp",
1324 "bionic/ptrace.cpp",
1325 "bionic/pty.cpp",
1326 "bionic/raise.cpp",
1327 "bionic/rand.cpp",
1328 "bionic/readlink.cpp",
1329 "bionic/reboot.cpp",
1330 "bionic/recv.cpp",
1331 "bionic/rename.cpp",
1332 "bionic/rmdir.cpp",
1333 "bionic/scandir.cpp",
1334 "bionic/sched_getaffinity.cpp",
1335 "bionic/sched_getcpu.cpp",
1336 "bionic/semaphore.cpp",
1337 "bionic/send.cpp",
1338 "bionic/setegid.cpp",
1339 "bionic/__set_errno.cpp",
1340 "bionic/seteuid.cpp",
1341 "bionic/setpgrp.cpp",
1342 "bionic/sigaction.cpp",
1343 "bionic/sigaddset.cpp",
1344 "bionic/sigdelset.cpp",
1345 "bionic/sigemptyset.cpp",
1346 "bionic/sigfillset.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001347 "bionic/sighold.cpp",
1348 "bionic/sigignore.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001349 "bionic/sigismember.cpp",
1350 "bionic/signal.cpp",
1351 "bionic/signalfd.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001352 "bionic/sigpause.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001353 "bionic/sigpending.cpp",
1354 "bionic/sigprocmask.cpp",
1355 "bionic/sigqueue.cpp",
Colin Crossb8396102016-04-07 13:24:50 -07001356 "bionic/sigrelse.cpp",
1357 "bionic/sigset.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001358 "bionic/sigsuspend.cpp",
1359 "bionic/sigtimedwait.cpp",
1360 "bionic/sigwait.cpp",
1361 "bionic/sigwaitinfo.cpp",
1362 "bionic/socket.cpp",
1363 "bionic/stat.cpp",
1364 "bionic/statvfs.cpp",
1365 "bionic/strchrnul.cpp",
1366 "bionic/strerror.cpp",
1367 "bionic/strerror_r.cpp",
1368 "bionic/strsignal.cpp",
1369 "bionic/strtold.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001370 "bionic/symlink.cpp",
Colin Crossfc8ed2f2016-04-11 14:51:38 -07001371 "bionic/sync_file_range.cpp",
Dan Willemsen268a6732015-10-15 14:49:45 -07001372 "bionic/sysinfo.cpp",
1373 "bionic/syslog.cpp",
1374 "bionic/sys_siglist.c",
1375 "bionic/sys_signame.c",
1376 "bionic/system_properties.cpp",
1377 "bionic/tdestroy.cpp",
1378 "bionic/termios.cpp",
1379 "bionic/thread_private.cpp",
1380 "bionic/tmpfile.cpp",
1381 "bionic/umount.cpp",
1382 "bionic/unlink.cpp",
1383 "bionic/utimes.cpp",
1384 "bionic/wait.cpp",
1385 "bionic/wchar.cpp",
1386 "bionic/wctype.cpp",
1387 "bionic/wmempcpy.cpp",
1388 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001389 cflags: ["-Wframe-larger-than=2048"],
Dan Willemsen268a6732015-10-15 14:49:45 -07001390
Dan Willemsen208ae172015-09-16 16:33:27 -07001391 multilib: {
1392 lib32: {
1393 // LP32 cruft
Colin Cross6ab8f892015-11-23 14:12:15 -08001394 srcs: ["bionic/mmap.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001395 },
1396 },
1397
Colin Cross50c21ab2015-10-31 23:03:05 -07001398 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001399 local_include_dirs: ["stdio"],
1400 include_dirs: ["bionic/libstdc++/include"],
1401 name: "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001402}
1403
Dan Willemsen208ae172015-09-16 16:33:27 -07001404// ========================================================
1405// libc_pthread.a - pthreads parts that previously lived in
1406// libc_bionic.a. Relocated to their own library because
1407// they can't be included in libc_ndk.a (as they layout of
1408// pthread_t has changed over the years and has ABI
1409// compatibility issues).
1410// ========================================================
1411
1412cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001413 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001414 srcs: [
1415 "bionic/pthread_atfork.cpp",
1416 "bionic/pthread_attr.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001417 "bionic/pthread_barrier.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001418 "bionic/pthread_cond.cpp",
1419 "bionic/pthread_create.cpp",
1420 "bionic/pthread_detach.cpp",
1421 "bionic/pthread_equal.cpp",
1422 "bionic/pthread_exit.cpp",
1423 "bionic/pthread_getcpuclockid.cpp",
1424 "bionic/pthread_getschedparam.cpp",
1425 "bionic/pthread_gettid_np.cpp",
1426 "bionic/pthread_internal.cpp",
1427 "bionic/pthread_join.cpp",
1428 "bionic/pthread_key.cpp",
1429 "bionic/pthread_kill.cpp",
1430 "bionic/pthread_mutex.cpp",
1431 "bionic/pthread_once.cpp",
1432 "bionic/pthread_rwlock.cpp",
1433 "bionic/pthread_self.cpp",
1434 "bionic/pthread_setname_np.cpp",
1435 "bionic/pthread_setschedparam.cpp",
1436 "bionic/pthread_sigmask.cpp",
Colin Crossa35d23d2015-11-19 13:32:49 -08001437 "bionic/pthread_spinlock.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001438 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001439 cflags: ["-Wframe-larger-than=2048"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001440
Colin Cross50c21ab2015-10-31 23:03:05 -07001441 cppflags: ["-Wold-style-cast"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001442 include_dirs: ["bionic/libstdc++/include"],
1443 name: "libc_pthread",
Dan Willemsen208ae172015-09-16 16:33:27 -07001444}
1445
1446// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001447// libc_syscalls.a
1448// ========================================================
1449
1450cc_library_static {
Colin Cross27c43c52016-04-07 13:27:24 -07001451 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001452 arch: {
1453 arm: {
1454 srcs: ["arch-arm/syscalls/**/*.S"],
1455 },
1456 arm64: {
1457 srcs: ["arch-arm64/syscalls/**/*.S"],
1458 },
1459 mips: {
1460 srcs: ["arch-mips/syscalls/**/*.S"],
1461 },
1462 mips64: {
1463 srcs: ["arch-mips64/syscalls/**/*.S"],
1464 },
1465 x86: {
1466 srcs: ["arch-x86/syscalls/**/*.S"],
1467 },
1468 x86_64: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001469 srcs: ["arch-x86_64/syscalls/**/*.S"],
1470 },
1471 },
1472 name: "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001473}
1474
1475// ========================================================
1476// libc_aeabi.a
1477// This is an LP32 ARM-only library that needs to be built with -fno-builtin
1478// to avoid infinite recursion. For the other architectures we just build an
1479// empty library to keep this makefile simple.
1480// ========================================================
1481
1482cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001483 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001484 arch: {
1485 arm: {
1486 srcs: ["arch-arm/bionic/__aeabi.c"],
1487 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001488 },
1489 name: "libc_aeabi",
Colin Cross50c21ab2015-10-31 23:03:05 -07001490 cflags: ["-fno-builtin"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001491}
1492
1493// ========================================================
1494// libc_ndk.a
1495// Compatibility library for the NDK. This library contains
1496// all the parts of libc that are safe to statically link.
1497// We can't safely statically link things that can only run
1498// on a certain version of the OS. Examples include
1499// anything that talks to netd (a large portion of the DNS
1500// code) and anything that is dependent on the layout of a
1501// data structure that has changed across releases (such as
1502// pthread_t).
1503// ========================================================
1504
1505cc_library_static {
1506 name: "libc_ndk",
Colin Cross50c21ab2015-10-31 23:03:05 -07001507 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001508 srcs: libc_common_src_files + ["bionic/malloc_common.cpp"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001509 multilib: {
1510 lib32: {
1511 srcs: libc_common_src_files_32,
1512 },
1513 },
1514 arch: {
1515 arm: {
1516 srcs: [
1517 "arch-arm/bionic/exidx_dynamic.c",
1518 "arch-common/bionic/crtbegin_so.c",
1519 "arch-arm/bionic/atexit_legacy.c",
1520 "arch-common/bionic/crtend_so.S",
1521 ],
1522 whole_static_libs: ["libc_aeabi"],
1523 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001524 },
1525
Colin Cross50c21ab2015-10-31 23:03:05 -07001526 cflags: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001527 "-fvisibility=hidden",
1528 "-DLIBC_STATIC",
1529 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001530
1531 whole_static_libs: [
1532 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001533 "libc_freebsd",
1534 "libc_gdtoa",
1535 "libc_malloc",
1536 "libc_netbsd",
1537 "libc_openbsd_ndk",
1538 "libc_stack_protector",
1539 "libc_syscalls",
1540 "libc_tzcode",
1541 "libm",
Dan Willemsen3e621712016-02-03 21:48:08 -08001542 "libjemalloc",
Elliott Hughes816fab92016-05-27 17:57:46 -07001543 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001544 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001545}
1546
1547// ========================================================
1548// libc_common.a
1549// ========================================================
1550
1551cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001552 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001553 srcs: libc_common_src_files,
1554 multilib: {
1555 lib32: {
1556 srcs: libc_common_src_files_32,
1557 },
1558 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001559 name: "libc_common",
1560
1561 whole_static_libs: [
1562 "libc_bionic",
1563 "libc_bionic_ndk",
Dan Willemsen208ae172015-09-16 16:33:27 -07001564 "libc_dns",
1565 "libc_freebsd",
1566 "libc_gdtoa",
1567 "libc_malloc",
1568 "libc_netbsd",
1569 "libc_openbsd",
1570 "libc_openbsd_ndk",
1571 "libc_pthread",
1572 "libc_stack_protector",
1573 "libc_syscalls",
Dan Willemsen208ae172015-09-16 16:33:27 -07001574 "libc_tzcode",
Elliott Hughes816fab92016-05-27 17:57:46 -07001575 "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001576 ],
1577
1578 arch: {
1579 arm: {
1580 whole_static_libs: ["libc_aeabi"],
1581 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001582 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001583}
1584
1585// ========================================================
1586// libc_nomalloc.a
1587// ========================================================
1588//
1589// This is a version of the static C library that does not
1590// include malloc. It's useful in situations when the user wants
1591// to provide their own malloc implementation, or wants to
1592// explicitly disallow the use of malloc, such as in the
1593// dynamic linker.
1594
1595cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001596 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001597 srcs: [
1598 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001599 ],
1600
1601 arch: {
1602 arm: {
1603 srcs: ["arch-arm/bionic/exidx_static.c"],
1604 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001605 },
1606
Colin Cross50c21ab2015-10-31 23:03:05 -07001607 cflags: ["-DLIBC_STATIC"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001608
1609 name: "libc_nomalloc",
1610
Colin Crossa3f9fca2016-01-11 13:20:55 -08001611 whole_static_libs: [
1612 "libc_common",
1613 "libc_init_static",
1614 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001615}
1616
1617// ========================================================
1618// libc_malloc.a: the _prefixed_ malloc functions (like dlcalloc).
1619// ========================================================
1620cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001621 defaults: ["libc_defaults"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001622 srcs: ["bionic/jemalloc_wrapper.cpp"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001623 cflags: ["-fvisibility=hidden"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001624
Dan Willemsen208ae172015-09-16 16:33:27 -07001625 name: "libc_malloc",
Dan Willemsen208ae172015-09-16 16:33:27 -07001626}
1627
1628// ========================================================
1629// libc.a + libc.so
1630// ========================================================
1631cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001632 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001633 name: "libc",
Colin Cross50c21ab2015-10-31 23:03:05 -07001634 product_variables: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001635 platform_sdk_version: {
1636 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1637 },
1638 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001639 static: {
1640 srcs: [
1641 "bionic/dl_iterate_phdr_static.cpp",
Dan Willemsen0c657082016-05-12 01:43:07 -07001642 "bionic/malloc_common.cpp",
Dan Willemsen3e621712016-02-03 21:48:08 -08001643 "bionic/libc_init_static.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001644 ],
1645 cflags: ["-DLIBC_STATIC"],
Dan Willemsen0c657082016-05-12 01:43:07 -07001646 whole_static_libs: ["libc_init_static", "libjemalloc"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001647 },
1648 shared: {
1649 srcs: [
1650 "arch-common/bionic/crtbegin_so.c",
1651 "arch-common/bionic/crtbrand.S",
Dan Willemsen0c657082016-05-12 01:43:07 -07001652 "bionic/malloc_common.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001653 "bionic/libc_init_dynamic.cpp",
1654 "bionic/NetdClient.cpp",
1655 "arch-common/bionic/crtend_so.S",
1656 ],
Dan Willemsen0c657082016-05-12 01:43:07 -07001657 whole_static_libs: ["libjemalloc"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001658 },
1659
1660 required: ["tzdata"],
1661
1662 // Leave the symbols in the shared library so that stack unwinders can produce
1663 // meaningful name resolution.
Colin Cross37f36322016-04-25 14:09:13 -07001664 strip: {
1665 keep_symbols: true,
1666 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001667
1668 // WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
1669 // make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
1670 // ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
1671 // external; if that were the case, then libc would not pull those symbols from libgcc.a as it
1672 // should, instead relying on the external symbols from the dependent libraries. That would
1673 // create a "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
1674 // you wanted!
1675
1676 shared_libs: ["libdl"],
Dan Willemsen0c657082016-05-12 01:43:07 -07001677 whole_static_libs: ["libc_common"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001678
1679 nocrt: true,
1680
Dan Willemsen208ae172015-09-16 16:33:27 -07001681 arch: {
1682 arm: {
Dmitriy Ivanov280d5462015-09-28 10:14:17 -07001683 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001684 ldflags: ["-Wl,--hash-style=both"],
1685
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001686 // Don't re-export new/delete and friends, even if the compiler really wants to.
1687 version_script: "libc.arm.map",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001688 product_variables: {
1689 brillo: {
1690 version_script: "libc.arm.brillo.map",
1691 },
1692 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001693
Dan Willemsen208ae172015-09-16 16:33:27 -07001694 shared: {
Dan Willemsen0c657082016-05-12 01:43:07 -07001695 srcs: [
1696 "arch-arm/bionic/exidx_dynamic.c",
1697
1698 // special for arm
1699 "arch-arm/bionic/atexit_legacy.c",
1700 ],
1701 // special for arm
1702 cflags: ["-DCRT_LEGACY_WORKAROUND"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001703 },
1704 static: {
1705 srcs: ["arch-arm/bionic/exidx_static.c"],
1706 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001707 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001708 arm64: {
1709 // Don't re-export new/delete and friends, even if the compiler really wants to.
1710 version_script: "libc.arm64.map",
1711 },
1712 mips: {
1713 // Don't re-export new/delete and friends, even if the compiler really wants to.
1714 version_script: "libc.mips.map",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001715 product_variables: {
1716 brillo: {
1717 version_script: "libc.mips.brillo.map",
1718 },
1719 },
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001720 },
1721 mips64: {
1722 // Don't re-export new/delete and friends, even if the compiler really wants to.
1723 version_script: "libc.mips64.map",
1724 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001725 x86: {
Dmitriy Ivanov280d5462015-09-28 10:14:17 -07001726 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001727 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001728
1729 // Don't re-export new/delete and friends, even if the compiler really wants to.
1730 version_script: "libc.x86.map",
Dan Willemsen9b59acc2016-01-05 14:32:06 -08001731 product_variables: {
1732 brillo: {
1733 version_script: "libc.x86.brillo.map",
1734 },
1735 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001736 },
1737 x86_64: {
Dan Willemsen9e6f98f2015-11-03 14:30:57 -08001738 // Don't re-export new/delete and friends, even if the compiler really wants to.
1739 version_script: "libc.x86_64.map",
Dan Willemsen208ae172015-09-16 16:33:27 -07001740 },
1741 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001742}
1743
Dan Willemsen208ae172015-09-16 16:33:27 -07001744// ========================================================
Dan Willemsen3e621712016-02-03 21:48:08 -08001745// libc_logging.a
Dan Willemsen208ae172015-09-16 16:33:27 -07001746// ========================================================
Dan Willemsen3e621712016-02-03 21:48:08 -08001747cc_library_static {
Colin Cross50c21ab2015-10-31 23:03:05 -07001748 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001749
1750 srcs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001751 "bionic/libc_logging.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001752 ],
1753
Dan Willemsen3e621712016-02-03 21:48:08 -08001754 name: "libc_logging",
Dan Willemsen208ae172015-09-16 16:33:27 -07001755}
1756
1757// ========================================================
Dan Willemsen208ae172015-09-16 16:33:27 -07001758// libstdc++.so + libstdc++.a
1759// ========================================================
1760cc_library {
Colin Cross50c21ab2015-10-31 23:03:05 -07001761 defaults: ["libc_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001762 include_dirs: ["bionic/libstdc++/include"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001763 srcs: [
1764 "bionic/__cxa_guard.cpp",
1765 "bionic/__cxa_pure_virtual.cpp",
1766 "bionic/new.cpp",
Dan Willemsen208ae172015-09-16 16:33:27 -07001767 ],
1768 name: "libstdc++",
Dan Willemsen208ae172015-09-16 16:33:27 -07001769 system_shared_libs: ["libc"],
Dan Willemsen3e621712016-02-03 21:48:08 -08001770 shared: {
1771 static_libs: ["libc_logging"],
1772 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001773
Dmitriy Ivanov280d5462015-09-28 10:14:17 -07001774 //TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen208ae172015-09-16 16:33:27 -07001775 arch: {
1776 arm: {
1777 ldflags: ["-Wl,--hash-style=both"],
1778 },
1779 x86: {
1780 ldflags: ["-Wl,--hash-style=both"],
1781 },
1782 },
1783}
1784
Colin Cross50c21ab2015-10-31 23:03:05 -07001785cc_defaults {
1786 name: "crt_defaults",
1787
1788 no_default_compiler_flags: true,
1789
1790 arch: {
1791 arm: {
1792 local_include_dirs: ["arch-arm/include"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001793 },
1794 arm64: {
1795 local_include_dirs: ["arch-arm64/include"],
1796 },
1797 mips: {
1798 local_include_dirs: ["arch-mips/include"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001799 },
1800 mips64: {
1801 local_include_dirs: ["arch-mips64/include"],
Colin Cross50c21ab2015-10-31 23:03:05 -07001802 },
1803 x86: {
Colin Cross50c21ab2015-10-31 23:03:05 -07001804 local_include_dirs: ["arch-x86/include"],
1805 },
1806 x86_64: {
Colin Cross50c21ab2015-10-31 23:03:05 -07001807 local_include_dirs: ["arch-x86_64/include"],
1808 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001809 },
Colin Crossbff87d12015-11-23 14:12:19 -08001810 clang: false,
Dan Willemsen208ae172015-09-16 16:33:27 -07001811}
1812
Colin Cross50c21ab2015-10-31 23:03:05 -07001813cc_defaults {
1814 name: "crt_so_defaults",
1815
1816 arch: {
1817 mips: {
1818 cflags: ["-fPIC"],
1819 },
1820 mips64: {
1821 cflags: ["-fPIC"],
1822 },
1823 x86: {
1824 cflags: ["-fPIC"],
1825 },
1826 x86_64: {
1827 cflags: ["-fPIC"],
1828 },
Dan Willemsen208ae172015-09-16 16:33:27 -07001829 },
1830}
1831
1832// Android.mk:start
1833// # crt obj files
1834// # ========================================================
1835// # crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
1836// libc_crt_target_cflags := \
1837// -I$(LOCAL_PATH)/include \
1838// -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
1839//
1840// my_2nd_arch_prefix :=
1841// include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
1842// include $(LOCAL_PATH)/crt.mk
1843// ifdef TARGET_2ND_ARCH
1844// my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
1845// include $(LOCAL_PATH)/arch-$(TARGET_2ND_ARCH)/$(TARGET_2ND_ARCH).mk
1846// include $(LOCAL_PATH)/crt.mk
1847// my_2nd_arch_prefix :=
1848// endif
1849//
1850// include $(call all-makefiles-under,$(LOCAL_PATH))
1851// Android.mk:end
1852cc_object {
1853 name: "crtbrand",
1854 local_include_dirs: ["include"],
1855 product_variables: {
1856 platform_sdk_version: {
1857 asflags: ["-DPLATFORM_SDK_VERSION=%d"],
1858 },
1859 },
1860 srcs: ["arch-common/bionic/crtbrand.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001861
Colin Cross6ab8f892015-11-23 14:12:15 -08001862 defaults: [
1863 "crt_defaults",
1864 "crt_so_defaults",
1865 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001866}
1867
1868// Android.mk:ignore
1869cc_object {
1870 name: "crtbegin_so1",
1871 local_include_dirs: ["include"],
1872 srcs: ["arch-common/bionic/crtbegin_so.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001873
Colin Cross6ab8f892015-11-23 14:12:15 -08001874 defaults: [
1875 "crt_defaults",
1876 "crt_so_defaults",
1877 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001878}
1879
1880// Android.mk:ignore
1881cc_object {
1882 name: "crtbegin_so",
Dan Willemsen208ae172015-09-16 16:33:27 -07001883
Colin Cross6ab8f892015-11-23 14:12:15 -08001884 defaults: [
1885 "crt_defaults",
1886 "crt_so_defaults",
1887 ],
Colin Cross77d57bf2016-04-11 14:34:18 -07001888 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001889 "crtbegin_so1",
1890 "crtbrand",
1891 ],
1892}
1893
1894// Android.mk:ignore
1895cc_object {
1896 name: "crtend_so",
1897 local_include_dirs: ["include"],
1898 srcs: ["arch-common/bionic/crtend_so.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001899
Colin Cross6ab8f892015-11-23 14:12:15 -08001900 defaults: [
1901 "crt_defaults",
1902 "crt_so_defaults",
1903 ],
Dan Willemsen208ae172015-09-16 16:33:27 -07001904}
1905
1906// Android.mk:ignore
1907cc_object {
1908 name: "crtbegin_static1",
1909 local_include_dirs: ["include"],
1910 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001911
Colin Cross50c21ab2015-10-31 23:03:05 -07001912 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001913 arm64: {
1914 srcs: [
1915 "arch-arm64/bionic/crtbegin.c",
1916 ],
1917 exclude_srcs: [
1918 "arch-common/bionic/crtbegin.c",
1919 ],
1920 },
1921 mips: {
1922 srcs: [
1923 "arch-mips/bionic/crtbegin.c",
1924 ],
1925 exclude_srcs: [
1926 "arch-common/bionic/crtbegin.c",
1927 ],
1928 },
1929 mips64: {
1930 srcs: [
1931 "arch-mips64/bionic/crtbegin.c",
1932 ],
1933 exclude_srcs: [
1934 "arch-common/bionic/crtbegin.c",
1935 ],
1936 },
1937 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001938
1939 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001940}
1941
1942// Android.mk:ignore
1943cc_object {
1944 name: "crtbegin_static",
Dan Willemsen208ae172015-09-16 16:33:27 -07001945
Colin Cross77d57bf2016-04-11 14:34:18 -07001946 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001947 "crtbegin_static1",
1948 "crtbrand",
1949 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001950 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001951}
1952
1953// Android.mk:ignore
1954cc_object {
1955 name: "crtbegin_dynamic1",
1956 local_include_dirs: ["include"],
1957 srcs: ["arch-common/bionic/crtbegin.c"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001958
Colin Cross50c21ab2015-10-31 23:03:05 -07001959 arch: {
Dan Willemsen208ae172015-09-16 16:33:27 -07001960 arm64: {
1961 srcs: [
1962 "arch-arm64/bionic/crtbegin.c",
1963 ],
1964 exclude_srcs: [
1965 "arch-common/bionic/crtbegin.c",
1966 ],
1967 },
1968 mips: {
1969 srcs: [
1970 "arch-mips/bionic/crtbegin.c",
1971 ],
1972 exclude_srcs: [
1973 "arch-common/bionic/crtbegin.c",
1974 ],
1975 },
1976 mips64: {
1977 srcs: [
1978 "arch-mips64/bionic/crtbegin.c",
1979 ],
1980 exclude_srcs: [
1981 "arch-common/bionic/crtbegin.c",
1982 ],
1983 },
1984 },
Colin Cross50c21ab2015-10-31 23:03:05 -07001985 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001986}
1987
1988// Android.mk:ignore
1989cc_object {
1990 name: "crtbegin_dynamic",
Dan Willemsen208ae172015-09-16 16:33:27 -07001991
Colin Cross77d57bf2016-04-11 14:34:18 -07001992 objs: [
Dan Willemsen208ae172015-09-16 16:33:27 -07001993 "crtbegin_dynamic1",
1994 "crtbrand",
1995 ],
Colin Cross50c21ab2015-10-31 23:03:05 -07001996 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07001997}
1998
1999// Android.mk:ignore
2000cc_object {
2001 // We rename crtend.o to crtend_android.o to avoid a
2002 // name clash between gcc and bionic.
2003 name: "crtend_android",
2004 local_include_dirs: ["include"],
2005 srcs: ["arch-common/bionic/crtend.S"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002006
Colin Cross50c21ab2015-10-31 23:03:05 -07002007 defaults: ["crt_defaults"],
Dan Willemsen208ae172015-09-16 16:33:27 -07002008}