blob: 7fec14fcab9cb5d35a5483884c6b6fe97f83bdf6 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001LOCAL_PATH:= $(call my-dir)
2
3include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk
Dima Zavinca122b02009-05-27 10:52:37 -07004
Christopher Ferrisd7a63292013-10-03 13:26:22 -07005# Make everything depend on any changes to included makefiles.
6libc_common_additional_dependencies := \
7 $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk \
8 $(LOCAL_PATH)/Android.mk \
9
Dima Zavinca122b02009-05-27 10:52:37 -070010# Define the common source files for all the libc instances
11# =========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080012libc_common_src_files := \
13 $(syscall_src) \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080014 unistd/alarm.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015 unistd/exec.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080016 unistd/fnmatch.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 unistd/syslog.c \
18 unistd/system.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080019 unistd/time.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080020 stdio/asprintf.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021 stdio/fflush.c \
22 stdio/fgetc.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080023 stdio/findfp.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024 stdio/fprintf.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080025 stdio/fputc.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080026 stdio/fread.c \
27 stdio/freopen.c \
28 stdio/fscanf.c \
29 stdio/fseek.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080030 stdio/ftell.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031 stdio/fvwrite.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080032 stdio/gets.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080033 stdio/printf.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034 stdio/refill.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035 stdio/rewind.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036 stdio/scanf.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037 stdio/snprintf.c\
38 stdio/sprintf.c \
39 stdio/sscanf.c \
40 stdio/stdio.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041 stdio/ungetc.c \
42 stdio/vasprintf.c \
43 stdio/vfprintf.c \
44 stdio/vfscanf.c \
45 stdio/vprintf.c \
46 stdio/vsnprintf.c \
47 stdio/vsprintf.c \
48 stdio/vscanf.c \
49 stdio/vsscanf.c \
50 stdio/wbuf.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080051 stdlib/atexit.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080052 stdlib/ctype_.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080053 stdlib/exit.c \
54 stdlib/getenv.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080055 stdlib/putenv.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080056 stdlib/setenv.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080057 stdlib/strtod.c \
58 stdlib/strtoimax.c \
59 stdlib/strtol.c \
60 stdlib/strtoll.c \
61 stdlib/strtoul.c \
62 stdlib/strtoull.c \
63 stdlib/strtoumax.c \
64 stdlib/tolower_.c \
65 stdlib/toupper_.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080066 string/strcasecmp.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080067 string/strcspn.c \
68 string/strdup.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080069 string/strpbrk.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080070 string/strsep.c \
71 string/strspn.c \
72 string/strstr.c \
73 string/strtok.c \
David 'Digit' Turner3527fd62010-06-14 17:18:35 -070074 wchar/wcswidth.c \
Kristian Monsen70465612010-06-16 14:51:52 +010075 wchar/wcsxfrm.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080076 bionic/arc4random.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070077 bionic/atoi.c \
78 bionic/atol.c \
79 bionic/atoll.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070080 bionic/bindresvport.c \
81 bionic/bionic_clone.c \
Colin Crossfc10b242010-01-13 17:48:34 -080082 bionic/clearenv.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070083 bionic/cpuacct.c \
84 bionic/daemon.c \
Colin Cross64ceac32010-01-13 21:19:52 -080085 bionic/err.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070086 bionic/ether_aton.c \
87 bionic/ether_ntoa.c \
Colin Crossfc10b242010-01-13 17:48:34 -080088 bionic/fdprintf.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070089 bionic/flockfile.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080090 bionic/fork.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070091 bionic/ftime.c \
92 bionic/ftok.c \
Colin Cross64ceac32010-01-13 21:19:52 -080093 bionic/fts.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -070094 bionic/getdtablesize.c \
95 bionic/gethostname.c \
96 bionic/getpgrp.c \
97 bionic/getpriority.c \
98 bionic/getpt.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080099 bionic/if_indextoname.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700100 bionic/if_nametoindex.c \
101 bionic/initgroups.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800102 bionic/ioctl.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700103 bionic/isatty.c \
104 bionic/issetugid.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800105 bionic/ldexp.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700106 bionic/lseek64.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800107 bionic/md5.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700108 bionic/memmem.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700109 bionic/memswap.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700110 bionic/openat.c \
111 bionic/open.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700112 bionic/pathconf.c \
113 bionic/perror.c \
114 bionic/pread.c \
115 bionic/pselect.c \
116 bionic/ptsname.c \
117 bionic/ptsname_r.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800118 bionic/pututline.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700119 bionic/pwrite.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700120 bionic/reboot.c \
121 bionic/recv.c \
David 'Digit' Turner72e6fd42010-12-03 18:04:01 +0100122 bionic/sched_cpualloc.c \
123 bionic/sched_cpucount.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700124 bionic/sched_getcpu.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800125 bionic/semaphore.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700126 bionic/send.c \
127 bionic/setegid.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700128 bionic/seteuid.c \
129 bionic/setpgrp.c \
130 bionic/setresuid.c \
131 bionic/setreuid.c \
132 bionic/setuid.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700133 bionic/sigblock.c \
134 bionic/siginterrupt.c \
135 bionic/siglist.c \
136 bionic/signal.c \
137 bionic/signame.c \
138 bionic/sigsetmask.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700139 bionic/sleep.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700140 bionic/strndup.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700141 bionic/strntoimax.c \
142 bionic/strntoumax.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700143 bionic/strtotimeval.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800144 bionic/system_properties.c \
Colin Cross5e9a0862013-06-24 18:36:39 -0700145 bionic/system_properties_compat.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700146 bionic/tcgetpgrp.c \
147 bionic/tcsetpgrp.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800148 bionic/thread_atexit.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700149 bionic/time64.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700150 bionic/umount.c \
151 bionic/unlockpt.c \
152 bionic/usleep.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800153 bionic/utmp.c \
Elliott Hughesa89864a2012-10-01 17:35:49 -0700154 bionic/wcscoll.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800155 netbsd/gethnamaddr.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800156 netbsd/inet/nsap_addr.c \
157 netbsd/resolv/__dn_comp.c \
158 netbsd/resolv/__res_close.c \
159 netbsd/resolv/__res_send.c \
160 netbsd/resolv/herror.c \
161 netbsd/resolv/res_comp.c \
162 netbsd/resolv/res_data.c \
163 netbsd/resolv/res_debug.c \
164 netbsd/resolv/res_init.c \
165 netbsd/resolv/res_mkquery.c \
166 netbsd/resolv/res_query.c \
167 netbsd/resolv/res_send.c \
Shin-ichiro KAWASAKI10093272009-09-28 16:11:39 +0900168 netbsd/resolv/res_state.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800169 netbsd/resolv/res_cache.c \
170 netbsd/net/nsdispatch.c \
171 netbsd/net/getaddrinfo.c \
172 netbsd/net/getnameinfo.c \
173 netbsd/net/getservbyname.c \
174 netbsd/net/getservent.c \
175 netbsd/net/base64.c \
176 netbsd/net/getservbyport.c \
177 netbsd/nameser/ns_name.c \
178 netbsd/nameser/ns_parse.c \
179 netbsd/nameser/ns_ttl.c \
180 netbsd/nameser/ns_netint.c \
181 netbsd/nameser/ns_print.c \
Colin Cross4fa7b102010-01-12 18:59:25 -0800182 netbsd/nameser/ns_samedomain.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800183
Pavel Chupina567a8e2012-12-18 17:30:02 +0400184# These are shared by all the 32-bit targets, but not the 64-bit ones.
185ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
186libc_common_src_files += \
187 bionic/fcntl.c \
188 bionic/fstatfs.c \
189 bionic/sigsuspend.c \
190 bionic/statfs.c \
191
192endif
193
Christopher Ferris59a13c12013-08-01 13:13:33 -0700194# Fortify implementations of libc functions.
195libc_common_src_files += \
Nick Kralevich90201d52013-10-02 16:11:30 -0700196 bionic/__FD_chk.cpp \
Christopher Ferris59a13c12013-08-01 13:13:33 -0700197 bionic/__fgets_chk.cpp \
198 bionic/__memcpy_chk.cpp \
199 bionic/__memmove_chk.cpp \
200 bionic/__memset_chk.cpp \
Nick Kralevich60f4f9a2013-09-24 16:32:07 -0700201 bionic/__recvfrom_chk.cpp \
Christopher Ferris59a13c12013-08-01 13:13:33 -0700202 bionic/__strcat_chk.cpp \
203 bionic/__strchr_chk.cpp \
204 bionic/__strcpy_chk.cpp \
205 bionic/__strlcat_chk.cpp \
206 bionic/__strlcpy_chk.cpp \
207 bionic/__strlen_chk.cpp \
208 bionic/__strncat_chk.cpp \
209 bionic/__strncpy_chk.cpp \
210 bionic/__strrchr_chk.cpp \
211 bionic/__umask_chk.cpp \
212 bionic/__vsnprintf_chk.cpp \
213 bionic/__vsprintf_chk.cpp \
214
Elliott Hughes29c7f0b2012-10-22 17:05:27 -0700215libc_bionic_src_files := \
Elliott Hughes61e699a2013-06-12 14:05:46 -0700216 bionic/abort.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700217 bionic/assert.cpp \
Elliott Hughes428f5562013-02-05 16:10:59 -0800218 bionic/brk.cpp \
David 'Digit' Turnerc30396f2012-10-29 15:32:54 +0100219 bionic/dirent.cpp \
Elliott Hughes91a99252013-02-12 21:56:42 -0800220 bionic/__errno.c \
Kito Cheng9b848242013-04-03 11:29:40 +0800221 bionic/eventfd_read.cpp \
222 bionic/eventfd_write.cpp \
Elliott Hughesd0be7c82013-08-08 17:13:33 -0700223 bionic/futimens.cpp \
Nick Kralevich2c5153b2013-01-11 14:43:05 -0800224 bionic/getauxval.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700225 bionic/getcwd.cpp \
Elliott Hughes42b2c6a2013-02-07 10:14:39 -0800226 bionic/libc_init_common.cpp \
Elliott Hughes8f2a5a02013-03-15 15:30:25 -0700227 bionic/libc_logging.cpp \
Elliott Hughes58b57542012-10-29 14:27:10 -0700228 bionic/libgen.cpp \
Elliott Hughes3e898472013-02-12 16:40:24 +0000229 bionic/pthread_attr.cpp \
Elliott Hughes9d23e042013-02-15 19:21:51 -0800230 bionic/pthread_detach.cpp \
231 bionic/pthread_equal.cpp \
232 bionic/pthread_getcpuclockid.cpp \
233 bionic/pthread_getschedparam.cpp \
234 bionic/pthread_internals.cpp \
235 bionic/pthread_join.cpp \
236 bionic/pthread_kill.cpp \
237 bionic/pthread_self.cpp \
Elliott Hughes3e898472013-02-12 16:40:24 +0000238 bionic/pthread_setname_np.cpp \
Elliott Hughes9d23e042013-02-15 19:21:51 -0800239 bionic/pthread_setschedparam.cpp \
Elliott Hughesc5d028f2013-01-10 14:42:14 -0800240 bionic/pthread_sigmask.cpp \
Chris Dearmand8a5a6f2012-12-07 18:41:10 -0800241 bionic/raise.cpp \
Elliott Hughes428f5562013-02-05 16:10:59 -0800242 bionic/sbrk.cpp \
Elliott Hughes701bec22013-02-25 13:14:31 -0800243 bionic/scandir.cpp \
Kito Cheng4ca685e2013-04-10 00:57:42 +0800244 bionic/sched_getaffinity.cpp \
Elliott Hughes4a9e8372012-11-30 11:58:57 -0800245 bionic/__set_errno.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700246 bionic/setlocale.cpp \
Rom Lemarchanda4b2dc02013-01-09 15:46:06 -0800247 bionic/signalfd.cpp \
Elliott Hughesc5d028f2013-01-10 14:42:14 -0800248 bionic/sigwait.cpp \
Elliott Hughes06040fd2013-07-09 13:25:03 -0700249 bionic/statvfs.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700250 bionic/strerror.cpp \
251 bionic/strerror_r.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700252 bionic/strsignal.cpp \
253 bionic/stubs.cpp \
Elliott Hughes91a99252013-02-12 21:56:42 -0800254 bionic/sysconf.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700255 bionic/tdestroy.cpp \
256 bionic/tmpfile.cpp \
Elliott Hughes17a8b0d2013-03-21 15:43:53 -0700257 bionic/wait.cpp \
Elliott Hughes063cfb22012-10-25 20:55:23 -0700258 bionic/wchar.cpp \
Elliott Hughes29c7f0b2012-10-22 17:05:27 -0700259
Pavel Chupina567a8e2012-12-18 17:30:02 +0400260# These are shared by all the 32-bit targets, but not the 64-bit ones.
261ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
262libc_bionic_src_files += \
263 bionic/mmap.cpp \
264
265endif
266
Elliott Hughesce4783c2013-07-12 17:31:11 -0700267libc_tzcode_src_files := \
268 tzcode/asctime.c \
269 tzcode/difftime.c \
270 tzcode/localtime.c \
271 tzcode/strftime.c \
272 tzcode/strptime.c \
273
Elliott Hughesf0777842013-03-01 16:59:46 -0800274libc_upstream_freebsd_src_files := \
Elliott Hughes6b05c8e2013-04-11 13:54:48 -0700275 upstream-freebsd/lib/libc/stdio/clrerr.c \
276 upstream-freebsd/lib/libc/stdio/fclose.c \
277 upstream-freebsd/lib/libc/stdio/fdopen.c \
278 upstream-freebsd/lib/libc/stdio/feof.c \
279 upstream-freebsd/lib/libc/stdio/ferror.c \
280 upstream-freebsd/lib/libc/stdio/fgetln.c \
281 upstream-freebsd/lib/libc/stdio/fgetpos.c \
282 upstream-freebsd/lib/libc/stdio/fgets.c \
283 upstream-freebsd/lib/libc/stdio/fileno.c \
284 upstream-freebsd/lib/libc/stdio/flags.c \
285 upstream-freebsd/lib/libc/stdio/fopen.c \
286 upstream-freebsd/lib/libc/stdio/fpurge.c \
287 upstream-freebsd/lib/libc/stdio/fputs.c \
288 upstream-freebsd/lib/libc/stdio/fsetpos.c \
289 upstream-freebsd/lib/libc/stdio/funopen.c \
290 upstream-freebsd/lib/libc/stdio/fwalk.c \
291 upstream-freebsd/lib/libc/stdio/fwrite.c \
292 upstream-freebsd/lib/libc/stdio/getc.c \
293 upstream-freebsd/lib/libc/stdio/getchar.c \
Elliott Hughes677ee562013-06-12 15:24:15 -0700294 upstream-freebsd/lib/libc/stdio/makebuf.c \
Elliott Hughes284f7882013-07-19 15:20:31 -0700295 upstream-freebsd/lib/libc/stdio/mktemp.c \
Elliott Hughes6b05c8e2013-04-11 13:54:48 -0700296 upstream-freebsd/lib/libc/stdio/putc.c \
297 upstream-freebsd/lib/libc/stdio/putchar.c \
298 upstream-freebsd/lib/libc/stdio/puts.c \
299 upstream-freebsd/lib/libc/stdio/putw.c \
300 upstream-freebsd/lib/libc/stdio/remove.c \
301 upstream-freebsd/lib/libc/stdio/rget.c \
302 upstream-freebsd/lib/libc/stdio/setbuf.c \
303 upstream-freebsd/lib/libc/stdio/setbuffer.c \
Elliott Hughes677ee562013-06-12 15:24:15 -0700304 upstream-freebsd/lib/libc/stdio/setvbuf.c \
Elliott Hughes6b05c8e2013-04-11 13:54:48 -0700305 upstream-freebsd/lib/libc/stdio/tempnam.c \
306 upstream-freebsd/lib/libc/stdio/tmpnam.c \
307 upstream-freebsd/lib/libc/stdio/wsetup.c \
Elliott Hughesaec2ffb2013-08-12 12:07:05 -0700308 upstream-freebsd/lib/libc/stdlib/abs.c \
Elliott Hughesd278b822013-06-25 14:48:10 -0700309 upstream-freebsd/lib/libc/stdlib/getopt_long.c \
Elliott Hughesaec2ffb2013-08-12 12:07:05 -0700310 upstream-freebsd/lib/libc/stdlib/imaxabs.c \
311 upstream-freebsd/lib/libc/stdlib/imaxdiv.c \
312 upstream-freebsd/lib/libc/stdlib/labs.c \
313 upstream-freebsd/lib/libc/stdlib/llabs.c \
Elliott Hughes0b25f632013-04-11 18:08:34 -0700314 upstream-freebsd/lib/libc/stdlib/qsort.c \
Elliott Hughesf0777842013-03-01 16:59:46 -0800315 upstream-freebsd/lib/libc/stdlib/realpath.c \
Elliott Hugheseb93ebf2013-03-01 18:35:56 -0800316 upstream-freebsd/lib/libc/string/wcpcpy.c \
317 upstream-freebsd/lib/libc/string/wcpncpy.c \
318 upstream-freebsd/lib/libc/string/wcscasecmp.c \
Elliott Hugheseb93ebf2013-03-01 18:35:56 -0800319 upstream-freebsd/lib/libc/string/wcscspn.c \
320 upstream-freebsd/lib/libc/string/wcsdup.c \
321 upstream-freebsd/lib/libc/string/wcslcat.c \
322 upstream-freebsd/lib/libc/string/wcslcpy.c \
Elliott Hugheseb93ebf2013-03-01 18:35:56 -0800323 upstream-freebsd/lib/libc/string/wcsncasecmp.c \
324 upstream-freebsd/lib/libc/string/wcsncat.c \
325 upstream-freebsd/lib/libc/string/wcsncmp.c \
326 upstream-freebsd/lib/libc/string/wcsncpy.c \
327 upstream-freebsd/lib/libc/string/wcsnlen.c \
328 upstream-freebsd/lib/libc/string/wcspbrk.c \
Elliott Hugheseb93ebf2013-03-01 18:35:56 -0800329 upstream-freebsd/lib/libc/string/wcsspn.c \
330 upstream-freebsd/lib/libc/string/wcsstr.c \
331 upstream-freebsd/lib/libc/string/wcstok.c \
332 upstream-freebsd/lib/libc/string/wmemchr.c \
Elliott Hugheseb93ebf2013-03-01 18:35:56 -0800333 upstream-freebsd/lib/libc/string/wmemcpy.c \
334 upstream-freebsd/lib/libc/string/wmemmove.c \
335 upstream-freebsd/lib/libc/string/wmemset.c \
Elliott Hughesf0777842013-03-01 16:59:46 -0800336
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700337libc_upstream_netbsd_src_files := \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700338 upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
339 upstream-netbsd/common/lib/libc/inet/inet_addr.c \
340 upstream-netbsd/libc/compat-43/creat.c \
341 upstream-netbsd/libc/gen/ftw.c \
342 upstream-netbsd/libc/gen/nftw.c \
343 upstream-netbsd/libc/gen/nice.c \
Elliott Hughes6b3f49a2013-03-06 16:20:55 -0800344 upstream-netbsd/libc/gen/popen.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700345 upstream-netbsd/libc/gen/psignal.c \
Elliott Hughesab44f522012-10-23 16:05:09 -0700346 upstream-netbsd/libc/gen/setjmperr.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700347 upstream-netbsd/libc/gen/utime.c \
348 upstream-netbsd/libc/inet/inet_ntoa.c \
349 upstream-netbsd/libc/inet/inet_ntop.c \
350 upstream-netbsd/libc/inet/inet_pton.c \
Elliott Hughesab44f522012-10-23 16:05:09 -0700351 upstream-netbsd/libc/isc/ev_streams.c \
352 upstream-netbsd/libc/isc/ev_timers.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700353 upstream-netbsd/libc/regex/regcomp.c \
354 upstream-netbsd/libc/regex/regerror.c \
355 upstream-netbsd/libc/regex/regexec.c \
356 upstream-netbsd/libc/regex/regfree.c \
357 upstream-netbsd/libc/stdio/getdelim.c \
358 upstream-netbsd/libc/stdio/getline.c \
Elliott Hughesab44f522012-10-23 16:05:09 -0700359 upstream-netbsd/libc/stdlib/bsearch.c \
360 upstream-netbsd/libc/stdlib/div.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700361 upstream-netbsd/libc/stdlib/drand48.c \
362 upstream-netbsd/libc/stdlib/erand48.c \
363 upstream-netbsd/libc/stdlib/jrand48.c \
Elliott Hughesab44f522012-10-23 16:05:09 -0700364 upstream-netbsd/libc/stdlib/ldiv.c \
365 upstream-netbsd/libc/stdlib/lldiv.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700366 upstream-netbsd/libc/stdlib/lrand48.c \
367 upstream-netbsd/libc/stdlib/mrand48.c \
368 upstream-netbsd/libc/stdlib/nrand48.c \
369 upstream-netbsd/libc/stdlib/_rand48.c \
370 upstream-netbsd/libc/stdlib/seed48.c \
371 upstream-netbsd/libc/stdlib/srand48.c \
372 upstream-netbsd/libc/stdlib/tdelete.c \
373 upstream-netbsd/libc/stdlib/tfind.c \
374 upstream-netbsd/libc/stdlib/tsearch.c \
Elliott Hughesc51cd762013-01-22 14:41:23 -0800375 upstream-netbsd/libc/string/memccpy.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700376 upstream-netbsd/libc/string/strcasestr.c \
Elliott Hughes2b473072013-01-22 15:10:19 -0800377 upstream-netbsd/libc/string/strcoll.c \
Elliott Hughese8bcca32012-10-23 12:26:26 -0700378 upstream-netbsd/libc/string/strxfrm.c \
Elliott Hughesab44f522012-10-23 16:05:09 -0700379 upstream-netbsd/libc/unistd/killpg.c \
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700380
Pavel Chupina567a8e2012-12-18 17:30:02 +0400381
Dima Zavinca122b02009-05-27 10:52:37 -0700382# Architecture specific source files go here
383# =========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800384ifeq ($(TARGET_ARCH),arm)
385libc_common_src_files += \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400386 bionic/memchr.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400387 bionic/memmove.c.arm \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400388 bionic/memrchr.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400389 bionic/strchr.cpp \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400390 bionic/strnlen.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400391 string/bcopy.c \
392 string/index.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400393 string/strlcat.c \
394 string/strlcpy.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400395 string/strncat.c \
396 string/strncmp.c \
397 string/strncpy.c \
398 string/strrchr.c \
399 upstream-freebsd/lib/libc/string/wcscat.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400400 upstream-freebsd/lib/libc/string/wcschr.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400401 upstream-freebsd/lib/libc/string/wcscmp.c \
402 upstream-freebsd/lib/libc/string/wcscpy.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400403 upstream-freebsd/lib/libc/string/wcslen.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400404 upstream-freebsd/lib/libc/string/wcsrchr.c \
405 upstream-freebsd/lib/libc/string/wmemcmp.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800406
407# These files need to be arm so that gdbserver
408# can set breakpoints in them without messing
409# up any thumb code.
Pavel Chupina567a8e2012-12-18 17:30:02 +0400410# TODO: is this actually necessary?
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800411libc_common_src_files += \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400412 bionic/pthread-atfork.c.arm \
413 bionic/pthread-rwlocks.c.arm \
414 bionic/pthread-timers.c.arm \
415 bionic/ptrace.c.arm \
Dima Zavinca122b02009-05-27 10:52:37 -0700416
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700417libc_static_common_src_files += \
Elliott Hughes44b53ad2013-02-11 20:18:47 +0000418 bionic/pthread.c.arm \
Elliott Hughes4b4a8822013-02-12 17:15:59 -0800419 bionic/pthread_create.cpp.arm \
Elliott Hughes44b53ad2013-02-11 20:18:47 +0000420 bionic/pthread_key.cpp.arm \
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700421
Raghu Gandhama4c79332012-08-07 12:23:24 -0700422endif # arm
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800423
424ifeq ($(TARGET_ARCH),x86)
425libc_common_src_files += \
Elliott Hughesd2547042013-02-13 16:31:52 -0800426 bionic/pthread-atfork.c \
427 bionic/pthread-rwlocks.c \
428 bionic/pthread-timers.c \
429 bionic/ptrace.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800430
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700431libc_static_common_src_files += \
Elliott Hughes44b53ad2013-02-11 20:18:47 +0000432 bionic/pthread.c \
Elliott Hughes4b4a8822013-02-12 17:15:59 -0800433 bionic/pthread_create.cpp \
Elliott Hughes44b53ad2013-02-11 20:18:47 +0000434 bionic/pthread_key.cpp \
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700435
Raghu Gandhama4c79332012-08-07 12:23:24 -0700436endif # x86
Shin-ichiro KAWASAKI10093272009-09-28 16:11:39 +0900437
Pavel Chupina567a8e2012-12-18 17:30:02 +0400438ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
439libc_common_src_files += \
440 bionic/memchr.c \
441 bionic/memcmp.c \
442 bionic/memcpy.c \
443 bionic/memmove.c \
444 bionic/memrchr.c \
445 bionic/memset.c \
446 bionic/pthread-atfork.c \
447 bionic/pthread-rwlocks.c \
448 bionic/pthread-timers.c \
449 bionic/ptrace.c \
450 bionic/strchr.cpp \
451 bionic/strnlen.c \
452 string/bcopy.c \
453 string/index.c \
454 string/strcat.c \
455 string/strcmp.c \
456 string/strcpy.c \
457 string/strlcat.c \
458 string/strlcpy.c \
459 string/strlen.c \
460 string/strncat.c \
461 string/strncmp.c \
462 string/strncpy.c \
463 string/strrchr.c \
464 upstream-freebsd/lib/libc/string/wcscat.c \
465 upstream-freebsd/lib/libc/string/wcschr.c \
466 upstream-freebsd/lib/libc/string/wcscmp.c \
467 upstream-freebsd/lib/libc/string/wcscpy.c \
468 upstream-freebsd/lib/libc/string/wcslen.c \
469 upstream-freebsd/lib/libc/string/wcsrchr.c \
470 upstream-freebsd/lib/libc/string/wmemcmp.c \
471
472libc_static_common_src_files += \
473 bionic/pthread.c \
474 bionic/pthread_create.cpp \
475 bionic/pthread_key.cpp \
476
477endif # x86_64
478
Raghu Gandhama4c79332012-08-07 12:23:24 -0700479ifeq ($(TARGET_ARCH),mips)
480libc_common_src_files += \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400481 bionic/memchr.c \
Elliott Hughes857fed52012-10-02 11:20:07 -0700482 bionic/memcmp.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400483 bionic/memrchr.c \
484 bionic/strchr.cpp \
485 bionic/strnlen.c \
Raghu Gandhama4c79332012-08-07 12:23:24 -0700486 string/bcopy.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400487 string/index.c \
488 string/strcat.c \
Raghu Gandhama4c79332012-08-07 12:23:24 -0700489 string/strcmp.c \
490 string/strcpy.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400491 string/strlcat.c \
492 string/strlcpy.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400493 string/strncat.c \
494 string/strncmp.c \
495 string/strncpy.c \
496 string/strrchr.c \
Chris Dearmanfa4d5962013-10-01 19:11:26 -0700497 upstream-freebsd/lib/libc/string/wcscat.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400498 upstream-freebsd/lib/libc/string/wcschr.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400499 upstream-freebsd/lib/libc/string/wcscmp.c \
500 upstream-freebsd/lib/libc/string/wcscpy.c \
Liubov Dmitrieva0a490662012-01-17 12:55:46 +0400501 upstream-freebsd/lib/libc/string/wcslen.c \
Pavel Chupina567a8e2012-12-18 17:30:02 +0400502 upstream-freebsd/lib/libc/string/wcsrchr.c \
503 upstream-freebsd/lib/libc/string/wmemcmp.c \
Raghu Gandhama4c79332012-08-07 12:23:24 -0700504
505libc_common_src_files += \
506 bionic/pthread-atfork.c \
507 bionic/pthread-rwlocks.c \
508 bionic/pthread-timers.c \
509 bionic/ptrace.c
510
511libc_static_common_src_files += \
Elliott Hughesba342c12013-02-11 18:06:23 -0800512 bionic/pthread.c \
Elliott Hughes4b4a8822013-02-12 17:15:59 -0800513 bionic/pthread_create.cpp \
Elliott Hughes44b53ad2013-02-11 20:18:47 +0000514 bionic/pthread_key.cpp \
Raghu Gandhama4c79332012-08-07 12:23:24 -0700515
Raghu Gandhama4c79332012-08-07 12:23:24 -0700516endif # mips
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800517
Christopher Ferris7c83a1e2013-02-26 01:30:00 -0800518ifeq ($(strip $(TARGET_CPU_VARIANT)),)
519$(warning TARGET_CPU_VARIANT is not defined)
520endif
521
522###########################################################
523## Add cpu specific source files.
524##
525## This can be called multiple times, but it will only add
526## the first source file for each unique $(1).
527## $(1): Unique identifier to identify the cpu variant
528## implementation.
529## $(2): Cpu specific source file.
530###########################################################
531
532define libc-add-cpu-variant-src
533$(if $(filter true,$(_LIBC_ARCH_CPU_VARIANT_HAS_$(1))), \
534 , \
535 $(eval _LIBC_ARCH_CPU_VARIANT_HAS_$(1) := true) \
536 $(eval _LIBC_ARCH_CPU_VARIANT_SRC_FILE.$(1) := $(2)) \
537 $(eval _LIBC_ARCH_CPU_VARIANT_SRC_FILES += $(2)) \
538)
539endef
540
541_LIBC_ARCH_COMMON_SRC_FILES :=
542_LIBC_ARCH_CPU_VARIANT_SRC_FILES :=
543_LIBC_ARCH_STATIC_SRC_FILES :=
544_LIBC_ARCH_DYNAMIC_SRC_FILES :=
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700545_LIBC_ARCH_ADDITIONAL_DEPENDENCIES :=
546
547libc_common_additional_dependencies += \
548 $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
549include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk
Christopher Ferris7c83a1e2013-02-26 01:30:00 -0800550
551libc_common_src_files += $(_LIBC_ARCH_COMMON_SRC_FILES)
552libc_common_src_files += $(_LIBC_ARCH_CPU_VARIANT_SRC_FILES)
553libc_arch_static_src_files := $(_LIBC_ARCH_STATIC_SRC_FILES)
554libc_arch_dynamic_src_files := $(_LIBC_ARCH_DYNAMIC_SRC_FILES)
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700555libc_common_additional_dependencies += $(_LIBC_ARCH_ADDITIONAL_DEPENDENCIES)
Christopher Ferris7c83a1e2013-02-26 01:30:00 -0800556
Dima Zavinca122b02009-05-27 10:52:37 -0700557# Define some common cflags
558# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800559libc_common_cflags := \
Elliott Hughes470631e2012-06-06 10:32:56 -0700560 -DANDROID_CHANGES \
Elliott Hughes470631e2012-06-06 10:32:56 -0700561 -D_LIBC=1 \
Elliott Hughes470631e2012-06-06 10:32:56 -0700562 -DINET6 \
563 -I$(LOCAL_PATH)/private \
Elliott Hughes470631e2012-06-06 10:32:56 -0700564 -DPOSIX_MISTAKE \
Elliott Hughesc4d1fec2012-08-28 14:15:04 -0700565 -Wall -Wextra
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800566
Dave Bortd2c9dcc2009-04-23 15:50:03 -0700567ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800568 libc_common_cflags += -DDEBUG
569endif
570
Jack Ren2fd81ef2011-11-19 09:48:03 +0800571# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
572# the appropriate BoardConfig.mk file.
573#
574ifneq ($(BOARD_MALLOC_ALIGNMENT),)
575 libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
576endif
577
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800578ifeq ($(TARGET_ARCH),arm)
Raghu Gandhama4c79332012-08-07 12:23:24 -0700579 libc_common_cflags += -DSOFTFLOAT
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800580 libc_common_cflags += -fstrict-aliasing
Dima Zavinca122b02009-05-27 10:52:37 -0700581 libc_crt_target_cflags := -mthumb-interwork
Elliott Hughes7e841ed2013-10-03 23:30:33 -0700582endif # arm
Raghu Gandhama4c79332012-08-07 12:23:24 -0700583
584ifeq ($(TARGET_ARCH),mips)
585 ifneq ($(ARCH_MIPS_HAS_FPU),true)
586 libc_common_cflags += -DSOFTFLOAT
587 endif
588 libc_common_cflags += -fstrict-aliasing
589 libc_crt_target_cflags := $(TARGET_GLOBAL_CFLAGS)
590endif # mips
591
Elliott Hughes7e841ed2013-10-03 23:30:33 -0700592ifeq ($(TARGET_ARCH),x86)
593 libc_common_cflags += -DSOFTFLOAT
594 libc_crt_target_cflags := -m32
595 libc_crt_target_ldflags := -melf_i386
596endif # x86
597
598ifeq ($(TARGET_ARCH),x86_64)
599 libc_common_cflags += -DSOFTFLOAT
600 libc_crt_target_cflags := -m64
601 libc_crt_target_ldflags := -melf_x86_64
602endif # x86_64
603
Andy McFaddenfcd00eb2010-05-28 13:31:45 -0700604# Define ANDROID_SMP appropriately.
605ifeq ($(TARGET_CPU_SMP),true)
606 libc_common_cflags += -DANDROID_SMP=1
607else
608 libc_common_cflags += -DANDROID_SMP=0
609endif
610
Elliott Hughes76be6602012-08-08 14:07:37 -0700611# crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
612libc_crt_target_cflags += \
613 -I$(LOCAL_PATH)/include \
614 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
Andy McFaddenfcd00eb2010-05-28 13:31:45 -0700615
Stephen Hines762cea42013-09-30 17:10:53 -0700616# Define some common conlyflags
617libc_common_conlyflags := \
618 -std=gnu99
619
620# Define some common cppflags
621libc_common_cppflags := \
622 -std=gnu++11
623
Dima Zavinca122b02009-05-27 10:52:37 -0700624# Define some common includes
625# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800626libc_common_c_includes := \
627 $(LOCAL_PATH)/stdlib \
628 $(LOCAL_PATH)/string \
Nick Kralevich76656af2012-06-07 16:30:02 -0700629 $(LOCAL_PATH)/stdio \
630 external/safe-iop/include
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800631
Nick Kralevich9d403262012-05-31 11:40:10 -0700632# Needed to access private/__dso_handle.h from
David 'Digit' Turner3b43f872010-07-01 23:09:28 -0700633# crtbegin_xxx.S and crtend_xxx.S
Elliott Hughes76be6602012-08-08 14:07:37 -0700634libc_crt_target_cflags += \
635 -I$(LOCAL_PATH)/private \
636 -I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800637
Dima Zavinca122b02009-05-27 10:52:37 -0700638# Define the libc run-time (crt) support object files that must be built,
639# which are needed to build all other objects (shared/static libs and
640# executables)
641# ==========================================================================
Raghu Gandhama4c79332012-08-07 12:23:24 -0700642# ARM, MIPS, and x86 all need crtbegin_so/crtend_so.
David 'Digit' Turner6a9b8882010-06-18 14:47:22 -0700643#
644# For x86, the .init section must point to a function that calls all
645# entries in the .ctors section. (on ARM this is done through the
646# .init_array section instead).
647#
Raghu Gandhama4c79332012-08-07 12:23:24 -0700648# For all the platforms, the .fini_array section must point to a function
David 'Digit' Turner6a9b8882010-06-18 14:47:22 -0700649# that will call __cxa_finalize(&__dso_handle) in order to ensure that
650# static C++ destructors are properly called on dlclose().
651#
Pavel Chupinb49c17c2013-10-02 16:38:05 +0400652libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-common/bionic/crtbegin.c
653libc_crt_target_crtbegin_so_file := $(LOCAL_PATH)/arch-common/bionic/crtbegin_so.c
654
Raghu Gandhama4c79332012-08-07 12:23:24 -0700655ifeq ($(TARGET_ARCH),arm)
Raghu Gandhama4c79332012-08-07 12:23:24 -0700656 libc_crt_target_so_cflags :=
David 'Digit' Turner2d2dbd32011-06-25 17:26:38 +0200657endif
Raghu Gandhama4c79332012-08-07 12:23:24 -0700658ifeq ($(TARGET_ARCH),mips)
Raghu Gandhama4c79332012-08-07 12:23:24 -0700659 libc_crt_target_so_cflags := -fPIC
Pavel Chupinb49c17c2013-10-02 16:38:05 +0400660libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.c
Raghu Gandhama4c79332012-08-07 12:23:24 -0700661endif
Pavel Chupina567a8e2012-12-18 17:30:02 +0400662ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
Raghu Gandhama4c79332012-08-07 12:23:24 -0700663 libc_crt_target_so_cflags := -fPIC
664endif
Raghu Gandhama4c79332012-08-07 12:23:24 -0700665libc_crt_target_so_cflags += $(libc_crt_target_cflags)
Michael Hopeea8fad12012-07-31 16:18:22 +1200666
667# See the comment in crtbrand.c for the reason why we need to generate
668# crtbrand.s before generating crtbrand.o.
669GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
670$(GEN): $(LOCAL_PATH)/bionic/crtbrand.c
671 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700672 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -S \
673 -MD -MF $(@:%.s=%.d) -o $@ $<
674 $(hide) sed -i -e '/\.note\.ABI-tag/s/progbits/note/' $@
675 $(call transform-d-to-p-args,$(@:%.s=%.d),$(@:%.s=%.P))
676-include $(GEN:%.s=%.P)
Michael Hopeea8fad12012-07-31 16:18:22 +1200677ALL_GENERATED_SOURCES += $(GEN)
678
679GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
680$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
681 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700682 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
Michael Hopeea8fad12012-07-31 16:18:22 +1200683ALL_GENERATED_SOURCES += $(GEN)
684
Ying Wangfc9e5252012-05-15 15:15:11 -0700685GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
Elliott Hughes12949e52012-09-10 11:16:12 -0700686$(GEN): $(libc_crt_target_crtbegin_so_file)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800687 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700688 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
689 -MD -MF $(@:%.o=%.d) -o $@ -c $<
690 $(transform-d-to-p)
691-include $(GEN:%.o=%.P)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800692ALL_GENERATED_SOURCES += $(GEN)
693
Ying Wangfc9e5252012-05-15 15:15:11 -0700694GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
Pavel Chupinb49c17c2013-10-02 16:38:05 +0400695$(GEN): $(LOCAL_PATH)/arch-common/bionic/crtend_so.S
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800696 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700697 $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
698 -MD -MF $(@:%.o=%.d) -o $@ -c $<
699 $(transform-d-to-p)
700-include $(GEN:%.o=%.P)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800701ALL_GENERATED_SOURCES += $(GEN)
Shih-wei Liaofc0725e2012-07-28 00:33:28 -0700702
Ying Wangcf464872012-09-07 17:06:56 -0700703# The following two are installed to device
Shih-wei Liaofc0725e2012-07-28 00:33:28 -0700704GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o
Ying Wangcf464872012-09-07 17:06:56 -0700705$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
706 $(hide) mkdir -p $(dir $@) && cp -f $< $@
Shih-wei Liaofc0725e2012-07-28 00:33:28 -0700707ALL_GENERATED_SOURCES += $(GEN)
708
709GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o
Ying Wangcf464872012-09-07 17:06:56 -0700710$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
711 $(hide) mkdir -p $(dir $@) && cp -f $< $@
Shih-wei Liaofc0725e2012-07-28 00:33:28 -0700712ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800713
Dima Zavinca122b02009-05-27 10:52:37 -0700714
Michael Hopeea8fad12012-07-31 16:18:22 +1200715GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o
Elliott Hughes12949e52012-09-10 11:16:12 -0700716$(GEN): $(libc_crt_target_crtbegin_file)
Michael Hopeea8fad12012-07-31 16:18:22 +1200717 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700718 $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
719 -MD -MF $(@:%.o=%.d) -o $@ -c $<
720 $(transform-d-to-p)
721-include $(GEN:%.o=%.P)
Michael Hopeea8fad12012-07-31 16:18:22 +1200722ALL_GENERATED_SOURCES += $(GEN)
723
Ying Wangfc9e5252012-05-15 15:15:11 -0700724GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o
Michael Hopeea8fad12012-07-31 16:18:22 +1200725$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
726 @mkdir -p $(dir $@)
Pavel Chupine85c1832013-08-16 18:11:13 +0400727 $(hide) $(TARGET_LD) $(libc_crt_target_ldflags) -r -o $@ $^
Michael Hopeea8fad12012-07-31 16:18:22 +1200728ALL_GENERATED_SOURCES += $(GEN)
729
730GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o
Elliott Hughes12949e52012-09-10 11:16:12 -0700731$(GEN): $(libc_crt_target_crtbegin_file)
Dima Zavinca122b02009-05-27 10:52:37 -0700732 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700733 $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
734 -MD -MF $(@:%.o=%.d) -o $@ -c $<
735 $(transform-d-to-p)
736-include $(GEN:%.o=%.P)
Dima Zavinca122b02009-05-27 10:52:37 -0700737ALL_GENERATED_SOURCES += $(GEN)
738
Ying Wangfc9e5252012-05-15 15:15:11 -0700739GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o
Michael Hopeea8fad12012-07-31 16:18:22 +1200740$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
Dima Zavinca122b02009-05-27 10:52:37 -0700741 @mkdir -p $(dir $@)
Pavel Chupine85c1832013-08-16 18:11:13 +0400742 $(hide) $(TARGET_LD) $(libc_crt_target_ldflags) -r -o $@ $^
Dima Zavinca122b02009-05-27 10:52:37 -0700743ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800744
Dima Zavinca122b02009-05-27 10:52:37 -0700745# We rename crtend.o to crtend_android.o to avoid a
746# name clash between gcc and bionic.
Ying Wangfc9e5252012-05-15 15:15:11 -0700747GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o
Pavel Chupinb49c17c2013-10-02 16:38:05 +0400748$(GEN): $(LOCAL_PATH)/arch-common/bionic/crtend.S
Dima Zavinca122b02009-05-27 10:52:37 -0700749 @mkdir -p $(dir $@)
Ying Wangcf464872012-09-07 17:06:56 -0700750 $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
751 -MD -MF $(@:%.o=%.d) -o $@ -c $<
752 $(transform-d-to-p)
753-include $(GEN:%.o=%.P)
Dima Zavinca122b02009-05-27 10:52:37 -0700754ALL_GENERATED_SOURCES += $(GEN)
755
756
757# To enable malloc leak check for statically linked programs, add
758# "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk
759WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
760
761# ========================================================
Nick Kralevich6334c662012-07-10 10:46:19 -0700762# libbionic_ssp.a - stack protector code
763# ========================================================
764#
765# The stack protector code needs to be compiled
766# with -fno-stack-protector, since it modifies the
767# stack canary.
768
769include $(CLEAR_VARS)
770
Elliott Hughes642331b2013-03-06 15:03:53 -0800771LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp
Elliott Hughesdc5ec072013-02-14 11:15:58 -0800772LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector -Werror
Stephen Hines762cea42013-09-30 17:10:53 -0700773LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
774LOCAL_CPPFLAGS := $(libc_common_cppflags)
Nick Kralevich6334c662012-07-10 10:46:19 -0700775LOCAL_C_INCLUDES := $(libc_common_c_includes)
776LOCAL_MODULE := libbionic_ssp
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700777LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Nick Kralevich6334c662012-07-10 10:46:19 -0700778LOCAL_SYSTEM_SHARED_LIBRARIES :=
779
780include $(BUILD_STATIC_LIBRARY)
781
782
783# ========================================================
Elliott Hughesce4783c2013-07-12 17:31:11 -0700784# libc_tzcode.a - upstream 'tzcode' code
785# ========================================================
786
787include $(CLEAR_VARS)
788
789LOCAL_SRC_FILES := $(libc_tzcode_src_files)
790LOCAL_CFLAGS := \
791 $(libc_common_cflags) \
Elliott Hughesce4783c2013-07-12 17:31:11 -0700792 -DSTD_INSPIRED=1 \
793 -DTZDIR=\"/system/usr/share/zoneinfo\" \
794 -DTM_GMTOFF=tm_gmtoff \
795 -DUSG_COMPAT=1
Stephen Hines762cea42013-09-30 17:10:53 -0700796LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
797LOCAL_CPPFLAGS := $(libc_common_cppflags)
Elliott Hughesce4783c2013-07-12 17:31:11 -0700798LOCAL_C_INCLUDES := $(libc_common_c_includes)
799LOCAL_MODULE := libc_tzcode
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700800LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Elliott Hughesce4783c2013-07-12 17:31:11 -0700801LOCAL_SYSTEM_SHARED_LIBRARIES :=
802
803include $(BUILD_STATIC_LIBRARY)
804
805
806# ========================================================
Elliott Hughesf0777842013-03-01 16:59:46 -0800807# libc_freebsd.a - upstream FreeBSD C library code
808# ========================================================
809#
810# These files are built with the freebsd-compat.h header file
811# automatically included.
812
813include $(CLEAR_VARS)
814
815LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files)
816LOCAL_CFLAGS := \
817 $(libc_common_cflags) \
818 -I$(LOCAL_PATH)/upstream-freebsd \
819 -I$(LOCAL_PATH)/upstream-freebsd/libc/include \
820 -include upstream-freebsd/freebsd-compat.h
Stephen Hines762cea42013-09-30 17:10:53 -0700821LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
822LOCAL_CPPFLAGS := $(libc_common_cppflags)
Elliott Hughesf0777842013-03-01 16:59:46 -0800823LOCAL_C_INCLUDES := $(libc_common_c_includes)
824LOCAL_MODULE := libc_freebsd
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700825LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Elliott Hughesf0777842013-03-01 16:59:46 -0800826LOCAL_SYSTEM_SHARED_LIBRARIES :=
827
828include $(BUILD_STATIC_LIBRARY)
829
830
831# ========================================================
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700832# libc_netbsd.a - upstream NetBSD C library code
833# ========================================================
834#
835# These files are built with the netbsd-compat.h header file
836# automatically included.
837
838include $(CLEAR_VARS)
839
840LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files)
841LOCAL_CFLAGS := \
842 $(libc_common_cflags) \
Elliott Hughes3d2d4482012-08-13 16:38:29 -0700843 -I$(LOCAL_PATH)/upstream-netbsd \
Elliott Hughesab44f522012-10-23 16:05:09 -0700844 -I$(LOCAL_PATH)/upstream-netbsd/libc/include \
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700845 -include upstream-netbsd/netbsd-compat.h
Stephen Hines762cea42013-09-30 17:10:53 -0700846LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
847LOCAL_CPPFLAGS := $(libc_common_cppflags)
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700848LOCAL_C_INCLUDES := $(libc_common_c_includes)
849LOCAL_MODULE := libc_netbsd
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700850LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700851LOCAL_SYSTEM_SHARED_LIBRARIES :=
852
853include $(BUILD_STATIC_LIBRARY)
854
855
856# ========================================================
Elliott Hughes29c7f0b2012-10-22 17:05:27 -0700857# libc_bionic.a - home-grown C library code
858# ========================================================
859#
860include $(CLEAR_VARS)
861
862LOCAL_SRC_FILES := $(libc_bionic_src_files)
863LOCAL_CFLAGS := $(libc_common_cflags) -Werror
Stephen Hines762cea42013-09-30 17:10:53 -0700864LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
865LOCAL_CPPFLAGS := $(libc_common_cppflags)
Elliott Hughes29c7f0b2012-10-22 17:05:27 -0700866LOCAL_C_INCLUDES := $(libc_common_c_includes)
867LOCAL_MODULE := libc_bionic
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700868LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Elliott Hughes29c7f0b2012-10-22 17:05:27 -0700869LOCAL_SYSTEM_SHARED_LIBRARIES :=
870
871include $(BUILD_STATIC_LIBRARY)
872
873
874# ========================================================
Dima Zavinca122b02009-05-27 10:52:37 -0700875# libc_common.a
876# ========================================================
Elliott Hughesf8b3a922012-08-10 11:39:58 -0700877
Dima Zavinca122b02009-05-27 10:52:37 -0700878include $(CLEAR_VARS)
879
880LOCAL_SRC_FILES := $(libc_common_src_files)
Elliott Hughesab44f522012-10-23 16:05:09 -0700881LOCAL_CFLAGS := $(libc_common_cflags) \
Elliott Hughesab44f522012-10-23 16:05:09 -0700882 -I$(LOCAL_PATH)/upstream-netbsd/libc/include # for netbsd private headers
Stephen Hines762cea42013-09-30 17:10:53 -0700883LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
884LOCAL_CPPFLAGS := $(libc_common_cppflags)
Dima Zavinca122b02009-05-27 10:52:37 -0700885LOCAL_C_INCLUDES := $(libc_common_c_includes)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800886LOCAL_MODULE := libc_common
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700887LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Elliott Hughesce4783c2013-07-12 17:31:11 -0700888LOCAL_WHOLE_STATIC_LIBRARIES := \
889 libbionic_ssp \
890 libc_bionic \
891 libc_freebsd \
892 libc_netbsd \
893 libc_tzcode
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800894LOCAL_SYSTEM_SHARED_LIBRARIES :=
895
Ying Wangc97c5fc2012-08-11 14:23:19 -0700896# TODO: split out the asflags.
897LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
898
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800899include $(BUILD_STATIC_LIBRARY)
900
901
Dima Zavinca122b02009-05-27 10:52:37 -0700902# ========================================================
Dima Zavin49e55332009-05-27 10:52:37 -0700903# libc_nomalloc.a
904# ========================================================
905#
906# This is a version of the static C library that does not
Elliott Hughes91a99252013-02-12 21:56:42 -0800907# include malloc. It's useful in situations when the user wants
908# to provide their own malloc implementation, or wants to
909# explicitly disallow the use of the use of malloc,
910# such as in the dynamic loader.
Dima Zavin49e55332009-05-27 10:52:37 -0700911
912include $(CLEAR_VARS)
913
914LOCAL_SRC_FILES := \
915 $(libc_arch_static_src_files) \
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700916 $(libc_static_common_src_files) \
Elliott Hughes42b2c6a2013-02-07 10:14:39 -0800917 bionic/libc_init_static.cpp
Dima Zavin49e55332009-05-27 10:52:37 -0700918
919LOCAL_C_INCLUDES := $(libc_common_c_includes)
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700920LOCAL_CFLAGS := $(libc_common_cflags) \
Stephen Hines762cea42013-09-30 17:10:53 -0700921 -DLIBC_STATIC
922LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
923LOCAL_CPPFLAGS := $(libc_common_cppflags)
Dima Zavin49e55332009-05-27 10:52:37 -0700924
925LOCAL_MODULE := libc_nomalloc
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700926LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Dima Zavin49e55332009-05-27 10:52:37 -0700927LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
928LOCAL_SYSTEM_SHARED_LIBRARIES :=
929
930include $(BUILD_STATIC_LIBRARY)
931
932
933# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800934# libc.a
935# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800936include $(CLEAR_VARS)
937
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800938LOCAL_SRC_FILES := \
Dima Zavinca122b02009-05-27 10:52:37 -0700939 $(libc_arch_static_src_files) \
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700940 $(libc_static_common_src_files) \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800941 bionic/dlmalloc.c \
Elliott Hughesc4d1fec2012-08-28 14:15:04 -0700942 bionic/malloc_debug_common.cpp \
Elliott Hughes42b2c6a2013-02-07 10:14:39 -0800943 bionic/libc_init_static.cpp
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800944
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800945LOCAL_CFLAGS := $(libc_common_cflags) \
Stephen Hines762cea42013-09-30 17:10:53 -0700946 -DLIBC_STATIC
947LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
948LOCAL_CPPFLAGS := $(libc_common_cppflags)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800949LOCAL_C_INCLUDES := $(libc_common_c_includes)
Dima Zavinca122b02009-05-27 10:52:37 -0700950LOCAL_MODULE := libc
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700951LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800952LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800953LOCAL_SYSTEM_SHARED_LIBRARIES :=
954
955include $(BUILD_STATIC_LIBRARY)
956
957
Dima Zavinca122b02009-05-27 10:52:37 -0700958# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800959# libc.so
960# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800961include $(CLEAR_VARS)
962
Mathias Agopian7c0c3792011-09-05 23:54:55 -0700963# pthread deadlock prediction:
964# set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for
965# pthread deadlock prediction.
966# Since this code is experimental it is disabled by default.
967# see libc/bionic/pthread_debug.c for details
968
Stephen Hines762cea42013-09-30 17:10:53 -0700969LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
970LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
971LOCAL_CPPFLAGS := $(libc_common_cppflags)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800972LOCAL_C_INCLUDES := $(libc_common_c_includes)
973
974LOCAL_SRC_FILES := \
Dima Zavinca122b02009-05-27 10:52:37 -0700975 $(libc_arch_dynamic_src_files) \
David 'Digit' Turner6a51def2010-08-27 08:19:19 -0700976 $(libc_static_common_src_files) \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800977 bionic/dlmalloc.c \
Elliott Hughesc4d1fec2012-08-28 14:15:04 -0700978 bionic/malloc_debug_common.cpp \
Elliott Hughes1e980b62013-01-17 18:36:06 -0800979 bionic/pthread_debug.cpp \
Elliott Hughes42b2c6a2013-02-07 10:14:39 -0800980 bionic/libc_init_dynamic.cpp
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800981
Ard Biesheuvelf3cfcd82012-08-21 14:13:50 +0200982ifeq ($(TARGET_ARCH),arm)
983 LOCAL_NO_CRT := true
984 LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND
985
986 LOCAL_SRC_FILES := \
Pavel Chupinb49c17c2013-10-02 16:38:05 +0400987 arch-common/bionic/crtbegin_so.c \
Ard Biesheuvelf3cfcd82012-08-21 14:13:50 +0200988 arch-arm/bionic/atexit_legacy.c \
989 $(LOCAL_SRC_FILES) \
Pavel Chupinb49c17c2013-10-02 16:38:05 +0400990 arch-common/bionic/crtend_so.S
Ard Biesheuvelf3cfcd82012-08-21 14:13:50 +0200991endif
992
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800993LOCAL_MODULE:= libc
Christopher Ferrisd7a63292013-10-03 13:26:22 -0700994LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Elliott Hughes914d8d42012-10-18 11:28:56 -0700995LOCAL_REQUIRED_MODULES := tzdata
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800996
997# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
998# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
999# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
1000# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
1001# should, instead relying on the external symbols from the dependent libraries. That would
1002# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
1003# you wanted!
1004
1005LOCAL_SHARED_LIBRARIES := libdl
1006LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1007LOCAL_SYSTEM_SHARED_LIBRARIES :=
1008
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001009include $(BUILD_SHARED_LIBRARY)
1010
1011
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001012# For all builds, except for the -user build we will enable memory
1013# allocation checking (including memory leaks, buffer overwrites, etc.)
1014# Note that all these checks are also controlled by env. settings
1015# that can enable, or disable specific checks. Note also that some of
1016# the checks are available only in emulator and are implemeted in
1017# libc_malloc_qemu_instrumented.so.
1018ifneq ($(TARGET_BUILD_VARIANT),user)
1019
Dima Zavinca122b02009-05-27 10:52:37 -07001020# ========================================================
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001021# libc_malloc_debug_leak.so
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001022# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001023include $(CLEAR_VARS)
1024
Dima Zavinca122b02009-05-27 10:52:37 -07001025LOCAL_CFLAGS := \
1026 $(libc_common_cflags) \
1027 -DMALLOC_LEAK_CHECK
Stephen Hines762cea42013-09-30 17:10:53 -07001028LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1029LOCAL_CPPFLAGS := $(libc_common_cppflags)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001030
1031LOCAL_C_INCLUDES := $(libc_common_c_includes)
1032
1033LOCAL_SRC_FILES := \
Elliott Hughes1e980b62013-01-17 18:36:06 -08001034 bionic/debug_mapinfo.cpp \
1035 bionic/debug_stacktrace.cpp \
Elliott Hughesc4d1fec2012-08-28 14:15:04 -07001036 bionic/malloc_debug_leak.cpp \
1037 bionic/malloc_debug_check.cpp \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001038
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001039LOCAL_MODULE:= libc_malloc_debug_leak
Christopher Ferrisd7a63292013-10-03 13:26:22 -07001040LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001041
Pavel Chupine0077752012-09-10 19:35:25 +04001042LOCAL_SHARED_LIBRARIES := libc libdl
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001043LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1044LOCAL_SYSTEM_SHARED_LIBRARIES :=
Bruce Beareaa46fa22010-07-08 14:47:50 -07001045LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
Iliyan Malchev36807042011-03-14 14:02:05 -07001046
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001047# Don't install on release build
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001048LOCAL_MODULE_TAGS := eng debug
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001049
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001050include $(BUILD_SHARED_LIBRARY)
1051
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001052
1053# ========================================================
1054# libc_malloc_debug_qemu.so
1055# ========================================================
1056include $(CLEAR_VARS)
1057
1058LOCAL_CFLAGS := \
1059 $(libc_common_cflags) \
1060 -DMALLOC_QEMU_INSTRUMENT
Stephen Hines762cea42013-09-30 17:10:53 -07001061LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
1062LOCAL_CPPFLAGS := $(libc_common_cppflags)
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001063
1064LOCAL_C_INCLUDES := $(libc_common_c_includes)
1065
1066LOCAL_SRC_FILES := \
Elliott Hughesc4d1fec2012-08-28 14:15:04 -07001067 bionic/malloc_debug_qemu.cpp
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001068
1069LOCAL_MODULE:= libc_malloc_debug_qemu
Christopher Ferrisd7a63292013-10-03 13:26:22 -07001070LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001071
Mathias Agopian7c0c3792011-09-05 23:54:55 -07001072LOCAL_SHARED_LIBRARIES := libc libdl
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001073LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
1074LOCAL_SYSTEM_SHARED_LIBRARIES :=
Iliyan Malchev36807042011-03-14 14:02:05 -07001075
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -08001076# Don't install on release build
1077LOCAL_MODULE_TAGS := eng debug
1078
1079include $(BUILD_SHARED_LIBRARY)
1080
1081endif #!user
1082
1083
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001084# ========================================================
1085include $(call all-makefiles-under,$(LOCAL_PATH))