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