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 |
David 'Digit' Turner | 4a05d12 | 2009-09-18 13:35:05 -0700 | [diff] [blame] | 496 | # |
Elliott Hughes | 91a9925 | 2013-02-12 21:56:42 -0800 | [diff] [blame] | 497 | # Define HAVE_32_BYTE_CACHE_LINES to indicate to the C library |
| 498 | # that it should use the 32-byte version of memcpy, not |
Henrik Smiding | fe6338d | 2010-09-15 16:08:03 +0200 | [diff] [blame] | 499 | # the 64-byte version. |
| 500 | # |
| 501 | ifeq ($(ARCH_ARM_HAVE_32_BYTE_CACHE_LINES),true) |
| 502 | libc_common_cflags += -DHAVE_32_BYTE_CACHE_LINE |
| 503 | endif |
Prajakta Gudadhe | 08e72d0 | 2012-05-07 14:17:44 -0700 | [diff] [blame] | 504 | ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true) |
| 505 | libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY |
| 506 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 507 | endif # !arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 508 | |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 509 | ifeq ($(TARGET_ARCH),x86) |
| 510 | libc_common_cflags += -DSOFTFLOAT |
| 511 | libc_crt_target_cflags := |
| 512 | ifeq ($(ARCH_X86_HAVE_SSE2),true) |
| 513 | libc_crt_target_cflags += -DUSE_SSE2=1 |
| 514 | endif |
| 515 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
| 516 | libc_crt_target_cflags += -DUSE_SSSE3=1 |
| 517 | endif |
| 518 | endif # x86 |
| 519 | |
| 520 | ifeq ($(TARGET_ARCH),mips) |
| 521 | ifneq ($(ARCH_MIPS_HAS_FPU),true) |
| 522 | libc_common_cflags += -DSOFTFLOAT |
| 523 | endif |
| 524 | libc_common_cflags += -fstrict-aliasing |
| 525 | libc_crt_target_cflags := $(TARGET_GLOBAL_CFLAGS) |
| 526 | endif # mips |
| 527 | |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 528 | # Define ANDROID_SMP appropriately. |
| 529 | ifeq ($(TARGET_CPU_SMP),true) |
| 530 | libc_common_cflags += -DANDROID_SMP=1 |
| 531 | else |
| 532 | libc_common_cflags += -DANDROID_SMP=0 |
| 533 | endif |
| 534 | |
Elliott Hughes | 76be660 | 2012-08-08 14:07:37 -0700 | [diff] [blame] | 535 | # crtbrand.c needs <stdint.h> and a #define for the platform SDK version. |
| 536 | libc_crt_target_cflags += \ |
| 537 | -I$(LOCAL_PATH)/include \ |
| 538 | -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 539 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 540 | # Define some common includes |
| 541 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 542 | libc_common_c_includes := \ |
| 543 | $(LOCAL_PATH)/stdlib \ |
| 544 | $(LOCAL_PATH)/string \ |
Nick Kralevich | 76656af | 2012-06-07 16:30:02 -0700 | [diff] [blame] | 545 | $(LOCAL_PATH)/stdio \ |
| 546 | external/safe-iop/include |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 547 | |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 548 | # Needed to access private/__dso_handle.h from |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 549 | # crtbegin_xxx.S and crtend_xxx.S |
Elliott Hughes | 76be660 | 2012-08-08 14:07:37 -0700 | [diff] [blame] | 550 | libc_crt_target_cflags += \ |
| 551 | -I$(LOCAL_PATH)/private \ |
| 552 | -I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 553 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 554 | # Define the libc run-time (crt) support object files that must be built, |
| 555 | # which are needed to build all other objects (shared/static libs and |
| 556 | # executables) |
| 557 | # ========================================================================== |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 558 | # ARM, MIPS, and x86 all need crtbegin_so/crtend_so. |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 559 | # |
| 560 | # For x86, the .init section must point to a function that calls all |
| 561 | # entries in the .ctors section. (on ARM this is done through the |
| 562 | # .init_array section instead). |
| 563 | # |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 564 | # 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] | 565 | # that will call __cxa_finalize(&__dso_handle) in order to ensure that |
| 566 | # static C++ destructors are properly called on dlclose(). |
| 567 | # |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 568 | ifeq ($(TARGET_ARCH),arm) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 569 | libc_crtbegin_extension := c |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 570 | libc_crt_target_so_cflags := |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 571 | endif |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 572 | ifeq ($(TARGET_ARCH),mips) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 573 | libc_crtbegin_extension := S |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 574 | libc_crt_target_so_cflags := -fPIC |
| 575 | endif |
| 576 | ifeq ($(TARGET_ARCH),x86) |
Pavel Chupin | 20c4a3a | 2012-11-28 18:31:14 +0400 | [diff] [blame] | 577 | libc_crtbegin_extension := c |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 578 | libc_crt_target_so_cflags := -fPIC |
| 579 | endif |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 580 | ifeq ($(libc_crtbegin_extension),) |
Raghu Gandham | a4c7933 | 2012-08-07 12:23:24 -0700 | [diff] [blame] | 581 | $(error $(TARGET_ARCH) not supported) |
| 582 | endif |
| 583 | libc_crt_target_so_cflags += $(libc_crt_target_cflags) |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 584 | libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.$(libc_crtbegin_extension) |
| 585 | 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] | 586 | |
| 587 | # See the comment in crtbrand.c for the reason why we need to generate |
| 588 | # crtbrand.s before generating crtbrand.o. |
| 589 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s |
| 590 | $(GEN): $(LOCAL_PATH)/bionic/crtbrand.c |
| 591 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 592 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -S \ |
| 593 | -MD -MF $(@:%.s=%.d) -o $@ $< |
| 594 | $(hide) sed -i -e '/\.note\.ABI-tag/s/progbits/note/' $@ |
| 595 | $(call transform-d-to-p-args,$(@:%.s=%.d),$(@:%.s=%.P)) |
| 596 | -include $(GEN:%.s=%.P) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 597 | ALL_GENERATED_SOURCES += $(GEN) |
| 598 | |
| 599 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o |
| 600 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s |
| 601 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 602 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $< |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 603 | ALL_GENERATED_SOURCES += $(GEN) |
| 604 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 605 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 606 | $(GEN): $(libc_crt_target_crtbegin_so_file) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 607 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 608 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \ |
| 609 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 610 | $(transform-d-to-p) |
| 611 | -include $(GEN:%.o=%.P) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 612 | ALL_GENERATED_SOURCES += $(GEN) |
| 613 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 614 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 615 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S |
| 616 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 617 | $(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \ |
| 618 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 619 | $(transform-d-to-p) |
| 620 | -include $(GEN:%.o=%.P) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 621 | ALL_GENERATED_SOURCES += $(GEN) |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 622 | |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 623 | # The following two are installed to device |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 624 | GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 625 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o |
| 626 | $(hide) mkdir -p $(dir $@) && cp -f $< $@ |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 627 | ALL_GENERATED_SOURCES += $(GEN) |
| 628 | |
| 629 | GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 630 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o |
| 631 | $(hide) mkdir -p $(dir $@) && cp -f $< $@ |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 632 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 633 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 634 | |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 635 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 636 | $(GEN): $(libc_crt_target_crtbegin_file) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 637 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 638 | $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ |
| 639 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 640 | $(transform-d-to-p) |
| 641 | -include $(GEN:%.o=%.P) |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 642 | ALL_GENERATED_SOURCES += $(GEN) |
| 643 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 644 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 645 | $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o |
| 646 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 647 | $(hide) $(TARGET_LD) -r -o $@ $^ |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 648 | ALL_GENERATED_SOURCES += $(GEN) |
| 649 | |
| 650 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o |
Elliott Hughes | 12949e5 | 2012-09-10 11:16:12 -0700 | [diff] [blame] | 651 | $(GEN): $(libc_crt_target_crtbegin_file) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [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_cflags) \ |
| 654 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 655 | $(transform-d-to-p) |
| 656 | -include $(GEN:%.o=%.P) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 657 | ALL_GENERATED_SOURCES += $(GEN) |
| 658 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 659 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o |
Michael Hope | ea8fad1 | 2012-07-31 16:18:22 +1200 | [diff] [blame] | 660 | $(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] | 661 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 662 | $(hide) $(TARGET_LD) -r -o $@ $^ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 663 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 664 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 665 | # We rename crtend.o to crtend_android.o to avoid a |
| 666 | # name clash between gcc and bionic. |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 667 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 668 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S |
| 669 | @mkdir -p $(dir $@) |
Ying Wang | cf46487 | 2012-09-07 17:06:56 -0700 | [diff] [blame] | 670 | $(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ |
| 671 | -MD -MF $(@:%.o=%.d) -o $@ -c $< |
| 672 | $(transform-d-to-p) |
| 673 | -include $(GEN:%.o=%.P) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 674 | ALL_GENERATED_SOURCES += $(GEN) |
| 675 | |
| 676 | |
| 677 | # To enable malloc leak check for statically linked programs, add |
| 678 | # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk |
| 679 | WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) |
| 680 | |
| 681 | # ======================================================== |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 682 | # libbionic_ssp.a - stack protector code |
| 683 | # ======================================================== |
| 684 | # |
| 685 | # The stack protector code needs to be compiled |
| 686 | # with -fno-stack-protector, since it modifies the |
| 687 | # stack canary. |
| 688 | |
| 689 | include $(CLEAR_VARS) |
| 690 | |
Elliott Hughes | 642331b | 2013-03-06 15:03:53 -0800 | [diff] [blame] | 691 | LOCAL_SRC_FILES := bionic/__stack_chk_fail.cpp |
Elliott Hughes | dc5ec07 | 2013-02-14 11:15:58 -0800 | [diff] [blame] | 692 | LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector -Werror |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 693 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 694 | LOCAL_MODULE := libbionic_ssp |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 695 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 696 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 697 | |
| 698 | include $(BUILD_STATIC_LIBRARY) |
| 699 | |
| 700 | |
| 701 | # ======================================================== |
Elliott Hughes | f077784 | 2013-03-01 16:59:46 -0800 | [diff] [blame] | 702 | # libc_freebsd.a - upstream FreeBSD C library code |
| 703 | # ======================================================== |
| 704 | # |
| 705 | # These files are built with the freebsd-compat.h header file |
| 706 | # automatically included. |
| 707 | |
| 708 | include $(CLEAR_VARS) |
| 709 | |
| 710 | LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files) |
| 711 | LOCAL_CFLAGS := \ |
| 712 | $(libc_common_cflags) \ |
| 713 | -I$(LOCAL_PATH)/upstream-freebsd \ |
| 714 | -I$(LOCAL_PATH)/upstream-freebsd/libc/include \ |
| 715 | -include upstream-freebsd/freebsd-compat.h |
| 716 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 717 | LOCAL_MODULE := libc_freebsd |
| 718 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 719 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 720 | |
| 721 | include $(BUILD_STATIC_LIBRARY) |
| 722 | |
| 723 | |
| 724 | # ======================================================== |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 725 | # libc_netbsd.a - upstream NetBSD C library code |
| 726 | # ======================================================== |
| 727 | # |
| 728 | # These files are built with the netbsd-compat.h header file |
| 729 | # automatically included. |
| 730 | |
| 731 | include $(CLEAR_VARS) |
| 732 | |
| 733 | LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files) |
| 734 | LOCAL_CFLAGS := \ |
| 735 | $(libc_common_cflags) \ |
Elliott Hughes | 3d2d448 | 2012-08-13 16:38:29 -0700 | [diff] [blame] | 736 | -I$(LOCAL_PATH)/upstream-netbsd \ |
Elliott Hughes | ab44f52 | 2012-10-23 16:05:09 -0700 | [diff] [blame] | 737 | -I$(LOCAL_PATH)/upstream-netbsd/libc/include \ |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 738 | -include upstream-netbsd/netbsd-compat.h |
| 739 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 740 | LOCAL_MODULE := libc_netbsd |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 741 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 742 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 743 | |
| 744 | include $(BUILD_STATIC_LIBRARY) |
| 745 | |
| 746 | |
| 747 | # ======================================================== |
Elliott Hughes | 29c7f0b | 2012-10-22 17:05:27 -0700 | [diff] [blame] | 748 | # libc_bionic.a - home-grown C library code |
| 749 | # ======================================================== |
| 750 | # |
| 751 | include $(CLEAR_VARS) |
| 752 | |
| 753 | LOCAL_SRC_FILES := $(libc_bionic_src_files) |
| 754 | LOCAL_CFLAGS := $(libc_common_cflags) -Werror |
| 755 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 756 | LOCAL_MODULE := libc_bionic |
| 757 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 758 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 759 | |
| 760 | include $(BUILD_STATIC_LIBRARY) |
| 761 | |
| 762 | |
| 763 | # ======================================================== |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 764 | # libc_common.a |
| 765 | # ======================================================== |
Elliott Hughes | f8b3a92 | 2012-08-10 11:39:58 -0700 | [diff] [blame] | 766 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 767 | include $(CLEAR_VARS) |
| 768 | |
| 769 | LOCAL_SRC_FILES := $(libc_common_src_files) |
Elliott Hughes | ab44f52 | 2012-10-23 16:05:09 -0700 | [diff] [blame] | 770 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 771 | -std=gnu99 \ |
| 772 | -I$(LOCAL_PATH)/upstream-netbsd/libc/include # for netbsd private headers |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 773 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 774 | LOCAL_MODULE := libc_common |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 775 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | f077784 | 2013-03-01 16:59:46 -0800 | [diff] [blame] | 776 | 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] | 777 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 778 | |
| 779 | include $(BUILD_STATIC_LIBRARY) |
| 780 | |
| 781 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 782 | # ======================================================== |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 783 | # libc_nomalloc.a |
| 784 | # ======================================================== |
| 785 | # |
| 786 | # This is a version of the static C library that does not |
Elliott Hughes | 91a9925 | 2013-02-12 21:56:42 -0800 | [diff] [blame] | 787 | # include malloc. It's useful in situations when the user wants |
| 788 | # to provide their own malloc implementation, or wants to |
| 789 | # explicitly disallow the use of the use of malloc, |
| 790 | # such as in the dynamic loader. |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 791 | |
| 792 | include $(CLEAR_VARS) |
| 793 | |
| 794 | LOCAL_SRC_FILES := \ |
| 795 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 796 | $(libc_static_common_src_files) \ |
Elliott Hughes | 42b2c6a | 2013-02-07 10:14:39 -0800 | [diff] [blame] | 797 | bionic/libc_init_static.cpp |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 798 | |
| 799 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 800 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
Elliott Hughes | 29c7f0b | 2012-10-22 17:05:27 -0700 | [diff] [blame] | 801 | -DLIBC_STATIC \ |
| 802 | -std=gnu99 |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 803 | |
| 804 | LOCAL_MODULE := libc_nomalloc |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 805 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 806 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 807 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 808 | |
| 809 | include $(BUILD_STATIC_LIBRARY) |
| 810 | |
| 811 | |
| 812 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 813 | # libc.a |
| 814 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 815 | include $(CLEAR_VARS) |
| 816 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 817 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 818 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 819 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 820 | bionic/dlmalloc.c \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 821 | bionic/malloc_debug_common.cpp \ |
Elliott Hughes | 42b2c6a | 2013-02-07 10:14:39 -0800 | [diff] [blame] | 822 | bionic/libc_init_static.cpp |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 823 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 824 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
Elliott Hughes | 29c7f0b | 2012-10-22 17:05:27 -0700 | [diff] [blame] | 825 | -DLIBC_STATIC \ |
| 826 | -std=gnu99 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 827 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 828 | LOCAL_MODULE := libc |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 829 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 830 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 831 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 832 | |
| 833 | include $(BUILD_STATIC_LIBRARY) |
| 834 | |
| 835 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 836 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 837 | # libc.so |
| 838 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 839 | include $(CLEAR_VARS) |
| 840 | |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 841 | # pthread deadlock prediction: |
| 842 | # set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for |
| 843 | # pthread deadlock prediction. |
| 844 | # Since this code is experimental it is disabled by default. |
| 845 | # see libc/bionic/pthread_debug.c for details |
| 846 | |
Elliott Hughes | 29c7f0b | 2012-10-22 17:05:27 -0700 | [diff] [blame] | 847 | 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] | 848 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 849 | |
| 850 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 851 | $(libc_arch_dynamic_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 852 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 853 | bionic/dlmalloc.c \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 854 | bionic/malloc_debug_common.cpp \ |
Elliott Hughes | 1e980b6 | 2013-01-17 18:36:06 -0800 | [diff] [blame] | 855 | bionic/pthread_debug.cpp \ |
Elliott Hughes | 42b2c6a | 2013-02-07 10:14:39 -0800 | [diff] [blame] | 856 | bionic/libc_init_dynamic.cpp |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 857 | |
Ard Biesheuvel | f3cfcd8 | 2012-08-21 14:13:50 +0200 | [diff] [blame] | 858 | ifeq ($(TARGET_ARCH),arm) |
| 859 | LOCAL_NO_CRT := true |
| 860 | LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND |
| 861 | |
| 862 | LOCAL_SRC_FILES := \ |
| 863 | arch-arm/bionic/crtbegin_so.c \ |
| 864 | arch-arm/bionic/atexit_legacy.c \ |
| 865 | $(LOCAL_SRC_FILES) \ |
| 866 | arch-arm/bionic/crtend_so.S |
| 867 | endif |
| 868 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 869 | LOCAL_MODULE:= libc |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 870 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | 914d8d4 | 2012-10-18 11:28:56 -0700 | [diff] [blame] | 871 | LOCAL_REQUIRED_MODULES := tzdata |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 872 | |
| 873 | # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 874 | # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 875 | # ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 876 | # external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 877 | # should, instead relying on the external symbols from the dependent libraries. That would |
| 878 | # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 879 | # you wanted! |
| 880 | |
| 881 | LOCAL_SHARED_LIBRARIES := libdl |
| 882 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 883 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 884 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 885 | include $(BUILD_SHARED_LIBRARY) |
| 886 | |
| 887 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 888 | # For all builds, except for the -user build we will enable memory |
| 889 | # allocation checking (including memory leaks, buffer overwrites, etc.) |
| 890 | # Note that all these checks are also controlled by env. settings |
| 891 | # that can enable, or disable specific checks. Note also that some of |
| 892 | # the checks are available only in emulator and are implemeted in |
| 893 | # libc_malloc_qemu_instrumented.so. |
| 894 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 895 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 896 | # ======================================================== |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 897 | # libc_malloc_debug_leak.so |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 898 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 899 | include $(CLEAR_VARS) |
| 900 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 901 | LOCAL_CFLAGS := \ |
| 902 | $(libc_common_cflags) \ |
| 903 | -DMALLOC_LEAK_CHECK |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 904 | |
| 905 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 906 | |
| 907 | LOCAL_SRC_FILES := \ |
Elliott Hughes | 1e980b6 | 2013-01-17 18:36:06 -0800 | [diff] [blame] | 908 | bionic/debug_mapinfo.cpp \ |
| 909 | bionic/debug_stacktrace.cpp \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 910 | bionic/malloc_debug_leak.cpp \ |
| 911 | bionic/malloc_debug_check.cpp \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 912 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 913 | LOCAL_MODULE:= libc_malloc_debug_leak |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 914 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 915 | |
Pavel Chupin | e007775 | 2012-09-10 19:35:25 +0400 | [diff] [blame] | 916 | LOCAL_SHARED_LIBRARIES := libc libdl |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 917 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 918 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Bruce Beare | aa46fa2 | 2010-07-08 14:47:50 -0700 | [diff] [blame] | 919 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
Iliyan Malchev | 3680704 | 2011-03-14 14:02:05 -0700 | [diff] [blame] | 920 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 921 | # Don't install on release build |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 922 | LOCAL_MODULE_TAGS := eng debug |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 923 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 924 | include $(BUILD_SHARED_LIBRARY) |
| 925 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 926 | |
| 927 | # ======================================================== |
| 928 | # libc_malloc_debug_qemu.so |
| 929 | # ======================================================== |
| 930 | include $(CLEAR_VARS) |
| 931 | |
| 932 | LOCAL_CFLAGS := \ |
| 933 | $(libc_common_cflags) \ |
| 934 | -DMALLOC_QEMU_INSTRUMENT |
| 935 | |
| 936 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 937 | |
| 938 | LOCAL_SRC_FILES := \ |
Elliott Hughes | c4d1fec | 2012-08-28 14:15:04 -0700 | [diff] [blame] | 939 | bionic/malloc_debug_qemu.cpp |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 940 | |
| 941 | LOCAL_MODULE:= libc_malloc_debug_qemu |
Elliott Hughes | ae5c644 | 2012-08-13 14:06:05 -0700 | [diff] [blame] | 942 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 943 | |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 944 | LOCAL_SHARED_LIBRARIES := libc libdl |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 945 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 946 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Iliyan Malchev | 3680704 | 2011-03-14 14:02:05 -0700 | [diff] [blame] | 947 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 948 | # Don't install on release build |
| 949 | LOCAL_MODULE_TAGS := eng debug |
| 950 | |
| 951 | include $(BUILD_SHARED_LIBRARY) |
| 952 | |
| 953 | endif #!user |
| 954 | |
| 955 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 956 | # ======================================================== |
| 957 | include $(call all-makefiles-under,$(LOCAL_PATH)) |