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