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