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 \ |
| 143 | stdlib/_rand48.c \ |
| 144 | stdlib/assert.c \ |
| 145 | stdlib/atexit.c \ |
| 146 | stdlib/atoi.c \ |
| 147 | stdlib/atol.c \ |
| 148 | stdlib/atoll.c \ |
| 149 | stdlib/bsearch.c \ |
| 150 | stdlib/ctype_.c \ |
| 151 | stdlib/div.c \ |
| 152 | stdlib/exit.c \ |
| 153 | stdlib/getenv.c \ |
| 154 | stdlib/jrand48.c \ |
| 155 | stdlib/ldiv.c \ |
| 156 | stdlib/lldiv.c \ |
| 157 | stdlib/locale.c \ |
| 158 | stdlib/lrand48.c \ |
| 159 | stdlib/mrand48.c \ |
| 160 | stdlib/nrand48.c \ |
| 161 | stdlib/putenv.c \ |
| 162 | stdlib/qsort.c \ |
| 163 | stdlib/seed48.c \ |
| 164 | stdlib/setenv.c \ |
| 165 | stdlib/setjmperr.c \ |
| 166 | stdlib/srand48.c \ |
| 167 | stdlib/strntoimax.c \ |
| 168 | stdlib/strntoumax.c \ |
| 169 | stdlib/strtod.c \ |
| 170 | stdlib/strtoimax.c \ |
| 171 | stdlib/strtol.c \ |
| 172 | stdlib/strtoll.c \ |
| 173 | stdlib/strtoul.c \ |
| 174 | stdlib/strtoull.c \ |
| 175 | stdlib/strtoumax.c \ |
| 176 | stdlib/tolower_.c \ |
| 177 | stdlib/toupper_.c \ |
| 178 | stdlib/wchar.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 179 | string/index.c \ |
| 180 | string/memccpy.c \ |
| 181 | string/memchr.c \ |
| 182 | string/memmem.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 183 | string/memrchr.c \ |
| 184 | string/memswap.c \ |
| 185 | string/strcasecmp.c \ |
| 186 | string/strcasestr.c \ |
| 187 | string/strcat.c \ |
| 188 | string/strchr.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 189 | string/strcoll.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 190 | string/strcspn.c \ |
| 191 | string/strdup.c \ |
| 192 | string/strerror.c \ |
| 193 | string/strerror_r.c \ |
| 194 | string/strlcat.c \ |
| 195 | string/strlcpy.c \ |
| 196 | string/strncat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 197 | string/strncpy.c \ |
| 198 | string/strndup.c \ |
| 199 | string/strnlen.c \ |
| 200 | string/strpbrk.c \ |
| 201 | string/strrchr.c \ |
| 202 | string/strsep.c \ |
| 203 | string/strspn.c \ |
| 204 | string/strstr.c \ |
| 205 | string/strtok.c \ |
| 206 | string/strtotimeval.c \ |
| 207 | string/strxfrm.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 208 | wchar/wcpcpy.c \ |
| 209 | wchar/wcpncpy.c \ |
| 210 | wchar/wcscasecmp.c \ |
| 211 | wchar/wcscat.c \ |
| 212 | wchar/wcschr.c \ |
| 213 | wchar/wcscmp.c \ |
| 214 | wchar/wcscoll.c \ |
| 215 | wchar/wcscpy.c \ |
| 216 | wchar/wcscspn.c \ |
| 217 | wchar/wcsdup.c \ |
| 218 | wchar/wcslcat.c \ |
| 219 | wchar/wcslcpy.c \ |
| 220 | wchar/wcslen.c \ |
| 221 | wchar/wcsncasecmp.c \ |
| 222 | wchar/wcsncat.c \ |
| 223 | wchar/wcsncmp.c \ |
| 224 | wchar/wcsncpy.c \ |
| 225 | wchar/wcsnlen.c \ |
| 226 | wchar/wcspbrk.c \ |
| 227 | wchar/wcsrchr.c \ |
| 228 | wchar/wcsspn.c \ |
| 229 | wchar/wcsstr.c \ |
| 230 | wchar/wcstok.c \ |
| 231 | wchar/wcswidth.c \ |
Kristian Monsen | 7046561 | 2010-06-16 14:51:52 +0100 | [diff] [blame] | 232 | wchar/wcsxfrm.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 233 | wchar/wmemchr.c \ |
Kristian Monsen | 7046561 | 2010-06-16 14:51:52 +0100 | [diff] [blame] | 234 | wchar/wmemcmp.c \ |
David 'Digit' Turner | 3527fd6 | 2010-06-14 17:18:35 -0700 | [diff] [blame] | 235 | wchar/wmemcpy.c \ |
| 236 | wchar/wmemmove.c \ |
| 237 | wchar/wmemset.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 238 | inet/bindresvport.c \ |
| 239 | inet/inet_addr.c \ |
| 240 | inet/inet_aton.c \ |
| 241 | inet/inet_ntoa.c \ |
| 242 | inet/inet_ntop.c \ |
| 243 | inet/inet_pton.c \ |
Szymon Jakubczak | 41e533a | 2010-06-09 15:53:28 -0400 | [diff] [blame] | 244 | inet/ether_aton.c \ |
| 245 | inet/ether_ntoa.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 246 | tzcode/asctime.c \ |
| 247 | tzcode/difftime.c \ |
| 248 | tzcode/localtime.c \ |
| 249 | tzcode/strftime.c \ |
| 250 | tzcode/strptime.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 251 | bionic/__set_errno.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 252 | bionic/cpuacct.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 253 | bionic/arc4random.c \ |
| 254 | bionic/basename.c \ |
| 255 | bionic/basename_r.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 256 | bionic/clearenv.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 257 | bionic/dirname.c \ |
| 258 | bionic/dirname_r.c \ |
| 259 | bionic/drand48.c \ |
| 260 | bionic/erand48.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 261 | bionic/err.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 262 | bionic/fdprintf.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 263 | bionic/fork.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 264 | bionic/fts.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 265 | bionic/if_nametoindex.c \ |
| 266 | bionic/if_indextoname.c \ |
| 267 | bionic/ioctl.c \ |
| 268 | bionic/ldexp.c \ |
| 269 | bionic/libc_init_common.c \ |
| 270 | bionic/logd_write.c \ |
| 271 | bionic/md5.c \ |
Andy McFadden | 4ce737f | 2011-02-04 14:45:57 -0800 | [diff] [blame^] | 272 | bionic/memmove_words.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 273 | bionic/pututline.c \ |
| 274 | bionic/realpath.c \ |
David 'Digit' Turner | 72e6fd4 | 2010-12-03 18:04:01 +0100 | [diff] [blame] | 275 | bionic/sched_getaffinity.c \ |
| 276 | bionic/sched_getcpu.c \ |
| 277 | bionic/sched_cpualloc.c \ |
| 278 | bionic/sched_cpucount.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 279 | bionic/semaphore.c \ |
| 280 | bionic/sha1.c \ |
| 281 | bionic/ssp.c \ |
| 282 | bionic/stubs.c \ |
| 283 | bionic/system_properties.c \ |
| 284 | bionic/time64.c \ |
| 285 | bionic/thread_atexit.c \ |
| 286 | bionic/utime.c \ |
| 287 | bionic/utmp.c \ |
| 288 | netbsd/gethnamaddr.c \ |
| 289 | netbsd/isc/ev_timers.c \ |
| 290 | netbsd/isc/ev_streams.c \ |
| 291 | netbsd/inet/nsap_addr.c \ |
| 292 | netbsd/resolv/__dn_comp.c \ |
| 293 | netbsd/resolv/__res_close.c \ |
| 294 | netbsd/resolv/__res_send.c \ |
| 295 | netbsd/resolv/herror.c \ |
| 296 | netbsd/resolv/res_comp.c \ |
| 297 | netbsd/resolv/res_data.c \ |
| 298 | netbsd/resolv/res_debug.c \ |
| 299 | netbsd/resolv/res_init.c \ |
| 300 | netbsd/resolv/res_mkquery.c \ |
| 301 | netbsd/resolv/res_query.c \ |
| 302 | netbsd/resolv/res_send.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 303 | netbsd/resolv/res_state.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 304 | netbsd/resolv/res_cache.c \ |
| 305 | netbsd/net/nsdispatch.c \ |
| 306 | netbsd/net/getaddrinfo.c \ |
| 307 | netbsd/net/getnameinfo.c \ |
| 308 | netbsd/net/getservbyname.c \ |
| 309 | netbsd/net/getservent.c \ |
| 310 | netbsd/net/base64.c \ |
| 311 | netbsd/net/getservbyport.c \ |
| 312 | netbsd/nameser/ns_name.c \ |
| 313 | netbsd/nameser/ns_parse.c \ |
| 314 | netbsd/nameser/ns_ttl.c \ |
| 315 | netbsd/nameser/ns_netint.c \ |
| 316 | netbsd/nameser/ns_print.c \ |
Colin Cross | 4fa7b10 | 2010-01-12 18:59:25 -0800 | [diff] [blame] | 317 | netbsd/nameser/ns_samedomain.c \ |
| 318 | regex/regcomp.c \ |
| 319 | regex/regerror.c \ |
| 320 | regex/regexec.c \ |
| 321 | regex/regfree.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 322 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 323 | # The following files are common, but must be compiled |
| 324 | # with different C flags when building a static C library. |
| 325 | # |
| 326 | # The reason for this is the implementation of __get_tls() |
| 327 | # that will differ between the shared and static versions |
| 328 | # of the library. |
| 329 | # |
| 330 | # See comments in private/bionic_tls.h for more details. |
| 331 | # |
| 332 | # NOTE: bionic/pthread.c is added later to this list |
| 333 | # because it needs special handling on ARM, see |
| 334 | # below. |
| 335 | # |
| 336 | libc_static_common_src_files := \ |
| 337 | unistd/sysconf.c \ |
| 338 | bionic/__errno.c \ |
| 339 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 340 | # Architecture specific source files go here |
| 341 | # ========================================================= |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 342 | ifeq ($(TARGET_ARCH),arm) |
| 343 | libc_common_src_files += \ |
David 'Digit' Turner | 97cf7f3 | 2010-01-22 18:59:05 -0800 | [diff] [blame] | 344 | bionic/bionic_clone.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 345 | arch-arm/bionic/__get_pc.S \ |
| 346 | arch-arm/bionic/__get_sp.S \ |
| 347 | arch-arm/bionic/_exit_with_stack_teardown.S \ |
| 348 | arch-arm/bionic/_setjmp.S \ |
| 349 | arch-arm/bionic/atomics_arm.S \ |
| 350 | arch-arm/bionic/clone.S \ |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 351 | arch-arm/bionic/eabi.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 352 | arch-arm/bionic/ffs.S \ |
| 353 | arch-arm/bionic/kill.S \ |
David 'Digit' Turner | 2a7ad97 | 2009-09-29 14:43:38 -0700 | [diff] [blame] | 354 | arch-arm/bionic/libgcc_compat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 355 | arch-arm/bionic/tkill.S \ |
| 356 | arch-arm/bionic/memcmp.S \ |
| 357 | arch-arm/bionic/memcmp16.S \ |
| 358 | arch-arm/bionic/memcpy.S \ |
| 359 | arch-arm/bionic/memset.S \ |
| 360 | arch-arm/bionic/setjmp.S \ |
| 361 | arch-arm/bionic/sigsetjmp.S \ |
| 362 | arch-arm/bionic/strlen.c.arm \ |
Jim Huang | 73c04b3 | 2010-08-10 17:23:39 +0800 | [diff] [blame] | 363 | arch-arm/bionic/strcpy.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 364 | arch-arm/bionic/syscall.S \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 365 | string/memmove.c.arm \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 366 | string/bcopy.c \ |
| 367 | string/strcmp.c \ |
| 368 | string/strncmp.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 369 | unistd/socketcalls.c |
| 370 | |
| 371 | # These files need to be arm so that gdbserver |
| 372 | # can set breakpoints in them without messing |
| 373 | # up any thumb code. |
| 374 | libc_common_src_files += \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 375 | bionic/pthread-atfork.c.arm \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 376 | bionic/pthread-rwlocks.c.arm \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 377 | bionic/pthread-timers.c.arm \ |
| 378 | bionic/ptrace.c.arm |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 379 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 380 | libc_static_common_src_files += \ |
| 381 | bionic/pthread.c.arm \ |
| 382 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 383 | # these are used by the static and dynamic versions of the libc |
| 384 | # respectively |
| 385 | libc_arch_static_src_files := \ |
| 386 | arch-arm/bionic/exidx_static.c |
| 387 | |
| 388 | libc_arch_dynamic_src_files := \ |
| 389 | arch-arm/bionic/exidx_dynamic.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 390 | else # !arm |
| 391 | |
| 392 | ifeq ($(TARGET_ARCH),x86) |
| 393 | libc_common_src_files += \ |
| 394 | arch-x86/bionic/__get_sp.S \ |
| 395 | arch-x86/bionic/__get_tls.c \ |
| 396 | arch-x86/bionic/__set_tls.c \ |
| 397 | arch-x86/bionic/atomics_x86.S \ |
| 398 | arch-x86/bionic/clone.S \ |
| 399 | arch-x86/bionic/_exit_with_stack_teardown.S \ |
| 400 | arch-x86/bionic/setjmp.S \ |
| 401 | arch-x86/bionic/_setjmp.S \ |
Chih-Wei Huang | 18635d9 | 2010-12-14 17:55:23 +0800 | [diff] [blame] | 402 | arch-x86/bionic/sigsetjmp.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 403 | arch-x86/bionic/vfork.S \ |
Bruce Beare | 3c543e1 | 2010-03-04 10:29:38 -0800 | [diff] [blame] | 404 | arch-x86/bionic/syscall.S \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 405 | arch-x86/string/bcopy_wrapper.S \ |
| 406 | arch-x86/string/memcpy_wrapper.S \ |
| 407 | arch-x86/string/memmove_wrapper.S \ |
| 408 | arch-x86/string/bzero_wrapper.S \ |
| 409 | arch-x86/string/memcmp_wrapper.S \ |
| 410 | arch-x86/string/memset_wrapper.S \ |
| 411 | arch-x86/string/strcmp_wrapper.S \ |
| 412 | arch-x86/string/strncmp_wrapper.S \ |
Bruce Beare | 124a542 | 2010-10-11 12:24:41 -0700 | [diff] [blame] | 413 | arch-x86/string/strlen_wrapper.S \ |
Jim Huang | 73c04b3 | 2010-08-10 17:23:39 +0800 | [diff] [blame] | 414 | string/strcpy.c \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 415 | bionic/pthread-atfork.c \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 416 | bionic/pthread-rwlocks.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 417 | bionic/pthread-timers.c \ |
| 418 | bionic/ptrace.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 419 | |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 420 | libc_static_common_src_files += \ |
| 421 | bionic/pthread.c \ |
| 422 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 423 | # this is needed for static versions of libc |
| 424 | libc_arch_static_src_files := \ |
| 425 | arch-x86/bionic/dl_iterate_phdr_static.c |
| 426 | |
| 427 | libc_arch_dynamic_src_files := |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 428 | else # !x86 |
| 429 | |
| 430 | ifeq ($(TARGET_ARCH),sh) |
| 431 | libc_common_src_files += \ |
| 432 | arch-sh/bionic/__get_pc.S \ |
| 433 | arch-sh/bionic/__get_sp.S \ |
| 434 | arch-sh/bionic/_exit_with_stack_teardown.S \ |
| 435 | arch-sh/bionic/_setjmp.S \ |
| 436 | arch-sh/bionic/atomics_sh.c \ |
| 437 | arch-sh/bionic/atomic_cmpxchg.S \ |
| 438 | arch-sh/bionic/clone.S \ |
| 439 | arch-sh/bionic/pipe.S \ |
| 440 | arch-sh/bionic/memcpy.S \ |
| 441 | arch-sh/bionic/memset.S \ |
| 442 | arch-sh/bionic/bzero.S \ |
| 443 | arch-sh/bionic/setjmp.S \ |
| 444 | arch-sh/bionic/sigsetjmp.S \ |
| 445 | arch-sh/bionic/syscall.S \ |
| 446 | arch-sh/bionic/memmove.S \ |
| 447 | arch-sh/bionic/__set_tls.c \ |
| 448 | arch-sh/bionic/__get_tls.c \ |
| 449 | arch-sh/bionic/ffs.S \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 450 | string/bcopy.c \ |
| 451 | string/strcmp.c \ |
| 452 | string/strncmp.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 453 | string/memcmp.c \ |
| 454 | string/strlen.c \ |
Jim Huang | 73c04b3 | 2010-08-10 17:23:39 +0800 | [diff] [blame] | 455 | string/strcpy.c \ |
Matt Fischer | 4f086ae | 2010-06-25 14:36:39 -0500 | [diff] [blame] | 456 | bionic/pthread-atfork.c \ |
David 'Digit' Turner | 8a1d2cf | 2010-05-11 16:39:22 -0700 | [diff] [blame] | 457 | bionic/pthread-rwlocks.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 458 | bionic/pthread-timers.c \ |
| 459 | bionic/ptrace.c \ |
| 460 | unistd/socketcalls.c |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 461 | |
| 462 | libc_static_common_src_files += \ |
| 463 | bionic/pthread.c \ |
| 464 | |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 465 | endif # sh |
| 466 | |
| 467 | endif # !x86 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 468 | endif # !arm |
| 469 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 470 | # Define some common cflags |
| 471 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 472 | libc_common_cflags := \ |
| 473 | -DWITH_ERRLIST \ |
| 474 | -DANDROID_CHANGES \ |
| 475 | -DUSE_LOCKS \ |
| 476 | -DREALLOC_ZERO_BYTES_FREES \ |
| 477 | -D_LIBC=1 \ |
| 478 | -DSOFTFLOAT \ |
| 479 | -DFLOATING_POINT \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 480 | -DINET6 \ |
| 481 | -I$(LOCAL_PATH)/private \ |
Colin Cross | 4fa7b10 | 2010-01-12 18:59:25 -0800 | [diff] [blame] | 482 | -DUSE_DL_PREFIX \ |
| 483 | -DPOSIX_MISTAKE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 484 | |
David 'Digit' Turner | d7ed1ae | 2010-03-05 14:17:35 -0800 | [diff] [blame] | 485 | # these macro definitions are required to implement the |
| 486 | # 'timezone' and 'daylight' global variables, as well as |
| 487 | # properly update the 'tm_gmtoff' field in 'struct tm'. |
| 488 | # |
| 489 | libc_common_cflags += \ |
| 490 | -DTM_GMTOFF=tm_gmtoff \ |
| 491 | -DUSG_COMPAT=1 |
| 492 | |
Dave Bort | d2c9dcc | 2009-04-23 15:50:03 -0700 | [diff] [blame] | 493 | ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 494 | libc_common_cflags += -DDEBUG |
| 495 | endif |
| 496 | |
| 497 | ifeq ($(TARGET_ARCH),arm) |
| 498 | libc_common_cflags += -fstrict-aliasing |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 499 | libc_crt_target_cflags := -mthumb-interwork |
David 'Digit' Turner | 4a05d12 | 2009-09-18 13:35:05 -0700 | [diff] [blame] | 500 | # |
| 501 | # Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library |
| 502 | # that it should access the hardware TLS register directly in |
| 503 | # private/bionic_tls.h |
| 504 | # |
| 505 | # The value must match your kernel configuration |
| 506 | # |
| 507 | ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) |
| 508 | libc_common_cflags += -DHAVE_ARM_TLS_REGISTER |
| 509 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 510 | else # !arm |
Chih-Wei Huang | 26c15a8 | 2010-07-26 11:29:08 +0800 | [diff] [blame] | 511 | libc_crt_target_cflags := |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 512 | endif # !arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 513 | |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 514 | # Define ANDROID_SMP appropriately. |
| 515 | ifeq ($(TARGET_CPU_SMP),true) |
| 516 | libc_common_cflags += -DANDROID_SMP=1 |
| 517 | else |
| 518 | libc_common_cflags += -DANDROID_SMP=0 |
| 519 | endif |
| 520 | |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 521 | # Needed to access private/__dso_handle.S from |
| 522 | # crtbegin_xxx.S and crtend_xxx.S |
| 523 | # |
| 524 | libc_crt_target_cflags += -I$(LOCAL_PATH)/private |
Andy McFadden | fcd00eb | 2010-05-28 13:31:45 -0700 | [diff] [blame] | 525 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 526 | # Define some common includes |
| 527 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 528 | libc_common_c_includes := \ |
| 529 | $(LOCAL_PATH)/stdlib \ |
| 530 | $(LOCAL_PATH)/string \ |
| 531 | $(LOCAL_PATH)/stdio |
| 532 | |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 533 | # Needed to access private/__dso_handle.S from |
| 534 | # crtbegin_xxx.S and crtend_xxx.S |
| 535 | # |
| 536 | libc_crt_target_cflags += -I$(LOCAL_PATH)/private |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 537 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 538 | # Define the libc run-time (crt) support object files that must be built, |
| 539 | # which are needed to build all other objects (shared/static libs and |
| 540 | # executables) |
| 541 | # ========================================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 542 | |
David 'Digit' Turner | 6a9b888 | 2010-06-18 14:47:22 -0700 | [diff] [blame] | 543 | ifneq ($(filter arm x86,$(TARGET_ARCH)),) |
| 544 | # ARM and x86 need crtbegin_so/crtend_so. |
| 545 | # |
| 546 | # For x86, the .init section must point to a function that calls all |
| 547 | # entries in the .ctors section. (on ARM this is done through the |
| 548 | # .init_array section instead). |
| 549 | # |
| 550 | # For both platforms, the .fini_array section must point to a function |
| 551 | # that will call __cxa_finalize(&__dso_handle) in order to ensure that |
| 552 | # static C++ destructors are properly called on dlclose(). |
| 553 | # |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 554 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o |
| 555 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S |
| 556 | @mkdir -p $(dir $@) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 557 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 558 | ALL_GENERATED_SOURCES += $(GEN) |
| 559 | |
| 560 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o |
| 561 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S |
| 562 | @mkdir -p $(dir $@) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 563 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 564 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 565 | endif # TARGET_ARCH == x86 |
| 566 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 567 | |
| 568 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o |
| 569 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_static.S |
| 570 | @mkdir -p $(dir $@) |
| 571 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 572 | ALL_GENERATED_SOURCES += $(GEN) |
| 573 | |
| 574 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o |
| 575 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_dynamic.S |
| 576 | @mkdir -p $(dir $@) |
| 577 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 578 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 579 | |
| 580 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 581 | # We rename crtend.o to crtend_android.o to avoid a |
| 582 | # name clash between gcc and bionic. |
| 583 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o |
| 584 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S |
| 585 | @mkdir -p $(dir $@) |
| 586 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 587 | ALL_GENERATED_SOURCES += $(GEN) |
| 588 | |
| 589 | |
| 590 | # To enable malloc leak check for statically linked programs, add |
| 591 | # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk |
| 592 | WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) |
| 593 | |
| 594 | # ======================================================== |
| 595 | # libc_common.a |
| 596 | # ======================================================== |
| 597 | include $(CLEAR_VARS) |
| 598 | |
| 599 | LOCAL_SRC_FILES := $(libc_common_src_files) |
| 600 | LOCAL_CFLAGS := $(libc_common_cflags) |
| 601 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 602 | LOCAL_MODULE := libc_common |
| 603 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 604 | |
| 605 | include $(BUILD_STATIC_LIBRARY) |
| 606 | |
| 607 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 608 | # ======================================================== |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 609 | # libc_nomalloc.a |
| 610 | # ======================================================== |
| 611 | # |
| 612 | # This is a version of the static C library that does not |
| 613 | # include malloc. It's useful in situations when calling |
| 614 | # the user wants to provide their own malloc implementation, |
| 615 | # or wants to explicitly disallow the use of the use of malloc, |
| 616 | # like the dynamic loader. |
| 617 | |
| 618 | include $(CLEAR_VARS) |
| 619 | |
| 620 | LOCAL_SRC_FILES := \ |
| 621 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 622 | $(libc_static_common_src_files) \ |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 623 | bionic/libc_init_static.c |
| 624 | |
| 625 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 626 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 627 | -DLIBC_STATIC |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 628 | |
| 629 | LOCAL_MODULE := libc_nomalloc |
| 630 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 631 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 632 | |
| 633 | include $(BUILD_STATIC_LIBRARY) |
| 634 | |
| 635 | |
| 636 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 637 | # libc.a |
| 638 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 639 | include $(CLEAR_VARS) |
| 640 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 641 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 642 | $(libc_arch_static_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 643 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 644 | bionic/dlmalloc.c \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 645 | bionic/malloc_debug_common.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 646 | bionic/libc_init_static.c |
| 647 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 648 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 649 | -DLIBC_STATIC |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 650 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 651 | LOCAL_MODULE := libc |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 652 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 653 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 654 | |
| 655 | include $(BUILD_STATIC_LIBRARY) |
| 656 | |
| 657 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 658 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 659 | # libc.so |
| 660 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 661 | include $(CLEAR_VARS) |
| 662 | |
| 663 | LOCAL_CFLAGS := $(libc_common_cflags) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 664 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 665 | |
| 666 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 667 | $(libc_arch_dynamic_src_files) \ |
David 'Digit' Turner | 6a51def | 2010-08-27 08:19:19 -0700 | [diff] [blame] | 668 | $(libc_static_common_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 669 | bionic/dlmalloc.c \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 670 | bionic/malloc_debug_common.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 671 | bionic/libc_init_dynamic.c |
| 672 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 673 | LOCAL_MODULE:= libc |
| 674 | |
| 675 | # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 676 | # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 677 | # ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 678 | # external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 679 | # should, instead relying on the external symbols from the dependent libraries. That would |
| 680 | # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 681 | # you wanted! |
| 682 | |
| 683 | LOCAL_SHARED_LIBRARIES := libdl |
| 684 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 685 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 686 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 687 | include $(BUILD_SHARED_LIBRARY) |
| 688 | |
| 689 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 690 | # For all builds, except for the -user build we will enable memory |
| 691 | # allocation checking (including memory leaks, buffer overwrites, etc.) |
| 692 | # Note that all these checks are also controlled by env. settings |
| 693 | # that can enable, or disable specific checks. Note also that some of |
| 694 | # the checks are available only in emulator and are implemeted in |
| 695 | # libc_malloc_qemu_instrumented.so. |
| 696 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 697 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 698 | # ======================================================== |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 699 | # libc_malloc_debug_leak.so |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 700 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 701 | include $(CLEAR_VARS) |
| 702 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 703 | LOCAL_CFLAGS := \ |
| 704 | $(libc_common_cflags) \ |
| 705 | -DMALLOC_LEAK_CHECK |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 706 | |
| 707 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 708 | |
| 709 | LOCAL_SRC_FILES := \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 710 | bionic/malloc_debug_leak.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 711 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 712 | LOCAL_MODULE:= libc_malloc_debug_leak |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 713 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 714 | LOCAL_SHARED_LIBRARIES := libc |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 715 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 716 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Bruce Beare | aa46fa2 | 2010-07-08 14:47:50 -0700 | [diff] [blame] | 717 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 718 | # Don't prelink |
| 719 | LOCAL_PRELINK_MODULE := false |
| 720 | # Don't install on release build |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 721 | LOCAL_MODULE_TAGS := eng debug |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 722 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 723 | include $(BUILD_SHARED_LIBRARY) |
| 724 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 725 | |
| 726 | # ======================================================== |
| 727 | # libc_malloc_debug_qemu.so |
| 728 | # ======================================================== |
| 729 | include $(CLEAR_VARS) |
| 730 | |
| 731 | LOCAL_CFLAGS := \ |
| 732 | $(libc_common_cflags) \ |
| 733 | -DMALLOC_QEMU_INSTRUMENT |
| 734 | |
| 735 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 736 | |
| 737 | LOCAL_SRC_FILES := \ |
| 738 | bionic/malloc_debug_qemu.c |
| 739 | |
| 740 | LOCAL_MODULE:= libc_malloc_debug_qemu |
| 741 | |
| 742 | LOCAL_SHARED_LIBRARIES := libc |
| 743 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 744 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 745 | # Don't prelink |
| 746 | LOCAL_PRELINK_MODULE := false |
| 747 | # Don't install on release build |
| 748 | LOCAL_MODULE_TAGS := eng debug |
| 749 | |
| 750 | include $(BUILD_SHARED_LIBRARY) |
| 751 | |
| 752 | endif #!user |
| 753 | |
| 754 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 755 | # ======================================================== |
| 756 | include $(call all-makefiles-under,$(LOCAL_PATH)) |