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