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