The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | |
| 3 | include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 4 | |
| 5 | # Define the common source files for all the libc instances |
| 6 | # ========================================================= |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 7 | libc_common_src_files := \ |
| 8 | $(syscall_src) \ |
| 9 | unistd/abort.c \ |
| 10 | unistd/alarm.c \ |
| 11 | unistd/brk.c \ |
| 12 | unistd/creat.c \ |
| 13 | unistd/daemon.c \ |
David 'Digit' Turner | defd162 | 2010-09-26 22:29:14 +0200 | [diff] [blame] | 14 | unistd/eventfd.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | unistd/exec.c \ |
| 16 | unistd/fcntl.c \ |
| 17 | unistd/fnmatch.c \ |
David 'Digit' Turner | ab8b541 | 2010-07-08 16:52:27 -0700 | [diff] [blame] | 18 | unistd/fstatfs.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | unistd/ftime.c \ |
| 20 | unistd/ftok.c \ |
| 21 | unistd/getcwd.c \ |
| 22 | unistd/getdtablesize.c \ |
| 23 | unistd/gethostname.c \ |
| 24 | unistd/getopt_long.c \ |
| 25 | unistd/getpgrp.c \ |
| 26 | unistd/getpriority.c \ |
| 27 | unistd/getpt.c \ |
| 28 | unistd/initgroups.c \ |
| 29 | unistd/isatty.c \ |
| 30 | unistd/issetugid.c \ |
Colin Cross | 8c59d96 | 2010-01-13 16:39:26 -0800 | [diff] [blame] | 31 | unistd/killpg.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 32 | unistd/lseek64.c \ |
| 33 | unistd/mmap.c \ |
| 34 | unistd/nice.c \ |
| 35 | unistd/open.c \ |
| 36 | unistd/openat.c \ |
| 37 | unistd/opendir.c \ |
| 38 | unistd/pathconf.c \ |
| 39 | unistd/perror.c \ |
| 40 | unistd/popen.c \ |
| 41 | unistd/pread.c \ |
| 42 | unistd/pselect.c \ |
| 43 | unistd/ptsname.c \ |
| 44 | unistd/ptsname_r.c \ |
| 45 | unistd/pwrite.c \ |
| 46 | unistd/raise.c \ |
| 47 | unistd/reboot.c \ |
| 48 | unistd/recv.c \ |
| 49 | unistd/sbrk.c \ |
| 50 | unistd/send.c \ |
| 51 | unistd/setegid.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 52 | unistd/setuid.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 53 | unistd/seteuid.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 54 | unistd/setreuid.c \ |
| 55 | unistd/setresuid.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | unistd/setpgrp.c \ |
| 57 | unistd/sigblock.c \ |
| 58 | unistd/siginterrupt.c \ |
| 59 | unistd/siglist.c \ |
| 60 | unistd/signal.c \ |
Thorsten Glaser | 92b10af | 2009-10-02 15:39:00 +0200 | [diff] [blame] | 61 | unistd/signame.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 62 | unistd/sigsetmask.c \ |
| 63 | unistd/sigsuspend.c \ |
| 64 | unistd/sigwait.c \ |
| 65 | unistd/sleep.c \ |
| 66 | unistd/statfs.c \ |
| 67 | unistd/strsignal.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 68 | unistd/syslog.c \ |
| 69 | unistd/system.c \ |
| 70 | unistd/tcgetpgrp.c \ |
| 71 | unistd/tcsetpgrp.c \ |
| 72 | unistd/time.c \ |
| 73 | unistd/umount.c \ |
| 74 | unistd/unlockpt.c \ |
| 75 | unistd/usleep.c \ |
| 76 | unistd/wait.c \ |
| 77 | stdio/asprintf.c \ |
| 78 | stdio/clrerr.c \ |
| 79 | stdio/fclose.c \ |
| 80 | stdio/fdopen.c \ |
| 81 | stdio/feof.c \ |
| 82 | stdio/ferror.c \ |
| 83 | stdio/fflush.c \ |
| 84 | stdio/fgetc.c \ |
| 85 | stdio/fgetln.c \ |
| 86 | stdio/fgetpos.c \ |
| 87 | stdio/fgets.c \ |
| 88 | stdio/fileno.c \ |
| 89 | stdio/findfp.c \ |
| 90 | stdio/flags.c \ |
| 91 | stdio/flockfile.c \ |
| 92 | stdio/fopen.c \ |
| 93 | stdio/fprintf.c \ |
| 94 | stdio/fpurge.c \ |
| 95 | stdio/fputc.c \ |
| 96 | stdio/fputs.c \ |
| 97 | stdio/fread.c \ |
| 98 | stdio/freopen.c \ |
| 99 | stdio/fscanf.c \ |
| 100 | stdio/fseek.c \ |
| 101 | stdio/fsetpos.c \ |
| 102 | stdio/ftell.c \ |
| 103 | stdio/funopen.c \ |
| 104 | stdio/fvwrite.c \ |
| 105 | stdio/fwalk.c \ |
| 106 | stdio/fwrite.c \ |
| 107 | stdio/getc.c \ |
| 108 | stdio/getchar.c \ |
| 109 | stdio/gets.c \ |
| 110 | stdio/makebuf.c \ |
| 111 | stdio/mktemp.c \ |
| 112 | stdio/printf.c \ |
| 113 | stdio/putc.c \ |
| 114 | stdio/putchar.c \ |
| 115 | stdio/puts.c \ |
| 116 | stdio/putw.c \ |
| 117 | stdio/refill.c \ |
| 118 | stdio/remove.c \ |
| 119 | stdio/rewind.c \ |
| 120 | stdio/rget.c \ |
| 121 | stdio/scanf.c \ |
| 122 | stdio/setbuf.c \ |
| 123 | stdio/setbuffer.c \ |
| 124 | stdio/setvbuf.c \ |
| 125 | stdio/snprintf.c\ |
| 126 | stdio/sprintf.c \ |
| 127 | stdio/sscanf.c \ |
| 128 | stdio/stdio.c \ |
| 129 | stdio/tempnam.c \ |
| 130 | stdio/tmpfile.c \ |
| 131 | stdio/tmpnam.c \ |
| 132 | stdio/ungetc.c \ |
| 133 | stdio/vasprintf.c \ |
| 134 | stdio/vfprintf.c \ |
| 135 | stdio/vfscanf.c \ |
| 136 | stdio/vprintf.c \ |
| 137 | stdio/vsnprintf.c \ |
| 138 | stdio/vsprintf.c \ |
| 139 | stdio/vscanf.c \ |
| 140 | stdio/vsscanf.c \ |
| 141 | stdio/wbuf.c \ |
| 142 | stdio/wsetup.c \ |
Nick Kralevich | 965dbc6 | 2012-07-03 11:45:31 -0700 | [diff] [blame] | 143 | stdio/__fgets_chk.c \ |
Nick Kralevich | cffdf66 | 2012-06-11 15:50:57 -0700 | [diff] [blame] | 144 | stdio/__snprintf_chk.c \ |
Nick Kralevich | 9b549c3 | 2012-06-12 15:59:04 -0700 | [diff] [blame] | 145 | stdio/__sprintf_chk.c \ |
Nick Kralevich | cffdf66 | 2012-06-11 15:50:57 -0700 | [diff] [blame] | 146 | stdio/__vsnprintf_chk.c \ |
Nick Kralevich | 9b549c3 | 2012-06-12 15:59:04 -0700 | [diff] [blame] | 147 | stdio/__vsprintf_chk.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 148 | stdlib/_rand48.c \ |
| 149 | stdlib/assert.c \ |
| 150 | stdlib/atexit.c \ |
| 151 | stdlib/atoi.c \ |
| 152 | stdlib/atol.c \ |
| 153 | stdlib/atoll.c \ |
| 154 | stdlib/bsearch.c \ |
| 155 | stdlib/ctype_.c \ |
| 156 | stdlib/div.c \ |
| 157 | stdlib/exit.c \ |
| 158 | stdlib/getenv.c \ |
| 159 | stdlib/jrand48.c \ |
| 160 | stdlib/ldiv.c \ |
| 161 | stdlib/lldiv.c \ |
| 162 | stdlib/locale.c \ |
| 163 | stdlib/lrand48.c \ |
| 164 | stdlib/mrand48.c \ |
| 165 | stdlib/nrand48.c \ |
| 166 | stdlib/putenv.c \ |
| 167 | stdlib/qsort.c \ |
| 168 | stdlib/seed48.c \ |
| 169 | stdlib/setenv.c \ |
| 170 | stdlib/setjmperr.c \ |
| 171 | stdlib/srand48.c \ |
| 172 | stdlib/strntoimax.c \ |
| 173 | stdlib/strntoumax.c \ |
| 174 | stdlib/strtod.c \ |
| 175 | stdlib/strtoimax.c \ |
| 176 | stdlib/strtol.c \ |
| 177 | stdlib/strtoll.c \ |
| 178 | stdlib/strtoul.c \ |
| 179 | stdlib/strtoull.c \ |
| 180 | stdlib/strtoumax.c \ |
| 181 | stdlib/tolower_.c \ |
| 182 | stdlib/toupper_.c \ |
| 183 | stdlib/wchar.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 184 | string/index.c \ |
| 185 | string/memccpy.c \ |
| 186 | string/memchr.c \ |
| 187 | string/memmem.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 188 | string/memrchr.c \ |
| 189 | string/memswap.c \ |
| 190 | string/strcasecmp.c \ |
| 191 | string/strcasestr.c \ |
| 192 | string/strcat.c \ |
| 193 | string/strchr.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 194 | string/strcoll.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 195 | string/strcspn.c \ |
| 196 | string/strdup.c \ |
| 197 | string/strerror.c \ |
| 198 | string/strerror_r.c \ |
| 199 | string/strlcat.c \ |
| 200 | string/strlcpy.c \ |
| 201 | string/strncat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 202 | string/strncpy.c \ |
| 203 | string/strndup.c \ |
| 204 | string/strnlen.c \ |
| 205 | string/strpbrk.c \ |
| 206 | string/strrchr.c \ |
| 207 | string/strsep.c \ |
| 208 | string/strspn.c \ |
| 209 | string/strstr.c \ |
| 210 | string/strtok.c \ |
| 211 | string/strtotimeval.c \ |
| 212 | string/strxfrm.c \ |
Nick Kralevich | 0a23015 | 2012-06-04 15:20:25 -0700 | [diff] [blame] | 213 | string/__memcpy_chk.c \ |
| 214 | string/__memmove_chk.c \ |
Nick Kralevich | 71a18dd | 2012-06-07 14:01:26 -0700 | [diff] [blame] | 215 | string/__memset_chk.c \ |
Nick Kralevich | 0a23015 | 2012-06-04 15:20:25 -0700 | [diff] [blame] | 216 | string/__strcat_chk.c \ |
| 217 | string/__strcpy_chk.c \ |
Nick Kralevich | 8df49ad | 2012-06-13 16:57:27 -0700 | [diff] [blame] | 218 | string/__strlcat_chk.c \ |
| 219 | string/__strlcpy_chk.c \ |
Nick Kralevich | 260bf8c | 2012-07-13 11:27:06 -0700 | [diff] [blame] | 220 | string/__strlen_chk.c \ |
Nick Kralevich | 0a23015 | 2012-06-04 15:20:25 -0700 | [diff] [blame] | 221 | string/__strncat_chk.c \ |
| 222 | string/__strncpy_chk.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 223 | wchar/wcpcpy.c \ |
| 224 | wchar/wcpncpy.c \ |
| 225 | wchar/wcscasecmp.c \ |
| 226 | wchar/wcscat.c \ |
| 227 | wchar/wcschr.c \ |
| 228 | wchar/wcscmp.c \ |
| 229 | wchar/wcscoll.c \ |
| 230 | wchar/wcscpy.c \ |
| 231 | wchar/wcscspn.c \ |
| 232 | wchar/wcsdup.c \ |
| 233 | wchar/wcslcat.c \ |
| 234 | wchar/wcslcpy.c \ |
| 235 | wchar/wcslen.c \ |
| 236 | wchar/wcsncasecmp.c \ |
| 237 | wchar/wcsncat.c \ |
| 238 | wchar/wcsncmp.c \ |
| 239 | wchar/wcsncpy.c \ |
| 240 | wchar/wcsnlen.c \ |
| 241 | wchar/wcspbrk.c \ |
| 242 | wchar/wcsrchr.c \ |
| 243 | wchar/wcsspn.c \ |
| 244 | wchar/wcsstr.c \ |
| 245 | wchar/wcstok.c \ |
| 246 | wchar/wcswidth.c \ |
Kristian Monsen | 7046561 | 2010-06-16 14:51:52 +0100 | [diff] [blame] | 247 | wchar/wcsxfrm.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 248 | wchar/wmemchr.c \ |
Kristian Monsen | 7046561 | 2010-06-16 14:51:52 +0100 | [diff] [blame] | 249 | wchar/wmemcmp.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 250 | wchar/wmemcpy.c \ |
| 251 | wchar/wmemmove.c \ |
| 252 | wchar/wmemset.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 253 | inet/bindresvport.c \ |
| 254 | inet/inet_addr.c \ |
| 255 | inet/inet_aton.c \ |
| 256 | inet/inet_ntoa.c \ |
| 257 | inet/inet_ntop.c \ |
| 258 | inet/inet_pton.c \ |
Szymon Jakubczak | 41e533a | 2010-06-09 15:53:28 -0400 | [diff] [blame] | 259 | inet/ether_aton.c \ |
| 260 | inet/ether_ntoa.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 261 | tzcode/asctime.c \ |
| 262 | tzcode/difftime.c \ |
| 263 | tzcode/localtime.c \ |
| 264 | tzcode/strftime.c \ |
| 265 | tzcode/strptime.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 266 | bionic/__set_errno.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 267 | bionic/cpuacct.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 268 | bionic/arc4random.c \ |
| 269 | bionic/basename.c \ |
| 270 | bionic/basename_r.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 271 | bionic/clearenv.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 272 | bionic/dirname.c \ |
| 273 | bionic/dirname_r.c \ |
| 274 | bionic/drand48.c \ |
| 275 | bionic/erand48.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 276 | bionic/err.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 277 | bionic/fdprintf.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 278 | bionic/fork.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 279 | bionic/fts.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 280 | bionic/if_nametoindex.c \ |
| 281 | bionic/if_indextoname.c \ |
| 282 | bionic/ioctl.c \ |
| 283 | bionic/ldexp.c \ |
| 284 | bionic/libc_init_common.c \ |
| 285 | bionic/logd_write.c \ |
| 286 | bionic/md5.c \ |
Andy McFadden | 4ce737f | 2011-02-04 14:45:57 -0800 | [diff] [blame] | 287 | bionic/memmove_words.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 288 | bionic/pututline.c \ |
| 289 | bionic/realpath.c \ |
David 'Digit' Turner | 72e6fd4 | 2010-12-03 18:04:01 +0100 | [diff] [blame] | 290 | bionic/sched_getaffinity.c \ |
| 291 | bionic/sched_getcpu.c \ |
| 292 | bionic/sched_cpualloc.c \ |
| 293 | bionic/sched_cpucount.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 294 | bionic/semaphore.c \ |
| 295 | bionic/sha1.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 296 | bionic/stubs.c \ |
| 297 | bionic/system_properties.c \ |
Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 298 | bionic/tdelete.c \ |
| 299 | bionic/tdestroy.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 300 | bionic/time64.c \ |
Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 301 | bionic/tfind.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 302 | bionic/thread_atexit.c \ |
Ben Cheng | 21eab51 | 2012-03-13 23:04:57 -0700 | [diff] [blame] | 303 | bionic/tsearch.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 304 | bionic/utime.c \ |
| 305 | bionic/utmp.c \ |
| 306 | netbsd/gethnamaddr.c \ |
| 307 | netbsd/isc/ev_timers.c \ |
| 308 | netbsd/isc/ev_streams.c \ |
| 309 | netbsd/inet/nsap_addr.c \ |
| 310 | netbsd/resolv/__dn_comp.c \ |
| 311 | netbsd/resolv/__res_close.c \ |
| 312 | netbsd/resolv/__res_send.c \ |
| 313 | netbsd/resolv/herror.c \ |
| 314 | netbsd/resolv/res_comp.c \ |
| 315 | netbsd/resolv/res_data.c \ |
| 316 | netbsd/resolv/res_debug.c \ |
| 317 | netbsd/resolv/res_init.c \ |
| 318 | netbsd/resolv/res_mkquery.c \ |
| 319 | netbsd/resolv/res_query.c \ |
| 320 | netbsd/resolv/res_send.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 321 | netbsd/resolv/res_state.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 322 | netbsd/resolv/res_cache.c \ |
| 323 | netbsd/net/nsdispatch.c \ |
| 324 | netbsd/net/getaddrinfo.c \ |
| 325 | netbsd/net/getnameinfo.c \ |
| 326 | netbsd/net/getservbyname.c \ |
| 327 | netbsd/net/getservent.c \ |
| 328 | netbsd/net/base64.c \ |
| 329 | netbsd/net/getservbyport.c \ |
| 330 | netbsd/nameser/ns_name.c \ |
| 331 | netbsd/nameser/ns_parse.c \ |
| 332 | netbsd/nameser/ns_ttl.c \ |
| 333 | netbsd/nameser/ns_netint.c \ |
| 334 | netbsd/nameser/ns_print.c \ |
Colin Cross | 4fa7b10 | 2010-01-12 18:59:25 -0800 | [diff] [blame] | 335 | netbsd/nameser/ns_samedomain.c \ |
| 336 | regex/regcomp.c \ |
| 337 | regex/regerror.c \ |
| 338 | regex/regexec.c \ |
| 339 | regex/regfree.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 340 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 341 | # The following files are common, but must be compiled |
| 342 | # with different C flags when building a static C library. |
| 343 | # |
| 344 | # The reason for this is the implementation of __get_tls() |
| 345 | # that will differ between the shared and static versions |
| 346 | # of the library. |
| 347 | # |
| 348 | # See comments in private/bionic_tls.h for more details. |
| 349 | # |
| 350 | # NOTE: bionic/pthread.c is added later to this list |
| 351 | # because it needs special handling on ARM, see |
| 352 | # below. |
| 353 | # |
| 354 | libc_static_common_src_files := \ |
| 355 | unistd/sysconf.c \ |
| 356 | bionic/__errno.c \ |
| 357 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 358 | # Architecture specific source files go here |
| 359 | # ========================================================= |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 360 | ifeq ($(TARGET_ARCH),arm) |
| 361 | libc_common_src_files += \ |
David 'Digit' Turner | 97cf7f3 | 2010-01-22 18:59:05 -0800 | [diff] [blame] | 362 | bionic/bionic_clone.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 363 | arch-arm/bionic/__get_pc.S \ |
| 364 | arch-arm/bionic/__get_sp.S \ |
| 365 | arch-arm/bionic/_exit_with_stack_teardown.S \ |
| 366 | arch-arm/bionic/_setjmp.S \ |
Ben Cheng | 017f438 | 2012-05-08 13:36:37 -0700 | [diff] [blame] | 367 | arch-arm/bionic/abort_arm.S \ |
David 'Digit' Turner | 0fec6b9 | 2011-11-16 17:37:15 +0100 | [diff] [blame] | 368 | arch-arm/bionic/atomics_arm.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 369 | arch-arm/bionic/clone.S \ |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 370 | arch-arm/bionic/eabi.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 371 | arch-arm/bionic/ffs.S \ |
David 'Digit' Turner | 0fec6b9 | 2011-11-16 17:37:15 +0100 | [diff] [blame] | 372 | arch-arm/bionic/futex_arm.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 373 | arch-arm/bionic/kill.S \ |
David 'Digit' Turner | 2a7ad97 | 2009-09-29 14:43:38 -0700 | [diff] [blame] | 374 | arch-arm/bionic/libgcc_compat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 375 | arch-arm/bionic/tkill.S \ |
Jeff Brown | 10c8ce5 | 2011-11-18 15:17:07 -0800 | [diff] [blame] | 376 | arch-arm/bionic/tgkill.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 377 | arch-arm/bionic/memcmp.S \ |
| 378 | arch-arm/bionic/memcmp16.S \ |
| 379 | arch-arm/bionic/memcpy.S \ |
| 380 | arch-arm/bionic/memset.S \ |
| 381 | arch-arm/bionic/setjmp.S \ |
| 382 | arch-arm/bionic/sigsetjmp.S \ |
| 383 | arch-arm/bionic/strlen.c.arm \ |
Jim Huang | 73c04b3 | 2010-08-10 17:23:39 +0800 | [diff] [blame] | 384 | arch-arm/bionic/strcpy.S \ |
Jim Huang | f50e9be | 2011-04-20 15:35:04 +0800 | [diff] [blame] | 385 | arch-arm/bionic/strcmp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 386 | arch-arm/bionic/syscall.S \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 387 | string/memmove.c.arm \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 388 | string/bcopy.c \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 389 | string/strncmp.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 390 | unistd/socketcalls.c |
| 391 | |
| 392 | # These files need to be arm so that gdbserver |
| 393 | # can set breakpoints in them without messing |
| 394 | # up any thumb code. |
| 395 | libc_common_src_files += \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 396 | bionic/pthread-atfork.c.arm \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 397 | bionic/pthread-rwlocks.c.arm \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 398 | bionic/pthread-timers.c.arm \ |
| 399 | bionic/ptrace.c.arm |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 400 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 401 | libc_static_common_src_files += \ |
| 402 | bionic/pthread.c.arm \ |
| 403 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 404 | # these are used by the static and dynamic versions of the libc |
| 405 | # respectively |
| 406 | libc_arch_static_src_files := \ |
| 407 | arch-arm/bionic/exidx_static.c |
| 408 | |
| 409 | libc_arch_dynamic_src_files := \ |
| 410 | arch-arm/bionic/exidx_dynamic.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 411 | else # !arm |
| 412 | |
| 413 | ifeq ($(TARGET_ARCH),x86) |
| 414 | libc_common_src_files += \ |
| 415 | arch-x86/bionic/__get_sp.S \ |
| 416 | arch-x86/bionic/__get_tls.c \ |
| 417 | arch-x86/bionic/__set_tls.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 418 | arch-x86/bionic/clone.S \ |
| 419 | arch-x86/bionic/_exit_with_stack_teardown.S \ |
David 'Digit' Turner | 0fec6b9 | 2011-11-16 17:37:15 +0100 | [diff] [blame] | 420 | arch-x86/bionic/futex_x86.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 421 | arch-x86/bionic/setjmp.S \ |
| 422 | arch-x86/bionic/_setjmp.S \ |
Chih-Wei Huang | 18635d9 | 2010-12-14 17:55:23 +0800 | [diff] [blame] | 423 | arch-x86/bionic/sigsetjmp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 424 | arch-x86/bionic/vfork.S \ |
Bruce Beare | 3c543e1 | 2010-03-04 10:29:38 -0800 | [diff] [blame] | 425 | arch-x86/bionic/syscall.S \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 426 | arch-x86/string/bcopy_wrapper.S \ |
| 427 | arch-x86/string/memcpy_wrapper.S \ |
| 428 | arch-x86/string/memmove_wrapper.S \ |
| 429 | arch-x86/string/bzero_wrapper.S \ |
| 430 | arch-x86/string/memcmp_wrapper.S \ |
| 431 | arch-x86/string/memset_wrapper.S \ |
| 432 | arch-x86/string/strcmp_wrapper.S \ |
| 433 | arch-x86/string/strncmp_wrapper.S \ |
Bruce Beare | 124a542 | 2010-10-11 12:24:41 -0700 | [diff] [blame] | 434 | arch-x86/string/strlen_wrapper.S \ |
Jim Huang | 73c04b3 | 2010-08-10 17:23:39 +0800 | [diff] [blame] | 435 | string/strcpy.c \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 436 | bionic/pthread-atfork.c \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 437 | bionic/pthread-rwlocks.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 438 | bionic/pthread-timers.c \ |
| 439 | bionic/ptrace.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 440 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 441 | libc_static_common_src_files += \ |
| 442 | bionic/pthread.c \ |
| 443 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 444 | libc_arch_static_src_files := \ |
Raghu Gandham | 405b802 | 2012-07-25 18:16:42 -0700 | [diff] [blame^] | 445 | bionic/dl_iterate_phdr_static.c |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 446 | |
| 447 | libc_arch_dynamic_src_files := |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 448 | else # !x86 |
| 449 | |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 450 | endif # !x86 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 451 | endif # !arm |
| 452 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 453 | # Define some common cflags |
| 454 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 455 | libc_common_cflags := \ |
Elliott Hughes | 470631e | 2012-06-06 10:32:56 -0700 | [diff] [blame] | 456 | -DWITH_ERRLIST \ |
| 457 | -DANDROID_CHANGES \ |
| 458 | -DUSE_LOCKS \ |
| 459 | -DREALLOC_ZERO_BYTES_FREES \ |
| 460 | -D_LIBC=1 \ |
| 461 | -DSOFTFLOAT \ |
| 462 | -DFLOATING_POINT \ |
| 463 | -DINET6 \ |
| 464 | -I$(LOCAL_PATH)/private \ |
| 465 | -DUSE_DL_PREFIX \ |
| 466 | -DPOSIX_MISTAKE \ |
| 467 | -DLOG_ON_HEAP_ERROR \ |
| 468 | -std=gnu99 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 469 | |
David 'Digit' Turner | d7ed1ae | 2010-03-05 14:17:35 -0800 | [diff] [blame] | 470 | # these macro definitions are required to implement the |
| 471 | # 'timezone' and 'daylight' global variables, as well as |
| 472 | # properly update the 'tm_gmtoff' field in 'struct tm'. |
| 473 | # |
| 474 | libc_common_cflags += \ |
| 475 | -DTM_GMTOFF=tm_gmtoff \ |
| 476 | -DUSG_COMPAT=1 |
| 477 | |
Dave Bort | d2c9dcc | 2009-04-23 15:50:03 -0700 | [diff] [blame] | 478 | ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 479 | libc_common_cflags += -DDEBUG |
| 480 | endif |
| 481 | |
Jack Ren | 2fd81ef | 2011-11-19 09:48:03 +0800 | [diff] [blame] | 482 | # To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in |
| 483 | # the appropriate BoardConfig.mk file. |
| 484 | # |
| 485 | ifneq ($(BOARD_MALLOC_ALIGNMENT),) |
| 486 | libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT) |
| 487 | endif |
| 488 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 489 | ifeq ($(TARGET_ARCH),arm) |
| 490 | libc_common_cflags += -fstrict-aliasing |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 491 | libc_crt_target_cflags := -mthumb-interwork |
David 'Digit' Turner | 4a05d12 | 2009-09-18 13:35:05 -0700 | [diff] [blame] | 492 | # |
| 493 | # Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library |
| 494 | # that it should access the hardware TLS register directly in |
| 495 | # private/bionic_tls.h |
| 496 | # |
| 497 | # The value must match your kernel configuration |
| 498 | # |
| 499 | ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) |
| 500 | libc_common_cflags += -DHAVE_ARM_TLS_REGISTER |
| 501 | endif |
Henrik Smiding | fe6338d | 2010-09-15 16:08:03 +0200 | [diff] [blame] | 502 | # |
| 503 | # Define HAVE_32_BYTE_CACHE_LINES to indicate to C |
| 504 | # library it should use to 32-byte version of memcpy, and not |
| 505 | # the 64-byte version. |
| 506 | # |
| 507 | ifeq ($(ARCH_ARM_HAVE_32_BYTE_CACHE_LINES),true) |
| 508 | libc_common_cflags += -DHAVE_32_BYTE_CACHE_LINE |
| 509 | endif |
Prajakta Gudadhe | 08e72d0 | 2012-05-07 14:17:44 -0700 | [diff] [blame] | 510 | ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true) |
| 511 | libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY |
| 512 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 513 | else # !arm |
| 514 | ifeq ($(TARGET_ARCH),x86) |
Bruce Beare | af96d4d | 2011-12-09 13:52:19 -0800 | [diff] [blame] | 515 | libc_crt_target_cflags := |
David 'Digit' Turner | a5cb76b | 2011-12-14 18:23:40 +0100 | [diff] [blame] | 516 | ifeq ($(ARCH_X86_HAVE_SSE2),true) |
| 517 | libc_crt_target_cflags += -DUSE_SSE2=1 |
| 518 | endif |
| 519 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) |
| 520 | libc_crt_target_cflags += -DUSE_SSSE3=1 |
| 521 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 522 | endif # x86 |
| 523 | endif # !arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 524 | |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 525 | # Define ANDROID_SMP appropriately. |
| 526 | ifeq ($(TARGET_CPU_SMP),true) |
| 527 | libc_common_cflags += -DANDROID_SMP=1 |
| 528 | else |
| 529 | libc_common_cflags += -DANDROID_SMP=0 |
| 530 | endif |
| 531 | |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 532 | # Needed to access private/__dso_handle.h from |
| 533 | # crtbegin_xxx.c and crtend_xxx.c |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 534 | # |
| 535 | libc_crt_target_cflags += -I$(LOCAL_PATH)/private |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 536 | |
Bruce Beare | 3964084 | 2011-06-20 10:29:50 -0700 | [diff] [blame] | 537 | ifeq ($(TARGET_ARCH),arm) |
| 538 | libc_crt_target_cflags += -DCRT_LEGACY_WORKAROUND |
| 539 | endif |
| 540 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 541 | # Define some common includes |
| 542 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 543 | libc_common_c_includes := \ |
| 544 | $(LOCAL_PATH)/stdlib \ |
| 545 | $(LOCAL_PATH)/string \ |
Nick Kralevich | 76656af | 2012-06-07 16:30:02 -0700 | [diff] [blame] | 546 | $(LOCAL_PATH)/stdio \ |
| 547 | external/safe-iop/include |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 548 | |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 549 | # Needed to access private/__dso_handle.h from |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 550 | # crtbegin_xxx.S and crtend_xxx.S |
| 551 | # |
Kenny Root | 03273f8 | 2012-04-10 17:24:24 -0700 | [diff] [blame] | 552 | libc_crt_target_cflags += -I$(LOCAL_PATH)/private -I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 553 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 554 | # Define the libc run-time (crt) support object files that must be built, |
| 555 | # which are needed to build all other objects (shared/static libs and |
| 556 | # executables) |
| 557 | # ========================================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 558 | |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 559 | ifneq ($(filter arm x86,$(TARGET_ARCH)),) |
| 560 | # ARM and x86 need crtbegin_so/crtend_so. |
| 561 | # |
| 562 | # For x86, the .init section must point to a function that calls all |
| 563 | # entries in the .ctors section. (on ARM this is done through the |
| 564 | # .init_array section instead). |
| 565 | # |
| 566 | # For both platforms, the .fini_array section must point to a function |
| 567 | # that will call __cxa_finalize(&__dso_handle) in order to ensure that |
| 568 | # static C++ destructors are properly called on dlclose(). |
| 569 | # |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 570 | |
| 571 | libc_crt_target_so_cflags := $(libc_crt_target_cflags) |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 572 | libc_crt_target_crtstart_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.c |
| 573 | libc_crt_target_crtstart_so_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.c |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 574 | ifeq ($(TARGET_ARCH),x86) |
| 575 | # This flag must be added for x86 targets, but not for ARM |
| 576 | libc_crt_target_so_cflags += -fPIC |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 577 | libc_crt_target_crtstart_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.S |
| 578 | libc_crt_target_crtstart_so_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 579 | endif |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 580 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 581 | $(GEN): $(libc_crt_target_crtstart_so_file) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 582 | @mkdir -p $(dir $@) |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 583 | $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $< |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 584 | ALL_GENERATED_SOURCES += $(GEN) |
| 585 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 586 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 587 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S |
| 588 | @mkdir -p $(dir $@) |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 589 | $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $< |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 590 | ALL_GENERATED_SOURCES += $(GEN) |
Shih-wei Liao | fc0725e | 2012-07-28 00:33:28 -0700 | [diff] [blame] | 591 | |
| 592 | GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o |
| 593 | $(GEN): $(libc_crt_target_crtstart_so_file) |
| 594 | @mkdir -p $(dir $@) |
| 595 | $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $< |
| 596 | ALL_GENERATED_SOURCES += $(GEN) |
| 597 | |
| 598 | GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o |
| 599 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S |
| 600 | @mkdir -p $(dir $@) |
| 601 | $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $< |
| 602 | ALL_GENERATED_SOURCES += $(GEN) |
David 'Digit' Turner | 2d2dbd3 | 2011-06-25 17:26:38 +0200 | [diff] [blame] | 603 | endif # TARGET_ARCH == x86 || TARGET_ARCH == arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 604 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 605 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 606 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 607 | $(GEN): $(libc_crt_target_crtstart_file) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 608 | @mkdir -p $(dir $@) |
| 609 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 610 | ALL_GENERATED_SOURCES += $(GEN) |
| 611 | |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 612 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o |
Nick Kralevich | 9d40326 | 2012-05-31 11:40:10 -0700 | [diff] [blame] | 613 | $(GEN): $(libc_crt_target_crtstart_file) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 614 | @mkdir -p $(dir $@) |
| 615 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 616 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 617 | |
| 618 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 619 | # We rename crtend.o to crtend_android.o to avoid a |
| 620 | # name clash between gcc and bionic. |
Ying Wang | fc9e525 | 2012-05-15 15:15:11 -0700 | [diff] [blame] | 621 | GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 622 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S |
| 623 | @mkdir -p $(dir $@) |
| 624 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 625 | ALL_GENERATED_SOURCES += $(GEN) |
| 626 | |
| 627 | |
| 628 | # To enable malloc leak check for statically linked programs, add |
| 629 | # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk |
| 630 | WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) |
| 631 | |
| 632 | # ======================================================== |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 633 | # libbionic_ssp.a - stack protector code |
| 634 | # ======================================================== |
| 635 | # |
| 636 | # The stack protector code needs to be compiled |
| 637 | # with -fno-stack-protector, since it modifies the |
| 638 | # stack canary. |
| 639 | |
| 640 | include $(CLEAR_VARS) |
| 641 | |
| 642 | LOCAL_SRC_FILES := bionic/ssp.c |
| 643 | LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector |
| 644 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 645 | LOCAL_MODULE := libbionic_ssp |
| 646 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 647 | |
| 648 | include $(BUILD_STATIC_LIBRARY) |
| 649 | |
| 650 | |
| 651 | # ======================================================== |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 652 | # libc_common.a |
| 653 | # ======================================================== |
| 654 | include $(CLEAR_VARS) |
| 655 | |
| 656 | LOCAL_SRC_FILES := $(libc_common_src_files) |
| 657 | LOCAL_CFLAGS := $(libc_common_cflags) |
Bruce Beare | 3964084 | 2011-06-20 10:29:50 -0700 | [diff] [blame] | 658 | ifeq ($(TARGET_ARCH),arm) |
| 659 | LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND |
| 660 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 661 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 662 | LOCAL_MODULE := libc_common |
Nick Kralevich | 6334c66 | 2012-07-10 10:46:19 -0700 | [diff] [blame] | 663 | LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 664 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 665 | |
| 666 | include $(BUILD_STATIC_LIBRARY) |
| 667 | |
| 668 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 669 | # ======================================================== |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 670 | # libc_nomalloc.a |
| 671 | # ======================================================== |
| 672 | # |
| 673 | # This is a version of the static C library that does not |
| 674 | # include malloc. It's useful in situations when calling |
| 675 | # the user wants to provide their own malloc implementation, |
| 676 | # or wants to explicitly disallow the use of the use of malloc, |
| 677 | # like the dynamic loader. |
| 678 | |
| 679 | include $(CLEAR_VARS) |
| 680 | |
| 681 | LOCAL_SRC_FILES := \ |
| 682 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 683 | $(libc_static_common_src_files) \ |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 684 | bionic/libc_init_static.c |
| 685 | |
| 686 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 687 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 688 | -DLIBC_STATIC |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 689 | |
| 690 | LOCAL_MODULE := libc_nomalloc |
| 691 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 692 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 693 | |
| 694 | include $(BUILD_STATIC_LIBRARY) |
| 695 | |
| 696 | |
| 697 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 698 | # libc.a |
| 699 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 700 | include $(CLEAR_VARS) |
| 701 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 702 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 703 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 704 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 705 | bionic/dlmalloc.c \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 706 | bionic/malloc_debug_common.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 707 | bionic/libc_init_static.c |
| 708 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 709 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 710 | -DLIBC_STATIC |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 711 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 712 | LOCAL_MODULE := libc |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 713 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 714 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 715 | |
| 716 | include $(BUILD_STATIC_LIBRARY) |
| 717 | |
| 718 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 719 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 720 | # libc.so |
| 721 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 722 | include $(CLEAR_VARS) |
| 723 | |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 724 | # pthread deadlock prediction: |
| 725 | # set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for |
| 726 | # pthread deadlock prediction. |
| 727 | # Since this code is experimental it is disabled by default. |
| 728 | # see libc/bionic/pthread_debug.c for details |
| 729 | |
| 730 | LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 731 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 732 | |
| 733 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 734 | $(libc_arch_dynamic_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 735 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 736 | bionic/dlmalloc.c \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 737 | bionic/malloc_debug_common.c \ |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 738 | bionic/pthread_debug.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 739 | bionic/libc_init_dynamic.c |
| 740 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 741 | LOCAL_MODULE:= libc |
| 742 | |
| 743 | # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 744 | # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 745 | # ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 746 | # external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 747 | # should, instead relying on the external symbols from the dependent libraries. That would |
| 748 | # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 749 | # you wanted! |
| 750 | |
| 751 | LOCAL_SHARED_LIBRARIES := libdl |
| 752 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 753 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 754 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 755 | include $(BUILD_SHARED_LIBRARY) |
| 756 | |
| 757 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 758 | # For all builds, except for the -user build we will enable memory |
| 759 | # allocation checking (including memory leaks, buffer overwrites, etc.) |
| 760 | # Note that all these checks are also controlled by env. settings |
| 761 | # that can enable, or disable specific checks. Note also that some of |
| 762 | # the checks are available only in emulator and are implemeted in |
| 763 | # libc_malloc_qemu_instrumented.so. |
| 764 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 765 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 766 | # ======================================================== |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 767 | # libc_malloc_debug_leak.so |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 768 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 769 | include $(CLEAR_VARS) |
| 770 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 771 | LOCAL_CFLAGS := \ |
| 772 | $(libc_common_cflags) \ |
| 773 | -DMALLOC_LEAK_CHECK |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 774 | |
| 775 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 776 | |
| 777 | LOCAL_SRC_FILES := \ |
Iliyan Malchev | e1dd3c2 | 2012-05-29 14:22:42 -0700 | [diff] [blame] | 778 | bionic/malloc_debug_leak.c \ |
| 779 | bionic/malloc_debug_check.c \ |
| 780 | bionic/malloc_debug_check_mapinfo.c \ |
| 781 | bionic/malloc_debug_stacktrace.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 782 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 783 | LOCAL_MODULE:= libc_malloc_debug_leak |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 784 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 785 | LOCAL_SHARED_LIBRARIES := libc |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 786 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 787 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Bruce Beare | aa46fa2 | 2010-07-08 14:47:50 -0700 | [diff] [blame] | 788 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
Iliyan Malchev | 3680704 | 2011-03-14 14:02:05 -0700 | [diff] [blame] | 789 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 790 | # Don't install on release build |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 791 | LOCAL_MODULE_TAGS := eng debug |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 792 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 793 | include $(BUILD_SHARED_LIBRARY) |
| 794 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 795 | |
| 796 | # ======================================================== |
| 797 | # libc_malloc_debug_qemu.so |
| 798 | # ======================================================== |
| 799 | include $(CLEAR_VARS) |
| 800 | |
| 801 | LOCAL_CFLAGS := \ |
| 802 | $(libc_common_cflags) \ |
| 803 | -DMALLOC_QEMU_INSTRUMENT |
| 804 | |
| 805 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 806 | |
| 807 | LOCAL_SRC_FILES := \ |
| 808 | bionic/malloc_debug_qemu.c |
| 809 | |
| 810 | LOCAL_MODULE:= libc_malloc_debug_qemu |
| 811 | |
Mathias Agopian | 7c0c379 | 2011-09-05 23:54:55 -0700 | [diff] [blame] | 812 | LOCAL_SHARED_LIBRARIES := libc libdl |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 813 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 814 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Iliyan Malchev | 3680704 | 2011-03-14 14:02:05 -0700 | [diff] [blame] | 815 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 816 | # Don't install on release build |
| 817 | LOCAL_MODULE_TAGS := eng debug |
| 818 | |
| 819 | include $(BUILD_SHARED_LIBRARY) |
| 820 | |
| 821 | endif #!user |
| 822 | |
| 823 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 824 | # ======================================================== |
| 825 | include $(call all-makefiles-under,$(LOCAL_PATH)) |