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