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