The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | |
| 3 | include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 4 | |
| 5 | # Define the common source files for all the libc instances |
| 6 | # ========================================================= |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 7 | libc_common_src_files := \ |
| 8 | $(syscall_src) \ |
| 9 | unistd/abort.c \ |
| 10 | unistd/alarm.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 11 | unistd/exec.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 12 | unistd/fnmatch.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 13 | unistd/getopt_long.c \ |
Colin Cross | 8c59d96 | 2010-01-13 16:39:26 -0800 | [diff] [blame] | 14 | unistd/killpg.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | unistd/popen.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 16 | unistd/syslog.c \ |
| 17 | unistd/system.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 18 | unistd/time.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | stdio/asprintf.c \ |
| 20 | stdio/clrerr.c \ |
| 21 | stdio/fclose.c \ |
| 22 | stdio/fdopen.c \ |
| 23 | stdio/feof.c \ |
| 24 | stdio/ferror.c \ |
| 25 | stdio/fflush.c \ |
| 26 | stdio/fgetc.c \ |
| 27 | stdio/fgetln.c \ |
| 28 | stdio/fgetpos.c \ |
| 29 | stdio/fgets.c \ |
| 30 | stdio/fileno.c \ |
| 31 | stdio/findfp.c \ |
| 32 | stdio/flags.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 33 | stdio/fopen.c \ |
| 34 | stdio/fprintf.c \ |
| 35 | stdio/fpurge.c \ |
| 36 | stdio/fputc.c \ |
| 37 | stdio/fputs.c \ |
| 38 | stdio/fread.c \ |
| 39 | stdio/freopen.c \ |
| 40 | stdio/fscanf.c \ |
| 41 | stdio/fseek.c \ |
| 42 | stdio/fsetpos.c \ |
| 43 | stdio/ftell.c \ |
| 44 | stdio/funopen.c \ |
| 45 | stdio/fvwrite.c \ |
| 46 | stdio/fwalk.c \ |
| 47 | stdio/fwrite.c \ |
| 48 | stdio/getc.c \ |
| 49 | stdio/getchar.c \ |
| 50 | stdio/gets.c \ |
| 51 | stdio/makebuf.c \ |
| 52 | stdio/mktemp.c \ |
| 53 | stdio/printf.c \ |
| 54 | stdio/putc.c \ |
| 55 | stdio/putchar.c \ |
| 56 | stdio/puts.c \ |
| 57 | stdio/putw.c \ |
| 58 | stdio/refill.c \ |
| 59 | stdio/remove.c \ |
| 60 | stdio/rewind.c \ |
| 61 | stdio/rget.c \ |
| 62 | stdio/scanf.c \ |
| 63 | stdio/setbuf.c \ |
| 64 | stdio/setbuffer.c \ |
| 65 | stdio/setvbuf.c \ |
| 66 | stdio/snprintf.c\ |
| 67 | stdio/sprintf.c \ |
| 68 | stdio/sscanf.c \ |
| 69 | stdio/stdio.c \ |
| 70 | stdio/tempnam.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | stdio/tmpnam.c \ |
| 72 | stdio/ungetc.c \ |
| 73 | stdio/vasprintf.c \ |
| 74 | stdio/vfprintf.c \ |
| 75 | stdio/vfscanf.c \ |
| 76 | stdio/vprintf.c \ |
| 77 | stdio/vsnprintf.c \ |
| 78 | stdio/vsprintf.c \ |
| 79 | stdio/vscanf.c \ |
| 80 | stdio/vsscanf.c \ |
| 81 | stdio/wbuf.c \ |
| 82 | stdio/wsetup.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 83 | stdlib/assert.c \ |
| 84 | stdlib/atexit.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 85 | stdlib/bsearch.c \ |
| 86 | stdlib/ctype_.c \ |
| 87 | stdlib/div.c \ |
| 88 | stdlib/exit.c \ |
| 89 | stdlib/getenv.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 90 | stdlib/ldiv.c \ |
| 91 | stdlib/lldiv.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 92 | stdlib/putenv.c \ |
| 93 | stdlib/qsort.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 94 | stdlib/setenv.c \ |
| 95 | stdlib/setjmperr.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 96 | stdlib/strtod.c \ |
| 97 | stdlib/strtoimax.c \ |
| 98 | stdlib/strtol.c \ |
| 99 | stdlib/strtoll.c \ |
| 100 | stdlib/strtoul.c \ |
| 101 | stdlib/strtoull.c \ |
| 102 | stdlib/strtoumax.c \ |
| 103 | stdlib/tolower_.c \ |
| 104 | stdlib/toupper_.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 105 | string/index.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 106 | string/strcasecmp.c \ |
| 107 | string/strcasestr.c \ |
| 108 | string/strcat.c \ |
| 109 | string/strchr.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 110 | string/strcspn.c \ |
| 111 | string/strdup.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 112 | string/strlcat.c \ |
| 113 | string/strlcpy.c \ |
| 114 | string/strncat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 115 | string/strncpy.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 116 | string/strpbrk.c \ |
| 117 | string/strrchr.c \ |
| 118 | string/strsep.c \ |
| 119 | string/strspn.c \ |
| 120 | string/strstr.c \ |
| 121 | string/strtok.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 122 | wchar/wcpcpy.c \ |
| 123 | wchar/wcpncpy.c \ |
| 124 | wchar/wcscasecmp.c \ |
| 125 | wchar/wcscat.c \ |
| 126 | wchar/wcschr.c \ |
| 127 | wchar/wcscmp.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 128 | wchar/wcscpy.c \ |
| 129 | wchar/wcscspn.c \ |
| 130 | wchar/wcsdup.c \ |
| 131 | wchar/wcslcat.c \ |
| 132 | wchar/wcslcpy.c \ |
| 133 | wchar/wcslen.c \ |
| 134 | wchar/wcsncasecmp.c \ |
| 135 | wchar/wcsncat.c \ |
| 136 | wchar/wcsncmp.c \ |
| 137 | wchar/wcsncpy.c \ |
| 138 | wchar/wcsnlen.c \ |
| 139 | wchar/wcspbrk.c \ |
| 140 | wchar/wcsrchr.c \ |
| 141 | wchar/wcsspn.c \ |
| 142 | wchar/wcsstr.c \ |
| 143 | wchar/wcstok.c \ |
| 144 | wchar/wcswidth.c \ |
Kristian Monsen | 7046561 | 2010-06-16 14:51:52 +0100 | [diff] [blame] | 145 | wchar/wcsxfrm.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 146 | wchar/wmemchr.c \ |
Kristian Monsen | 7046561 | 2010-06-16 14:51:52 +0100 | [diff] [blame] | 147 | wchar/wmemcmp.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 148 | wchar/wmemcpy.c \ |
| 149 | wchar/wmemmove.c \ |
| 150 | wchar/wmemset.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 151 | inet/inet_addr.c \ |
| 152 | inet/inet_aton.c \ |
| 153 | inet/inet_ntoa.c \ |
| 154 | inet/inet_ntop.c \ |
| 155 | inet/inet_pton.c \ |
| 156 | tzcode/asctime.c \ |
| 157 | tzcode/difftime.c \ |
| 158 | tzcode/localtime.c \ |
| 159 | tzcode/strftime.c \ |
| 160 | tzcode/strptime.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 161 | bionic/arc4random.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 162 | bionic/atoi.c \ |
| 163 | bionic/atol.c \ |
| 164 | bionic/atoll.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 165 | bionic/basename.c \ |
| 166 | bionic/basename_r.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 167 | bionic/bindresvport.c \ |
| 168 | bionic/bionic_clone.c \ |
| 169 | bionic/brk.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 170 | bionic/clearenv.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 171 | bionic/cpuacct.c \ |
| 172 | bionic/daemon.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 173 | bionic/dirname.c \ |
| 174 | bionic/dirname_r.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 175 | bionic/err.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 176 | bionic/ether_aton.c \ |
| 177 | bionic/ether_ntoa.c \ |
| 178 | bionic/eventfd.c \ |
| 179 | bionic/fcntl.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 180 | bionic/fdprintf.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 181 | bionic/__fgets_chk.c \ |
| 182 | bionic/flockfile.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 183 | bionic/fork.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 184 | bionic/fstatfs.c \ |
| 185 | bionic/ftime.c \ |
| 186 | bionic/ftok.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 187 | bionic/fts.c \ |
Elliott Hughes | 04a83a4 | 2012-08-16 15:59:12 -0700 | [diff] [blame] | 188 | bionic/getcwd.cpp \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 189 | bionic/getdtablesize.c \ |
| 190 | bionic/gethostname.c \ |
| 191 | bionic/getpgrp.c \ |
| 192 | bionic/getpriority.c \ |
| 193 | bionic/getpt.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 194 | bionic/if_indextoname.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 195 | bionic/if_nametoindex.c \ |
| 196 | bionic/initgroups.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 197 | bionic/ioctl.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 198 | bionic/isatty.c \ |
| 199 | bionic/issetugid.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 200 | bionic/ldexp.c \ |
| 201 | bionic/libc_init_common.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 202 | bionic/locale.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 203 | bionic/logd_write.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 204 | bionic/lseek64.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 205 | bionic/md5.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 206 | bionic/memccpy.c \ |
| 207 | bionic/memchr.c \ |
| 208 | bionic/__memcpy_chk.c \ |
| 209 | bionic/memmem.c \ |
| 210 | bionic/__memmove_chk.c \ |
Andy McFadden | 4ce737f | 2011-02-04 14:45:57 -0800 | [diff] [blame] | 211 | bionic/memmove_words.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 212 | bionic/memrchr.c \ |
| 213 | bionic/__memset_chk.c \ |
| 214 | bionic/memswap.c \ |
| 215 | bionic/mmap.c \ |
| 216 | bionic/openat.c \ |
| 217 | bionic/open.c \ |
| 218 | bionic/opendir.c \ |
| 219 | bionic/pathconf.c \ |
| 220 | bionic/perror.c \ |
| 221 | bionic/pread.c \ |
| 222 | bionic/pselect.c \ |
| 223 | bionic/ptsname.c \ |
| 224 | bionic/ptsname_r.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 225 | bionic/pututline.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 226 | bionic/pwrite.c \ |
| 227 | bionic/raise.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 228 | bionic/realpath.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 229 | bionic/reboot.c \ |
| 230 | bionic/recv.c \ |
| 231 | bionic/sbrk.c \ |
David 'Digit' Turner | 72e6fd4 | 2010-12-03 18:04:01 +0100 | [diff] [blame] | 232 | bionic/sched_cpualloc.c \ |
| 233 | bionic/sched_cpucount.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 234 | bionic/sched_getaffinity.c \ |
| 235 | bionic/sched_getcpu.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 236 | bionic/semaphore.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 237 | bionic/send.c \ |
| 238 | bionic/setegid.c \ |
| 239 | bionic/__set_errno.c \ |
| 240 | bionic/seteuid.c \ |
| 241 | bionic/setpgrp.c \ |
| 242 | bionic/setresuid.c \ |
| 243 | bionic/setreuid.c \ |
| 244 | bionic/setuid.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 245 | bionic/sha1.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 246 | bionic/sigblock.c \ |
| 247 | bionic/siginterrupt.c \ |
| 248 | bionic/siglist.c \ |
| 249 | bionic/signal.c \ |
| 250 | bionic/signame.c \ |
| 251 | bionic/sigsetmask.c \ |
| 252 | bionic/sigsuspend.c \ |
| 253 | bionic/sigwait.c \ |
| 254 | bionic/sleep.c \ |
| 255 | bionic/__snprintf_chk.c \ |
| 256 | bionic/__sprintf_chk.c \ |
| 257 | bionic/statfs.c \ |
| 258 | bionic/__strcat_chk.c \ |
| 259 | bionic/strcoll.c \ |
| 260 | bionic/__strcpy_chk.c \ |
Irina Tirdea | b5f053b | 2012-09-08 09:17:54 +0300 | [diff] [blame] | 261 | bionic/strerror.cpp \ |
| 262 | bionic/strerror_r.cpp \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 263 | bionic/__strlcat_chk.c \ |
| 264 | bionic/__strlcpy_chk.c \ |
| 265 | bionic/__strlen_chk.c \ |
| 266 | bionic/__strncat_chk.c \ |
| 267 | bionic/__strncpy_chk.c \ |
| 268 | bionic/strndup.c \ |
| 269 | bionic/strnlen.c \ |
| 270 | bionic/strntoimax.c \ |
| 271 | bionic/strntoumax.c \ |
Irina Tirdea | b5f053b | 2012-09-08 09:17:54 +0300 | [diff] [blame] | 272 | bionic/strsignal.cpp \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 273 | bionic/strtotimeval.c \ |
Elliott Hughes | de727ca | 2012-08-13 15:45:36 -0700 | [diff] [blame] | 274 | bionic/stubs.cpp \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 275 | bionic/system_properties.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 276 | bionic/tcgetpgrp.c \ |
| 277 | bionic/tcsetpgrp.c \ |
Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 278 | bionic/tdestroy.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 279 | bionic/thread_atexit.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 280 | bionic/time64.c \ |
Elliott Hughes | 91875dc | 2012-09-24 17:55:15 -0700 | [diff] [blame] | 281 | bionic/tmpfile.cpp \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 282 | bionic/__umask_chk.c \ |
| 283 | bionic/umount.c \ |
| 284 | bionic/unlockpt.c \ |
| 285 | bionic/usleep.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 286 | bionic/utime.c \ |
| 287 | bionic/utmp.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 288 | bionic/__vsnprintf_chk.c \ |
| 289 | bionic/__vsprintf_chk.c \ |
| 290 | bionic/wait.c \ |
| 291 | bionic/wchar.c \ |
| 292 | bionic/wcscoll.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 293 | netbsd/gethnamaddr.c \ |
| 294 | netbsd/isc/ev_timers.c \ |
| 295 | netbsd/isc/ev_streams.c \ |
| 296 | netbsd/inet/nsap_addr.c \ |
| 297 | netbsd/resolv/__dn_comp.c \ |
| 298 | netbsd/resolv/__res_close.c \ |
| 299 | netbsd/resolv/__res_send.c \ |
| 300 | netbsd/resolv/herror.c \ |
| 301 | netbsd/resolv/res_comp.c \ |
| 302 | netbsd/resolv/res_data.c \ |
| 303 | netbsd/resolv/res_debug.c \ |
| 304 | netbsd/resolv/res_init.c \ |
| 305 | netbsd/resolv/res_mkquery.c \ |
| 306 | netbsd/resolv/res_query.c \ |
| 307 | netbsd/resolv/res_send.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 308 | netbsd/resolv/res_state.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 309 | netbsd/resolv/res_cache.c \ |
| 310 | netbsd/net/nsdispatch.c \ |
| 311 | netbsd/net/getaddrinfo.c \ |
| 312 | netbsd/net/getnameinfo.c \ |
| 313 | netbsd/net/getservbyname.c \ |
| 314 | netbsd/net/getservent.c \ |
| 315 | netbsd/net/base64.c \ |
| 316 | netbsd/net/getservbyport.c \ |
| 317 | netbsd/nameser/ns_name.c \ |
| 318 | netbsd/nameser/ns_parse.c \ |
| 319 | netbsd/nameser/ns_ttl.c \ |
| 320 | netbsd/nameser/ns_netint.c \ |
| 321 | netbsd/nameser/ns_print.c \ |
Colin Cross | 4fa7b10 | 2010-01-12 18:59:25 -0800 | [diff] [blame] | 322 | netbsd/nameser/ns_samedomain.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 323 | |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 324 | libc_upstream_netbsd_src_files := \ |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 325 | upstream-netbsd/libc/compat-43/creat.c \ |
Nick Kralevich | 5e58ea0 | 2012-09-12 13:21:25 -0700 | [diff] [blame] | 326 | upstream-netbsd/libc/gen/ftw.c \ |
| 327 | upstream-netbsd/libc/gen/nftw.c \ |
Elliott Hughes | 3d2d448 | 2012-08-13 16:38:29 -0700 | [diff] [blame] | 328 | upstream-netbsd/libc/gen/nice.c \ |
Irina Tirdea | b5f053b | 2012-09-08 09:17:54 +0300 | [diff] [blame] | 329 | upstream-netbsd/libc/gen/psignal.c \ |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 330 | upstream-netbsd/libc/regex/regcomp.c \ |
| 331 | upstream-netbsd/libc/regex/regerror.c \ |
| 332 | upstream-netbsd/libc/regex/regexec.c \ |
| 333 | upstream-netbsd/libc/regex/regfree.c \ |
Irina Tirdea | eac9eb4 | 2012-09-08 09:28:30 +0300 | [diff] [blame] | 334 | upstream-netbsd/libc/stdio/getdelim.c \ |
| 335 | upstream-netbsd/libc/stdio/getline.c \ |
Elliott Hughes | 774c7f5 | 2012-10-01 13:11:03 -0700 | [diff] [blame] | 336 | upstream-netbsd/libc/stdlib/drand48.c \ |
| 337 | upstream-netbsd/libc/stdlib/erand48.c \ |
| 338 | upstream-netbsd/libc/stdlib/jrand48.c \ |
| 339 | upstream-netbsd/libc/stdlib/lrand48.c \ |
| 340 | upstream-netbsd/libc/stdlib/mrand48.c \ |
| 341 | upstream-netbsd/libc/stdlib/nrand48.c \ |
| 342 | upstream-netbsd/libc/stdlib/_rand48.c \ |
Elliott Hughes | 31a1060 | 2012-10-01 14:14:21 -0700 | [diff] [blame] | 343 | upstream-netbsd/libc/stdlib/seed48.c \ |
Elliott Hughes | 774c7f5 | 2012-10-01 13:11:03 -0700 | [diff] [blame] | 344 | upstream-netbsd/libc/stdlib/srand48.c \ |
Elliott Hughes | 409302f | 2012-08-13 17:02:11 -0700 | [diff] [blame] | 345 | upstream-netbsd/libc/stdlib/tdelete.c \ |
| 346 | upstream-netbsd/libc/stdlib/tfind.c \ |
| 347 | upstream-netbsd/libc/stdlib/tsearch.c \ |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 348 | upstream-netbsd/libc/string/strxfrm.c \ |
| 349 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 350 | # The following files are common, but must be compiled |
| 351 | # with different C flags when building a static C library. |
| 352 | # |
| 353 | # The reason for this is the implementation of __get_tls() |
| 354 | # that will differ between the shared and static versions |
| 355 | # of the library. |
| 356 | # |
| 357 | # See comments in private/bionic_tls.h for more details. |
| 358 | # |
| 359 | # NOTE: bionic/pthread.c is added later to this list |
| 360 | # because it needs special handling on ARM, see |
| 361 | # below. |
| 362 | # |
| 363 | libc_static_common_src_files := \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 364 | bionic/__errno.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 365 | bionic/sysconf.c \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 366 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 367 | # Architecture specific source files go here |
| 368 | # ========================================================= |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 369 | ifeq ($(TARGET_ARCH),arm) |
| 370 | libc_common_src_files += \ |
Ben Cheng | 017f438 | 2012-05-08 13:36:37 -0700 | [diff] [blame] | 371 | arch-arm/bionic/abort_arm.S \ |
David 'Digit' Turner | 0fec6b9 | 2011-11-16 17:37:15 +0100 | [diff] [blame] | 372 | arch-arm/bionic/atomics_arm.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 373 | arch-arm/bionic/clone.S \ |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 374 | arch-arm/bionic/eabi.c \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 375 | arch-arm/bionic/_exit_with_stack_teardown.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 376 | arch-arm/bionic/ffs.S \ |
David 'Digit' Turner | 0fec6b9 | 2011-11-16 17:37:15 +0100 | [diff] [blame] | 377 | arch-arm/bionic/futex_arm.S \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 378 | arch-arm/bionic/__get_sp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 379 | arch-arm/bionic/kill.S \ |
David 'Digit' Turner | 2a7ad97 | 2009-09-29 14:43:38 -0700 | [diff] [blame] | 380 | arch-arm/bionic/libgcc_compat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 381 | arch-arm/bionic/memcmp16.S \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 382 | arch-arm/bionic/memcmp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 383 | arch-arm/bionic/memcpy.S \ |
| 384 | arch-arm/bionic/memset.S \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 385 | arch-arm/bionic/_setjmp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 386 | arch-arm/bionic/setjmp.S \ |
| 387 | arch-arm/bionic/sigsetjmp.S \ |
Jim Huang | f50e9be | 2011-04-20 15:35:04 +0800 | [diff] [blame] | 388 | arch-arm/bionic/strcmp.S \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 389 | arch-arm/bionic/strcpy.S \ |
| 390 | arch-arm/bionic/strlen.c.arm \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 391 | arch-arm/bionic/syscall.S \ |
Elliott Hughes | a89864a | 2012-10-01 17:35:49 -0700 | [diff] [blame] | 392 | arch-arm/bionic/tgkill.S \ |
| 393 | arch-arm/bionic/tkill.S \ |
| 394 | bionic/memmove.c.arm \ |
| 395 | bionic/socketcalls.c \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 396 | string/bcopy.c \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 397 | string/strncmp.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 398 | |
| 399 | # These files need to be arm so that gdbserver |
| 400 | # can set breakpoints in them without messing |
| 401 | # up any thumb code. |
| 402 | libc_common_src_files += \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 403 | bionic/pthread-atfork.c.arm \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 404 | bionic/pthread-rwlocks.c.arm \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 405 | bionic/pthread-timers.c.arm \ |
| 406 | bionic/ptrace.c.arm |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 407 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 408 | libc_static_common_src_files += \ |
| 409 | bionic/pthread.c.arm \ |
| 410 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 411 | # these are used by the static and dynamic versions of the libc |
| 412 | # respectively |
| 413 | libc_arch_static_src_files := \ |
| 414 | arch-arm/bionic/exidx_static.c |
| 415 | |
| 416 | libc_arch_dynamic_src_files := \ |
| 417 | arch-arm/bionic/exidx_dynamic.c |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 418 | endif # arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 419 | |
| 420 | ifeq ($(TARGET_ARCH),x86) |
| 421 | libc_common_src_files += \ |
| 422 | arch-x86/bionic/__get_sp.S \ |
| 423 | arch-x86/bionic/__get_tls.c \ |
| 424 | arch-x86/bionic/__set_tls.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 425 | arch-x86/bionic/clone.S \ |
| 426 | arch-x86/bionic/_exit_with_stack_teardown.S \ |
David 'Digit' Turner | 0fec6b9 | 2011-11-16 17:37:15 +0100 | [diff] [blame] | 427 | arch-x86/bionic/futex_x86.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 428 | arch-x86/bionic/setjmp.S \ |
| 429 | arch-x86/bionic/_setjmp.S \ |
Chih-Wei Huang | 18635d9 | 2010-12-14 17:55:23 +0800 | [diff] [blame] | 430 | arch-x86/bionic/sigsetjmp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 431 | arch-x86/bionic/vfork.S \ |
Bruce Beare | 3c543e1 | 2010-03-04 10:29:38 -0800 | [diff] [blame] | 432 | arch-x86/bionic/syscall.S \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 433 | arch-x86/string/bcopy_wrapper.S \ |
| 434 | arch-x86/string/memcpy_wrapper.S \ |
| 435 | arch-x86/string/memmove_wrapper.S \ |
| 436 | arch-x86/string/bzero_wrapper.S \ |
| 437 | arch-x86/string/memcmp_wrapper.S \ |
| 438 | arch-x86/string/memset_wrapper.S \ |
| 439 | arch-x86/string/strcmp_wrapper.S \ |
| 440 | arch-x86/string/strncmp_wrapper.S \ |
Bruce Beare | 124a542 | 2010-10-11 12:24:41 -0700 | [diff] [blame] | 441 | arch-x86/string/strlen_wrapper.S \ |
Jim Huang | 73c04b3 | 2010-08-10 17:23:39 +0800 | [diff] [blame] | 442 | string/strcpy.c \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 443 | bionic/pthread-atfork.c \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 444 | bionic/pthread-rwlocks.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 445 | bionic/pthread-timers.c \ |
| 446 | bionic/ptrace.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 447 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 448 | libc_static_common_src_files += \ |
| 449 | bionic/pthread.c \ |
| 450 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 451 | libc_arch_static_src_files := \ |
Raghu Gandham | 405b802 | 2012-07-25 18:16:42 -0700 | [diff] [blame] | 452 | bionic/dl_iterate_phdr_static.c |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 453 | |
| 454 | libc_arch_dynamic_src_files := |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 455 | endif # x86 |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 456 | |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 457 | ifeq ($(TARGET_ARCH),mips) |
| 458 | libc_common_src_files += \ |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 459 | arch-mips/bionic/__get_sp.S \ |
| 460 | arch-mips/bionic/__get_tls.c \ |
| 461 | arch-mips/bionic/__set_tls.c \ |
| 462 | arch-mips/bionic/_exit_with_stack_teardown.S \ |
| 463 | arch-mips/bionic/_setjmp.S \ |
| 464 | arch-mips/bionic/futex_mips.S \ |
| 465 | arch-mips/bionic/bzero.S \ |
| 466 | arch-mips/bionic/cacheflush.c \ |
| 467 | arch-mips/bionic/clone.S \ |
| 468 | arch-mips/bionic/ffs.S \ |
| 469 | arch-mips/bionic/memcmp16.S \ |
| 470 | arch-mips/bionic/memmove.c \ |
| 471 | arch-mips/bionic/pipe.S \ |
| 472 | arch-mips/bionic/setjmp.S \ |
| 473 | arch-mips/bionic/sigsetjmp.S \ |
| 474 | arch-mips/bionic/vfork.S |
| 475 | |
| 476 | libc_common_src_files += \ |
| 477 | arch-mips/string/memset.S \ |
| 478 | arch-mips/string/memcpy.S \ |
| 479 | arch-mips/string/mips_strlen.c |
| 480 | |
| 481 | libc_common_src_files += \ |
Elliott Hughes | 857fed5 | 2012-10-02 11:20:07 -0700 | [diff] [blame] | 482 | bionic/memcmp.c \ |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 483 | string/bcopy.c \ |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 484 | string/strcmp.c \ |
| 485 | string/strcpy.c \ |
| 486 | string/strncmp.c |
| 487 | |
| 488 | libc_common_src_files += \ |
| 489 | bionic/pthread-atfork.c \ |
| 490 | bionic/pthread-rwlocks.c \ |
| 491 | bionic/pthread-timers.c \ |
| 492 | bionic/ptrace.c |
| 493 | |
| 494 | libc_static_common_src_files += \ |
| 495 | bionic/pthread.c |
| 496 | |
| 497 | libc_arch_static_src_files := \ |
| 498 | bionic/dl_iterate_phdr_static.c |
| 499 | |
| 500 | libc_arch_dynamic_src_files := |
| 501 | endif # mips |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 502 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 503 | # Define some common cflags |
| 504 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 505 | libc_common_cflags := \ |
Elliott Hughes | 470631e | 2012-06-06 10:32:56 -0700 | [diff] [blame] | 506 | -DWITH_ERRLIST \ |
| 507 | -DANDROID_CHANGES \ |
Elliott Hughes | 470631e | 2012-06-06 10:32:56 -0700 | [diff] [blame] | 508 | -D_LIBC=1 \ |
Elliott Hughes | 470631e | 2012-06-06 10:32:56 -0700 | [diff] [blame] | 509 | -DFLOATING_POINT \ |
| 510 | -DINET6 \ |
| 511 | -I$(LOCAL_PATH)/private \ |
Elliott Hughes | 470631e | 2012-06-06 10:32:56 -0700 | [diff] [blame] | 512 | -DPOSIX_MISTAKE \ |
| 513 | -DLOG_ON_HEAP_ERROR \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 514 | -std=gnu99 \ |
| 515 | -Wall -Wextra |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 516 | |
David 'Digit' Turner | d7ed1ae | 2010-03-05 14:17:35 -0800 | [diff] [blame] | 517 | # these macro definitions are required to implement the |
| 518 | # 'timezone' and 'daylight' global variables, as well as |
| 519 | # properly update the 'tm_gmtoff' field in 'struct tm'. |
| 520 | # |
| 521 | libc_common_cflags += \ |
| 522 | -DTM_GMTOFF=tm_gmtoff \ |
| 523 | -DUSG_COMPAT=1 |
| 524 | |
Dave Bort | d2c9dcc | 2009-04-23 15:50:03 -0700 | [diff] [blame] | 525 | ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 526 | libc_common_cflags += -DDEBUG |
| 527 | endif |
| 528 | |
Jack Ren | 2fd81ef | 2011-11-19 09:48:03 +0800 | [diff] [blame] | 529 | # To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in |
| 530 | # the appropriate BoardConfig.mk file. |
| 531 | # |
| 532 | ifneq ($(BOARD_MALLOC_ALIGNMENT),) |
| 533 | libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT) |
| 534 | endif |
| 535 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 536 | ifeq ($(TARGET_ARCH),arm) |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 537 | libc_common_cflags += -DSOFTFLOAT |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 538 | libc_common_cflags += -fstrict-aliasing |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 539 | libc_crt_target_cflags := -mthumb-interwork |
David 'Digit' Turner | 4a05d12 | 2009-09-18 13:35:05 -0700 | [diff] [blame] | 540 | # |
| 541 | # Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library |
| 542 | # that it should access the hardware TLS register directly in |
| 543 | # private/bionic_tls.h |
| 544 | # |
| 545 | # The value must match your kernel configuration |
| 546 | # |
| 547 | ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) |
| 548 | libc_common_cflags += -DHAVE_ARM_TLS_REGISTER |
| 549 | endif |
Henrik Smiding | fe6338d | 2010-09-15 16:08:03 +0200 | [diff] [blame] | 550 | # |
| 551 | # Define HAVE_32_BYTE_CACHE_LINES to indicate to C |
| 552 | # library it should use to 32-byte version of memcpy, and not |
| 553 | # the 64-byte version. |
| 554 | # |
| 555 | ifeq ($(ARCH_ARM_HAVE_32_BYTE_CACHE_LINES),true) |
| 556 | libc_common_cflags += -DHAVE_32_BYTE_CACHE_LINE |
| 557 | endif |
Prajakta Gudadhe | 08e72d0 | 2012-05-07 14:17:44 -0700 | [diff] [blame] | 558 | ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true) |
| 559 | libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY |
| 560 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 561 | endif # !arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 562 | |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 563 | ifeq ($(TARGET_ARCH),x86) |
| 564 | libc_common_cflags += -DSOFTFLOAT |
| 565 | libc_crt_target_cflags := |
| 566 | ifeq ($(ARCH_X86_HAVE_SSE2),true) |
| 567 | libc_crt_target_cflags += -DUSE_SSE2=1 |
| 568 | endif |
| 569 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
| 570 | libc_crt_target_cflags += -DUSE_SSSE3=1 |
| 571 | endif |
| 572 | endif # x86 |
| 573 | |
| 574 | ifeq ($(TARGET_ARCH),mips) |
| 575 | ifneq ($(ARCH_MIPS_HAS_FPU),true) |
| 576 | libc_common_cflags += -DSOFTFLOAT |
| 577 | endif |
| 578 | libc_common_cflags += -fstrict-aliasing |
| 579 | libc_crt_target_cflags := $(TARGET_GLOBAL_CFLAGS) |
| 580 | endif # mips |
| 581 | |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 582 | # Define ANDROID_SMP appropriately. |
| 583 | ifeq ($(TARGET_CPU_SMP),true) |
| 584 | libc_common_cflags += -DANDROID_SMP=1 |
| 585 | else |
| 586 | libc_common_cflags += -DANDROID_SMP=0 |
| 587 | endif |
| 588 | |
Elliott Hughes | 76be660 | 2012-08-08 14:07:37 -0700 | [diff] [blame] | 589 | # crtbrand.c needs <stdint.h> and a #define for the platform SDK version. |
| 590 | libc_crt_target_cflags += \ |
| 591 | -I$(LOCAL_PATH)/include \ |
| 592 | -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 593 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 594 | # Define some common includes |
| 595 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 596 | libc_common_c_includes := \ |
| 597 | $(LOCAL_PATH)/stdlib \ |
| 598 | $(LOCAL_PATH)/string \ |
Nick Kralevich | 76656af | 2012-06-07 16:30:02 -0700 | [diff] [blame] | 599 | $(LOCAL_PATH)/stdio \ |
| 600 | external/safe-iop/include |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 601 | |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 602 | # Needed to access private/__dso_handle.h from |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 603 | # crtbegin_xxx.S and crtend_xxx.S |
Elliott Hughes | 76be660 | 2012-08-08 14:07:37 -0700 | [diff] [blame] | 604 | libc_crt_target_cflags += \ |
| 605 | -I$(LOCAL_PATH)/private \ |
| 606 | -I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 607 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 608 | # Define the libc run-time (crt) support object files that must be built, |
| 609 | # which are needed to build all other objects (shared/static libs and |
| 610 | # executables) |
| 611 | # ========================================================================== |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 612 | # ARM, MIPS, and x86 all need crtbegin_so/crtend_so. |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 613 | # |
| 614 | # For x86, the .init section must point to a function that calls all |
| 615 | # entries in the .ctors section. (on ARM this is done through the |
| 616 | # .init_array section instead). |
| 617 | # |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 618 | # For all the platforms, the .fini_array section must point to a function |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 619 | # that will call __cxa_finalize(&__dso_handle) in order to ensure that |
| 620 | # static C++ destructors are properly called on dlclose(). |
| 621 | # |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 622 | ifeq ($(TARGET_ARCH),arm) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 623 | libc_crtbegin_extension := c |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 624 | libc_crt_target_so_cflags := |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 625 | endif |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 626 | ifeq ($(TARGET_ARCH),mips) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 627 | libc_crtbegin_extension := S |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 628 | libc_crt_target_so_cflags := -fPIC |
| 629 | endif |
| 630 | ifeq ($(TARGET_ARCH),x86) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 631 | libc_crtbegin_extension := S |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 632 | libc_crt_target_so_cflags := -fPIC |
| 633 | endif |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 634 | ifeq ($(libc_crtbegin_extension),) |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 635 | $(error $(TARGET_ARCH) not supported) |
| 636 | endif |
| 637 | libc_crt_target_so_cflags += $(libc_crt_target_cflags) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 638 | libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.$(libc_crtbegin_extension) |
| 639 | libc_crt_target_crtbegin_so_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.$(libc_crtbegin_extension) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 640 | |
| 641 | # See the comment in crtbrand.c for the reason why we need to generate |
| 642 | # crtbrand.s before generating crtbrand.o. |
| 643 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s |
| 644 | $(GEN): $(LOCAL_PATH)/bionic/crtbrand.c |
| 645 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 646 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -S \ |
| 647 | -MD -MF $(@:%.s=%.d) -o $@ $< |
| 648 | $(hide) sed -i -e '/\.note\.ABI-tag/s/progbits/note/' $@ |
| 649 | $(call transform-d-to-p-args,$(@:%.s=%.d),$(@:%.s=%.P)) |
| 650 | -include $(GEN:%.s=%.P) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 651 | ALL_GENERATED_SOURCES += $(GEN) |
| 652 | |
| 653 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o |
| 654 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s |
| 655 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 656 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $< |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 657 | ALL_GENERATED_SOURCES += $(GEN) |
| 658 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 659 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 660 | $(GEN): $(libc_crt_target_crtbegin_so_file) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 661 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 662 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \ |
| 663 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 664 | $(transform-d-to-p) |
| 665 | -include $(GEN:%.o=%.P) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 666 | ALL_GENERATED_SOURCES += $(GEN) |
| 667 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 668 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 669 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S |
| 670 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 671 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \ |
| 672 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 673 | $(transform-d-to-p) |
| 674 | -include $(GEN:%.o=%.P) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 675 | ALL_GENERATED_SOURCES += $(GEN) |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 676 | |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 677 | # The following two are installed to device |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 678 | GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 679 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o |
| 680 | $(hide) mkdir -p $(dir $@) && cp -f $< $@ |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 681 | ALL_GENERATED_SOURCES += $(GEN) |
| 682 | |
| 683 | GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 684 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o |
| 685 | $(hide) mkdir -p $(dir $@) && cp -f $< $@ |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 686 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 687 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 688 | |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 689 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 690 | $(GEN): $(libc_crt_target_crtbegin_file) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 691 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 692 | $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ |
| 693 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 694 | $(transform-d-to-p) |
| 695 | -include $(GEN:%.o=%.P) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 696 | ALL_GENERATED_SOURCES += $(GEN) |
| 697 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 698 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 699 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o |
| 700 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 701 | $(hide) $(TARGET_LD) -r -o $@ $^ |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 702 | ALL_GENERATED_SOURCES += $(GEN) |
| 703 | |
| 704 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 705 | $(GEN): $(libc_crt_target_crtbegin_file) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 706 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 707 | $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ |
| 708 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 709 | $(transform-d-to-p) |
| 710 | -include $(GEN:%.o=%.P) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 711 | ALL_GENERATED_SOURCES += $(GEN) |
| 712 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 713 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 714 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 715 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 716 | $(hide) $(TARGET_LD) -r -o $@ $^ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 717 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 718 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 719 | # We rename crtend.o to crtend_android.o to avoid a |
| 720 | # name clash between gcc and bionic. |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 721 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 722 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S |
| 723 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 724 | $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ |
| 725 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 726 | $(transform-d-to-p) |
| 727 | -include $(GEN:%.o=%.P) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 728 | ALL_GENERATED_SOURCES += $(GEN) |
| 729 | |
| 730 | |
| 731 | # To enable malloc leak check for statically linked programs, add |
| 732 | # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk |
| 733 | WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) |
| 734 | |
| 735 | # ======================================================== |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 736 | # libbionic_ssp.a - stack protector code |
| 737 | # ======================================================== |
| 738 | # |
| 739 | # The stack protector code needs to be compiled |
| 740 | # with -fno-stack-protector, since it modifies the |
| 741 | # stack canary. |
| 742 | |
| 743 | include $(CLEAR_VARS) |
| 744 | |
| 745 | LOCAL_SRC_FILES := bionic/ssp.c |
| 746 | LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector |
| 747 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 748 | LOCAL_MODULE := libbionic_ssp |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 749 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 750 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 751 | |
| 752 | include $(BUILD_STATIC_LIBRARY) |
| 753 | |
| 754 | |
| 755 | # ======================================================== |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 756 | # libc_netbsd.a - upstream NetBSD C library code |
| 757 | # ======================================================== |
| 758 | # |
| 759 | # These files are built with the netbsd-compat.h header file |
| 760 | # automatically included. |
| 761 | |
| 762 | include $(CLEAR_VARS) |
| 763 | |
| 764 | LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files) |
| 765 | LOCAL_CFLAGS := \ |
| 766 | $(libc_common_cflags) \ |
Elliott Hughes | 3d2d448 | 2012-08-13 16:38:29 -0700 | [diff] [blame] | 767 | -I$(LOCAL_PATH)/upstream-netbsd \ |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 768 | -include upstream-netbsd/netbsd-compat.h |
| 769 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 770 | LOCAL_MODULE := libc_netbsd |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 771 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 772 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 773 | |
| 774 | include $(BUILD_STATIC_LIBRARY) |
| 775 | |
| 776 | |
| 777 | # ======================================================== |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 778 | # libc_common.a |
| 779 | # ======================================================== |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 780 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 781 | include $(CLEAR_VARS) |
| 782 | |
| 783 | LOCAL_SRC_FILES := $(libc_common_src_files) |
| 784 | LOCAL_CFLAGS := $(libc_common_cflags) |
| 785 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 786 | LOCAL_MODULE := libc_common |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 787 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 788 | LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_netbsd |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 789 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 790 | |
| 791 | include $(BUILD_STATIC_LIBRARY) |
| 792 | |
| 793 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 794 | # ======================================================== |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 795 | # libc_nomalloc.a |
| 796 | # ======================================================== |
| 797 | # |
| 798 | # This is a version of the static C library that does not |
| 799 | # include malloc. It's useful in situations when calling |
| 800 | # the user wants to provide their own malloc implementation, |
| 801 | # or wants to explicitly disallow the use of the use of malloc, |
| 802 | # like the dynamic loader. |
| 803 | |
| 804 | include $(CLEAR_VARS) |
| 805 | |
| 806 | LOCAL_SRC_FILES := \ |
| 807 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 808 | $(libc_static_common_src_files) \ |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 809 | bionic/libc_init_static.c |
| 810 | |
| 811 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 812 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 813 | -DLIBC_STATIC |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 814 | |
| 815 | LOCAL_MODULE := libc_nomalloc |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 816 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 817 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 818 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 819 | |
| 820 | include $(BUILD_STATIC_LIBRARY) |
| 821 | |
| 822 | |
| 823 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 824 | # libc.a |
| 825 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 826 | include $(CLEAR_VARS) |
| 827 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 828 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 829 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 830 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 831 | bionic/dlmalloc.c \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 832 | bionic/malloc_debug_common.cpp \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 833 | bionic/libc_init_static.c |
| 834 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 835 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 836 | -DLIBC_STATIC |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 837 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 838 | LOCAL_MODULE := libc |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 839 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 840 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 841 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 842 | |
| 843 | include $(BUILD_STATIC_LIBRARY) |
| 844 | |
| 845 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 846 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 847 | # libc.so |
| 848 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 849 | include $(CLEAR_VARS) |
| 850 | |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 851 | # pthread deadlock prediction: |
| 852 | # set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for |
| 853 | # pthread deadlock prediction. |
| 854 | # Since this code is experimental it is disabled by default. |
| 855 | # see libc/bionic/pthread_debug.c for details |
| 856 | |
| 857 | LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 858 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 859 | |
| 860 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 861 | $(libc_arch_dynamic_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 862 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 863 | bionic/dlmalloc.c \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 864 | bionic/malloc_debug_common.cpp \ |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 865 | bionic/pthread_debug.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 866 | bionic/libc_init_dynamic.c |
| 867 | |
Ard Biesheuvel | f3cfcd8 | 2012-08-21 14:13:50 +0200 | [diff] [blame] | 868 | ifeq ($(TARGET_ARCH),arm) |
| 869 | LOCAL_NO_CRT := true |
| 870 | LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND |
| 871 | |
| 872 | LOCAL_SRC_FILES := \ |
| 873 | arch-arm/bionic/crtbegin_so.c \ |
| 874 | arch-arm/bionic/atexit_legacy.c \ |
| 875 | $(LOCAL_SRC_FILES) \ |
| 876 | arch-arm/bionic/crtend_so.S |
| 877 | endif |
| 878 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 879 | LOCAL_MODULE:= libc |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 880 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | 914d8d4 | 2012-10-18 11:28:56 -0700 | [diff] [blame^] | 881 | LOCAL_REQUIRED_MODULES := tzdata |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 882 | |
| 883 | # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 884 | # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 885 | # ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 886 | # external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 887 | # should, instead relying on the external symbols from the dependent libraries. That would |
| 888 | # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 889 | # you wanted! |
| 890 | |
| 891 | LOCAL_SHARED_LIBRARIES := libdl |
| 892 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 893 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 894 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 895 | include $(BUILD_SHARED_LIBRARY) |
| 896 | |
| 897 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 898 | # For all builds, except for the -user build we will enable memory |
| 899 | # allocation checking (including memory leaks, buffer overwrites, etc.) |
| 900 | # Note that all these checks are also controlled by env. settings |
| 901 | # that can enable, or disable specific checks. Note also that some of |
| 902 | # the checks are available only in emulator and are implemeted in |
| 903 | # libc_malloc_qemu_instrumented.so. |
| 904 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 905 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 906 | # ======================================================== |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 907 | # libc_malloc_debug_leak.so |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 908 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 909 | include $(CLEAR_VARS) |
| 910 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 911 | LOCAL_CFLAGS := \ |
| 912 | $(libc_common_cflags) \ |
| 913 | -DMALLOC_LEAK_CHECK |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 914 | |
| 915 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 916 | |
| 917 | LOCAL_SRC_FILES := \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 918 | bionic/malloc_debug_leak.cpp \ |
| 919 | bionic/malloc_debug_check.cpp \ |
| 920 | bionic/malloc_debug_check_mapinfo.cpp \ |
| 921 | bionic/malloc_debug_stacktrace.cpp |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 922 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 923 | LOCAL_MODULE:= libc_malloc_debug_leak |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 924 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 925 | |
Pavel Chupin | e007775 | 2012-09-10 19:35:25 +0400 | [diff] [blame] | 926 | LOCAL_SHARED_LIBRARIES := libc libdl |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 927 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 928 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Bruce Beare | aa46fa2 | 2010-07-08 14:47:50 -0700 | [diff] [blame] | 929 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
Iliyan Malchev | 3680704 | 2011-03-14 14:02:05 -0700 | [diff] [blame] | 930 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 931 | # Don't install on release build |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 932 | LOCAL_MODULE_TAGS := eng debug |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 933 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 934 | include $(BUILD_SHARED_LIBRARY) |
| 935 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 936 | |
| 937 | # ======================================================== |
| 938 | # libc_malloc_debug_qemu.so |
| 939 | # ======================================================== |
| 940 | include $(CLEAR_VARS) |
| 941 | |
| 942 | LOCAL_CFLAGS := \ |
| 943 | $(libc_common_cflags) \ |
| 944 | -DMALLOC_QEMU_INSTRUMENT |
| 945 | |
| 946 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 947 | |
| 948 | LOCAL_SRC_FILES := \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 949 | bionic/malloc_debug_qemu.cpp |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 950 | |
| 951 | LOCAL_MODULE:= libc_malloc_debug_qemu |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 952 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 953 | |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 954 | LOCAL_SHARED_LIBRARIES := libc libdl |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 955 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 956 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Iliyan Malchev | 3680704 | 2011-03-14 14:02:05 -0700 | [diff] [blame] | 957 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 958 | # Don't install on release build |
| 959 | LOCAL_MODULE_TAGS := eng debug |
| 960 | |
| 961 | include $(BUILD_SHARED_LIBRARY) |
| 962 | |
| 963 | endif #!user |
| 964 | |
| 965 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 966 | # ======================================================== |
| 967 | include $(call all-makefiles-under,$(LOCAL_PATH)) |