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