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 \ |
| 14 | unistd/exec.c \ |
| 15 | unistd/fcntl.c \ |
| 16 | unistd/fnmatch.c \ |
| 17 | unistd/ftime.c \ |
| 18 | unistd/ftok.c \ |
| 19 | unistd/getcwd.c \ |
| 20 | unistd/getdtablesize.c \ |
| 21 | unistd/gethostname.c \ |
| 22 | unistd/getopt_long.c \ |
| 23 | unistd/getpgrp.c \ |
| 24 | unistd/getpriority.c \ |
| 25 | unistd/getpt.c \ |
| 26 | unistd/initgroups.c \ |
| 27 | unistd/isatty.c \ |
| 28 | unistd/issetugid.c \ |
Colin Cross | 8c59d96 | 2010-01-13 16:39:26 -0800 | [diff] [blame] | 29 | unistd/killpg.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 30 | unistd/lseek64.c \ |
| 31 | unistd/mmap.c \ |
| 32 | unistd/nice.c \ |
| 33 | unistd/open.c \ |
| 34 | unistd/openat.c \ |
| 35 | unistd/opendir.c \ |
| 36 | unistd/pathconf.c \ |
| 37 | unistd/perror.c \ |
| 38 | unistd/popen.c \ |
| 39 | unistd/pread.c \ |
| 40 | unistd/pselect.c \ |
| 41 | unistd/ptsname.c \ |
| 42 | unistd/ptsname_r.c \ |
| 43 | unistd/pwrite.c \ |
| 44 | unistd/raise.c \ |
| 45 | unistd/reboot.c \ |
| 46 | unistd/recv.c \ |
| 47 | unistd/sbrk.c \ |
| 48 | unistd/send.c \ |
| 49 | unistd/setegid.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 50 | unistd/setuid.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 51 | unistd/seteuid.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 52 | unistd/setreuid.c \ |
| 53 | unistd/setresuid.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | unistd/setpgrp.c \ |
| 55 | unistd/sigblock.c \ |
| 56 | unistd/siginterrupt.c \ |
| 57 | unistd/siglist.c \ |
| 58 | unistd/signal.c \ |
Thorsten Glaser | 92b10af | 2009-10-02 15:39:00 +0200 | [diff] [blame] | 59 | unistd/signame.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 60 | unistd/sigsetmask.c \ |
| 61 | unistd/sigsuspend.c \ |
| 62 | unistd/sigwait.c \ |
| 63 | unistd/sleep.c \ |
| 64 | unistd/statfs.c \ |
| 65 | unistd/strsignal.c \ |
| 66 | unistd/sysconf.c \ |
| 67 | unistd/syslog.c \ |
| 68 | unistd/system.c \ |
| 69 | unistd/tcgetpgrp.c \ |
| 70 | unistd/tcsetpgrp.c \ |
| 71 | unistd/time.c \ |
| 72 | unistd/umount.c \ |
| 73 | unistd/unlockpt.c \ |
| 74 | unistd/usleep.c \ |
| 75 | unistd/wait.c \ |
| 76 | stdio/asprintf.c \ |
| 77 | stdio/clrerr.c \ |
| 78 | stdio/fclose.c \ |
| 79 | stdio/fdopen.c \ |
| 80 | stdio/feof.c \ |
| 81 | stdio/ferror.c \ |
| 82 | stdio/fflush.c \ |
| 83 | stdio/fgetc.c \ |
| 84 | stdio/fgetln.c \ |
| 85 | stdio/fgetpos.c \ |
| 86 | stdio/fgets.c \ |
| 87 | stdio/fileno.c \ |
| 88 | stdio/findfp.c \ |
| 89 | stdio/flags.c \ |
| 90 | stdio/flockfile.c \ |
| 91 | stdio/fopen.c \ |
| 92 | stdio/fprintf.c \ |
| 93 | stdio/fpurge.c \ |
| 94 | stdio/fputc.c \ |
| 95 | stdio/fputs.c \ |
| 96 | stdio/fread.c \ |
| 97 | stdio/freopen.c \ |
| 98 | stdio/fscanf.c \ |
| 99 | stdio/fseek.c \ |
| 100 | stdio/fsetpos.c \ |
| 101 | stdio/ftell.c \ |
| 102 | stdio/funopen.c \ |
| 103 | stdio/fvwrite.c \ |
| 104 | stdio/fwalk.c \ |
| 105 | stdio/fwrite.c \ |
| 106 | stdio/getc.c \ |
| 107 | stdio/getchar.c \ |
| 108 | stdio/gets.c \ |
| 109 | stdio/makebuf.c \ |
| 110 | stdio/mktemp.c \ |
| 111 | stdio/printf.c \ |
| 112 | stdio/putc.c \ |
| 113 | stdio/putchar.c \ |
| 114 | stdio/puts.c \ |
| 115 | stdio/putw.c \ |
| 116 | stdio/refill.c \ |
| 117 | stdio/remove.c \ |
| 118 | stdio/rewind.c \ |
| 119 | stdio/rget.c \ |
| 120 | stdio/scanf.c \ |
| 121 | stdio/setbuf.c \ |
| 122 | stdio/setbuffer.c \ |
| 123 | stdio/setvbuf.c \ |
| 124 | stdio/snprintf.c\ |
| 125 | stdio/sprintf.c \ |
| 126 | stdio/sscanf.c \ |
| 127 | stdio/stdio.c \ |
| 128 | stdio/tempnam.c \ |
| 129 | stdio/tmpfile.c \ |
| 130 | stdio/tmpnam.c \ |
| 131 | stdio/ungetc.c \ |
| 132 | stdio/vasprintf.c \ |
| 133 | stdio/vfprintf.c \ |
| 134 | stdio/vfscanf.c \ |
| 135 | stdio/vprintf.c \ |
| 136 | stdio/vsnprintf.c \ |
| 137 | stdio/vsprintf.c \ |
| 138 | stdio/vscanf.c \ |
| 139 | stdio/vsscanf.c \ |
| 140 | stdio/wbuf.c \ |
| 141 | stdio/wsetup.c \ |
| 142 | stdlib/_rand48.c \ |
| 143 | stdlib/assert.c \ |
| 144 | stdlib/atexit.c \ |
| 145 | stdlib/atoi.c \ |
| 146 | stdlib/atol.c \ |
| 147 | stdlib/atoll.c \ |
| 148 | stdlib/bsearch.c \ |
| 149 | stdlib/ctype_.c \ |
| 150 | stdlib/div.c \ |
| 151 | stdlib/exit.c \ |
| 152 | stdlib/getenv.c \ |
| 153 | stdlib/jrand48.c \ |
| 154 | stdlib/ldiv.c \ |
| 155 | stdlib/lldiv.c \ |
| 156 | stdlib/locale.c \ |
| 157 | stdlib/lrand48.c \ |
| 158 | stdlib/mrand48.c \ |
| 159 | stdlib/nrand48.c \ |
| 160 | stdlib/putenv.c \ |
| 161 | stdlib/qsort.c \ |
| 162 | stdlib/seed48.c \ |
| 163 | stdlib/setenv.c \ |
| 164 | stdlib/setjmperr.c \ |
| 165 | stdlib/srand48.c \ |
| 166 | stdlib/strntoimax.c \ |
| 167 | stdlib/strntoumax.c \ |
| 168 | stdlib/strtod.c \ |
| 169 | stdlib/strtoimax.c \ |
| 170 | stdlib/strtol.c \ |
| 171 | stdlib/strtoll.c \ |
| 172 | stdlib/strtoul.c \ |
| 173 | stdlib/strtoull.c \ |
| 174 | stdlib/strtoumax.c \ |
| 175 | stdlib/tolower_.c \ |
| 176 | stdlib/toupper_.c \ |
| 177 | stdlib/wchar.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 178 | string/index.c \ |
| 179 | string/memccpy.c \ |
| 180 | string/memchr.c \ |
| 181 | string/memmem.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 182 | string/memrchr.c \ |
| 183 | string/memswap.c \ |
| 184 | string/strcasecmp.c \ |
| 185 | string/strcasestr.c \ |
| 186 | string/strcat.c \ |
| 187 | string/strchr.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 188 | string/strcoll.c \ |
| 189 | string/strcpy.c \ |
| 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 \ |
| 208 | inet/bindresvport.c \ |
| 209 | inet/inet_addr.c \ |
| 210 | inet/inet_aton.c \ |
| 211 | inet/inet_ntoa.c \ |
| 212 | inet/inet_ntop.c \ |
| 213 | inet/inet_pton.c \ |
Szymon Jakubczak | 4032c1e | 2010-06-09 15:53:28 -0400 | [diff] [blame] | 214 | inet/ether_aton.c \ |
| 215 | inet/ether_ntoa.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 216 | tzcode/asctime.c \ |
| 217 | tzcode/difftime.c \ |
| 218 | tzcode/localtime.c \ |
| 219 | tzcode/strftime.c \ |
| 220 | tzcode/strptime.c \ |
| 221 | bionic/__errno.c \ |
| 222 | bionic/__set_errno.c \ |
| 223 | bionic/_rand48.c \ |
Mike Chan | 9f69156 | 2010-03-02 10:55:58 -0800 | [diff] [blame] | 224 | bionic/cpuacct.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 225 | bionic/arc4random.c \ |
| 226 | bionic/basename.c \ |
| 227 | bionic/basename_r.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 228 | bionic/clearenv.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 229 | bionic/dirname.c \ |
| 230 | bionic/dirname_r.c \ |
| 231 | bionic/drand48.c \ |
| 232 | bionic/erand48.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 233 | bionic/err.c \ |
Colin Cross | fc10b24 | 2010-01-13 17:48:34 -0800 | [diff] [blame] | 234 | bionic/fdprintf.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 235 | bionic/fork.c \ |
Colin Cross | 64ceac3 | 2010-01-13 21:19:52 -0800 | [diff] [blame] | 236 | bionic/fts.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 237 | bionic/if_nametoindex.c \ |
| 238 | bionic/if_indextoname.c \ |
| 239 | bionic/ioctl.c \ |
| 240 | bionic/ldexp.c \ |
| 241 | bionic/libc_init_common.c \ |
| 242 | bionic/logd_write.c \ |
| 243 | bionic/md5.c \ |
| 244 | bionic/pututline.c \ |
| 245 | bionic/realpath.c \ |
| 246 | bionic/semaphore.c \ |
| 247 | bionic/sha1.c \ |
| 248 | bionic/ssp.c \ |
| 249 | bionic/stubs.c \ |
| 250 | bionic/system_properties.c \ |
| 251 | bionic/time64.c \ |
| 252 | bionic/thread_atexit.c \ |
| 253 | bionic/utime.c \ |
| 254 | bionic/utmp.c \ |
| 255 | netbsd/gethnamaddr.c \ |
| 256 | netbsd/isc/ev_timers.c \ |
| 257 | netbsd/isc/ev_streams.c \ |
| 258 | netbsd/inet/nsap_addr.c \ |
| 259 | netbsd/resolv/__dn_comp.c \ |
| 260 | netbsd/resolv/__res_close.c \ |
| 261 | netbsd/resolv/__res_send.c \ |
| 262 | netbsd/resolv/herror.c \ |
| 263 | netbsd/resolv/res_comp.c \ |
| 264 | netbsd/resolv/res_data.c \ |
| 265 | netbsd/resolv/res_debug.c \ |
| 266 | netbsd/resolv/res_init.c \ |
| 267 | netbsd/resolv/res_mkquery.c \ |
| 268 | netbsd/resolv/res_query.c \ |
| 269 | netbsd/resolv/res_send.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 270 | netbsd/resolv/res_state.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 271 | netbsd/resolv/res_cache.c \ |
| 272 | netbsd/net/nsdispatch.c \ |
| 273 | netbsd/net/getaddrinfo.c \ |
| 274 | netbsd/net/getnameinfo.c \ |
| 275 | netbsd/net/getservbyname.c \ |
| 276 | netbsd/net/getservent.c \ |
| 277 | netbsd/net/base64.c \ |
| 278 | netbsd/net/getservbyport.c \ |
| 279 | netbsd/nameser/ns_name.c \ |
| 280 | netbsd/nameser/ns_parse.c \ |
| 281 | netbsd/nameser/ns_ttl.c \ |
| 282 | netbsd/nameser/ns_netint.c \ |
| 283 | netbsd/nameser/ns_print.c \ |
Colin Cross | 4fa7b10 | 2010-01-12 18:59:25 -0800 | [diff] [blame] | 284 | netbsd/nameser/ns_samedomain.c \ |
| 285 | regex/regcomp.c \ |
| 286 | regex/regerror.c \ |
| 287 | regex/regexec.c \ |
| 288 | regex/regfree.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 289 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 290 | # Architecture specific source files go here |
| 291 | # ========================================================= |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 292 | ifeq ($(TARGET_ARCH),arm) |
| 293 | libc_common_src_files += \ |
David 'Digit' Turner | 97cf7f3 | 2010-01-22 18:59:05 -0800 | [diff] [blame] | 294 | bionic/bionic_clone.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 295 | arch-arm/bionic/__get_pc.S \ |
| 296 | arch-arm/bionic/__get_sp.S \ |
| 297 | arch-arm/bionic/_exit_with_stack_teardown.S \ |
| 298 | arch-arm/bionic/_setjmp.S \ |
| 299 | arch-arm/bionic/atomics_arm.S \ |
| 300 | arch-arm/bionic/clone.S \ |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 301 | arch-arm/bionic/eabi.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 302 | arch-arm/bionic/ffs.S \ |
| 303 | arch-arm/bionic/kill.S \ |
David 'Digit' Turner | 2a7ad97 | 2009-09-29 14:43:38 -0700 | [diff] [blame] | 304 | arch-arm/bionic/libgcc_compat.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 305 | arch-arm/bionic/tkill.S \ |
| 306 | arch-arm/bionic/memcmp.S \ |
| 307 | arch-arm/bionic/memcmp16.S \ |
| 308 | arch-arm/bionic/memcpy.S \ |
| 309 | arch-arm/bionic/memset.S \ |
| 310 | arch-arm/bionic/setjmp.S \ |
| 311 | arch-arm/bionic/sigsetjmp.S \ |
| 312 | arch-arm/bionic/strlen.c.arm \ |
| 313 | arch-arm/bionic/syscall.S \ |
Matt Fischer | e4fa46e | 2010-01-11 10:02:06 +0800 | [diff] [blame] | 314 | arch-arm/bionic/sigaction.c \ |
| 315 | arch-arm/bionic/__sig_restorer.S \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 316 | string/memmove.c.arm \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 317 | string/bcopy.c \ |
| 318 | string/strcmp.c \ |
| 319 | string/strncmp.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 320 | unistd/socketcalls.c |
| 321 | |
| 322 | # These files need to be arm so that gdbserver |
| 323 | # can set breakpoints in them without messing |
| 324 | # up any thumb code. |
| 325 | libc_common_src_files += \ |
| 326 | bionic/pthread.c.arm \ |
| 327 | bionic/pthread-timers.c.arm \ |
| 328 | bionic/ptrace.c.arm |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 329 | |
| 330 | # these are used by the static and dynamic versions of the libc |
| 331 | # respectively |
| 332 | libc_arch_static_src_files := \ |
| 333 | arch-arm/bionic/exidx_static.c |
| 334 | |
| 335 | libc_arch_dynamic_src_files := \ |
| 336 | arch-arm/bionic/exidx_dynamic.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 337 | else # !arm |
| 338 | |
| 339 | ifeq ($(TARGET_ARCH),x86) |
| 340 | libc_common_src_files += \ |
| 341 | arch-x86/bionic/__get_sp.S \ |
| 342 | arch-x86/bionic/__get_tls.c \ |
| 343 | arch-x86/bionic/__set_tls.c \ |
| 344 | arch-x86/bionic/atomics_x86.S \ |
| 345 | arch-x86/bionic/clone.S \ |
| 346 | arch-x86/bionic/_exit_with_stack_teardown.S \ |
| 347 | arch-x86/bionic/setjmp.S \ |
| 348 | arch-x86/bionic/_setjmp.S \ |
| 349 | arch-x86/bionic/vfork.S \ |
Bruce Beare | 3c543e1 | 2010-03-04 10:29:38 -0800 | [diff] [blame] | 350 | arch-x86/bionic/syscall.S \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 351 | arch-x86/string/bcopy_wrapper.S \ |
| 352 | arch-x86/string/memcpy_wrapper.S \ |
| 353 | arch-x86/string/memmove_wrapper.S \ |
| 354 | arch-x86/string/bzero_wrapper.S \ |
| 355 | arch-x86/string/memcmp_wrapper.S \ |
| 356 | arch-x86/string/memset_wrapper.S \ |
| 357 | arch-x86/string/strcmp_wrapper.S \ |
| 358 | arch-x86/string/strncmp_wrapper.S \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 359 | arch-x86/string/strlen.S \ |
| 360 | bionic/pthread.c \ |
| 361 | bionic/pthread-timers.c \ |
| 362 | bionic/ptrace.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 363 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 364 | # this is needed for static versions of libc |
| 365 | libc_arch_static_src_files := \ |
| 366 | arch-x86/bionic/dl_iterate_phdr_static.c |
| 367 | |
| 368 | libc_arch_dynamic_src_files := |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 369 | else # !x86 |
| 370 | |
| 371 | ifeq ($(TARGET_ARCH),sh) |
| 372 | libc_common_src_files += \ |
| 373 | arch-sh/bionic/__get_pc.S \ |
| 374 | arch-sh/bionic/__get_sp.S \ |
| 375 | arch-sh/bionic/_exit_with_stack_teardown.S \ |
| 376 | arch-sh/bionic/_setjmp.S \ |
| 377 | arch-sh/bionic/atomics_sh.c \ |
| 378 | arch-sh/bionic/atomic_cmpxchg.S \ |
| 379 | arch-sh/bionic/clone.S \ |
| 380 | arch-sh/bionic/pipe.S \ |
| 381 | arch-sh/bionic/memcpy.S \ |
| 382 | arch-sh/bionic/memset.S \ |
| 383 | arch-sh/bionic/bzero.S \ |
| 384 | arch-sh/bionic/setjmp.S \ |
| 385 | arch-sh/bionic/sigsetjmp.S \ |
| 386 | arch-sh/bionic/syscall.S \ |
| 387 | arch-sh/bionic/memmove.S \ |
| 388 | arch-sh/bionic/__set_tls.c \ |
| 389 | arch-sh/bionic/__get_tls.c \ |
| 390 | arch-sh/bionic/ffs.S \ |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 391 | string/bcopy.c \ |
| 392 | string/strcmp.c \ |
| 393 | string/strncmp.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 394 | string/memcmp.c \ |
| 395 | string/strlen.c \ |
Shin-ichiro KAWASAKI | 1009327 | 2009-09-28 16:11:39 +0900 | [diff] [blame] | 396 | bionic/pthread.c \ |
| 397 | bionic/pthread-timers.c \ |
| 398 | bionic/ptrace.c \ |
| 399 | unistd/socketcalls.c |
| 400 | endif # sh |
| 401 | |
| 402 | endif # !x86 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 403 | endif # !arm |
| 404 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 405 | # Define some common cflags |
| 406 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 407 | libc_common_cflags := \ |
| 408 | -DWITH_ERRLIST \ |
| 409 | -DANDROID_CHANGES \ |
| 410 | -DUSE_LOCKS \ |
| 411 | -DREALLOC_ZERO_BYTES_FREES \ |
| 412 | -D_LIBC=1 \ |
| 413 | -DSOFTFLOAT \ |
| 414 | -DFLOATING_POINT \ |
| 415 | -DNEED_PSELECT=1 \ |
| 416 | -DINET6 \ |
| 417 | -I$(LOCAL_PATH)/private \ |
Colin Cross | 4fa7b10 | 2010-01-12 18:59:25 -0800 | [diff] [blame] | 418 | -DUSE_DL_PREFIX \ |
| 419 | -DPOSIX_MISTAKE |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 420 | |
David 'Digit' Turner | d7ed1ae | 2010-03-05 14:17:35 -0800 | [diff] [blame] | 421 | # these macro definitions are required to implement the |
| 422 | # 'timezone' and 'daylight' global variables, as well as |
| 423 | # properly update the 'tm_gmtoff' field in 'struct tm'. |
| 424 | # |
| 425 | libc_common_cflags += \ |
| 426 | -DTM_GMTOFF=tm_gmtoff \ |
| 427 | -DUSG_COMPAT=1 |
| 428 | |
Dave Bort | d2c9dcc | 2009-04-23 15:50:03 -0700 | [diff] [blame] | 429 | ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 430 | libc_common_cflags += -DDEBUG |
| 431 | endif |
| 432 | |
| 433 | ifeq ($(TARGET_ARCH),arm) |
| 434 | libc_common_cflags += -fstrict-aliasing |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 435 | libc_crt_target_cflags := -mthumb-interwork |
David 'Digit' Turner | 4a05d12 | 2009-09-18 13:35:05 -0700 | [diff] [blame] | 436 | # |
| 437 | # Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library |
| 438 | # that it should access the hardware TLS register directly in |
| 439 | # private/bionic_tls.h |
| 440 | # |
| 441 | # The value must match your kernel configuration |
| 442 | # |
| 443 | ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) |
| 444 | libc_common_cflags += -DHAVE_ARM_TLS_REGISTER |
| 445 | endif |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 446 | else # !arm |
| 447 | ifeq ($(TARGET_ARCH),x86) |
| 448 | libc_crt_target_cflags := -m32 |
Bruce Beare | 8ff1a27 | 2010-03-04 11:03:37 -0800 | [diff] [blame] | 449 | |
| 450 | # Enable recent IA friendly memory routines (such as for Atom) |
| 451 | # These will not work on the earlier x86 machines |
| 452 | libc_common_cflags += -mtune=i686 -DUSE_SSSE3 -DUSE_SSE2 |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 453 | endif # x86 |
| 454 | endif # !arm |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 455 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 456 | # Define some common includes |
| 457 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 458 | libc_common_c_includes := \ |
| 459 | $(LOCAL_PATH)/stdlib \ |
| 460 | $(LOCAL_PATH)/string \ |
| 461 | $(LOCAL_PATH)/stdio |
| 462 | |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 463 | # Needed to access private/__dso_handle.S from |
| 464 | # crtbegin_xxx.S and crtend_xxx.S |
| 465 | # |
| 466 | libc_crt_target_cflags += -I$(LOCAL_PATH)/private |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 467 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 468 | # Define the libc run-time (crt) support object files that must be built, |
| 469 | # which are needed to build all other objects (shared/static libs and |
| 470 | # executables) |
| 471 | # ========================================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 472 | |
David 'Digit' Turner | 3b43f87 | 2010-07-01 23:09:28 -0700 | [diff] [blame] | 473 | ifneq ($(filter arm x86,$(TARGET_ARCH)),) |
| 474 | # ARM and x86 need crtbegin_so/crtend_so. |
| 475 | # |
| 476 | # For x86, the .init section must point to a function that calls all |
| 477 | # entries in the .ctors section. (on ARM this is done through the |
| 478 | # .init_array section instead). |
| 479 | # |
| 480 | # For both platforms, the .fini_array section must point to a function |
| 481 | # that will call __cxa_finalize(&__dso_handle) in order to ensure that |
| 482 | # static C++ destructors are properly called on dlclose(). |
| 483 | # |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 484 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o |
| 485 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S |
| 486 | @mkdir -p $(dir $@) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 487 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 488 | ALL_GENERATED_SOURCES += $(GEN) |
| 489 | |
| 490 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o |
| 491 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S |
| 492 | @mkdir -p $(dir $@) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 493 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 494 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 495 | endif # TARGET_ARCH == x86 |
| 496 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 497 | |
| 498 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o |
| 499 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_static.S |
| 500 | @mkdir -p $(dir $@) |
| 501 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 502 | ALL_GENERATED_SOURCES += $(GEN) |
| 503 | |
| 504 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o |
| 505 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_dynamic.S |
| 506 | @mkdir -p $(dir $@) |
| 507 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 508 | ALL_GENERATED_SOURCES += $(GEN) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 509 | |
| 510 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 511 | # We rename crtend.o to crtend_android.o to avoid a |
| 512 | # name clash between gcc and bionic. |
| 513 | GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o |
| 514 | $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S |
| 515 | @mkdir -p $(dir $@) |
| 516 | $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $< |
| 517 | ALL_GENERATED_SOURCES += $(GEN) |
| 518 | |
| 519 | |
| 520 | # To enable malloc leak check for statically linked programs, add |
| 521 | # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk |
| 522 | WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) |
| 523 | |
| 524 | # ======================================================== |
| 525 | # libc_common.a |
| 526 | # ======================================================== |
| 527 | include $(CLEAR_VARS) |
| 528 | |
| 529 | LOCAL_SRC_FILES := $(libc_common_src_files) |
| 530 | LOCAL_CFLAGS := $(libc_common_cflags) |
| 531 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 532 | LOCAL_MODULE := libc_common |
| 533 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 534 | |
| 535 | include $(BUILD_STATIC_LIBRARY) |
| 536 | |
| 537 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 538 | # ======================================================== |
Dima Zavin | 49e5533 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 539 | # libc_nomalloc.a |
| 540 | # ======================================================== |
| 541 | # |
| 542 | # This is a version of the static C library that does not |
| 543 | # include malloc. It's useful in situations when calling |
| 544 | # the user wants to provide their own malloc implementation, |
| 545 | # or wants to explicitly disallow the use of the use of malloc, |
| 546 | # like the dynamic loader. |
| 547 | |
| 548 | include $(CLEAR_VARS) |
| 549 | |
| 550 | LOCAL_SRC_FILES := \ |
| 551 | $(libc_arch_static_src_files) \ |
| 552 | bionic/libc_init_static.c |
| 553 | |
| 554 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 555 | LOCAL_CFLAGS := $(libc_common_cflags) |
| 556 | |
| 557 | LOCAL_MODULE := libc_nomalloc |
| 558 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 559 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 560 | |
| 561 | include $(BUILD_STATIC_LIBRARY) |
| 562 | |
| 563 | |
| 564 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 565 | # libc.a |
| 566 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 567 | include $(CLEAR_VARS) |
| 568 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 569 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 570 | $(libc_arch_static_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 571 | bionic/dlmalloc.c \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 572 | bionic/malloc_debug_common.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 573 | bionic/libc_init_static.c |
| 574 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 575 | LOCAL_CFLAGS := $(libc_common_cflags) \ |
| 576 | -DLIBC_STATIC |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 577 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 578 | LOCAL_MODULE := libc |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 579 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 580 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 581 | |
| 582 | include $(BUILD_STATIC_LIBRARY) |
| 583 | |
| 584 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 585 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 586 | # libc.so |
| 587 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 588 | include $(CLEAR_VARS) |
| 589 | |
| 590 | LOCAL_CFLAGS := $(libc_common_cflags) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 591 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 592 | |
| 593 | LOCAL_SRC_FILES := \ |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 594 | $(libc_arch_dynamic_src_files) \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 595 | bionic/dlmalloc.c \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 596 | bionic/malloc_debug_common.c \ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 597 | bionic/libc_init_dynamic.c |
| 598 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 599 | LOCAL_MODULE:= libc |
| 600 | |
| 601 | # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, |
| 602 | # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This |
| 603 | # ensures that symbols that are pulled into those new libraries from libgcc.a are not declared |
| 604 | # external; if that were the case, then libc would not pull those symbols from libgcc.a as it |
| 605 | # should, instead relying on the external symbols from the dependent libraries. That would |
| 606 | # create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what |
| 607 | # you wanted! |
| 608 | |
| 609 | LOCAL_SHARED_LIBRARIES := libdl |
| 610 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 611 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 612 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 613 | include $(BUILD_SHARED_LIBRARY) |
| 614 | |
| 615 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 616 | # For all builds, except for the -user build we will enable memory |
| 617 | # allocation checking (including memory leaks, buffer overwrites, etc.) |
| 618 | # Note that all these checks are also controlled by env. settings |
| 619 | # that can enable, or disable specific checks. Note also that some of |
| 620 | # the checks are available only in emulator and are implemeted in |
| 621 | # libc_malloc_qemu_instrumented.so. |
| 622 | ifneq ($(TARGET_BUILD_VARIANT),user) |
| 623 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 624 | # ======================================================== |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 625 | # libc_malloc_debug_leak.so |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 626 | # ======================================================== |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 627 | include $(CLEAR_VARS) |
| 628 | |
Dima Zavin | ca122b0 | 2009-05-27 10:52:37 -0700 | [diff] [blame] | 629 | LOCAL_CFLAGS := \ |
| 630 | $(libc_common_cflags) \ |
| 631 | -DMALLOC_LEAK_CHECK |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 632 | |
| 633 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 634 | |
| 635 | LOCAL_SRC_FILES := \ |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 636 | bionic/malloc_debug_leak.c |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 637 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 638 | LOCAL_MODULE:= libc_malloc_debug_leak |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 639 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 640 | LOCAL_SHARED_LIBRARIES := libc |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 641 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 642 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
Bruce Beare | aa46fa2 | 2010-07-08 14:47:50 -0700 | [diff] [blame^] | 643 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 644 | # Don't prelink |
| 645 | LOCAL_PRELINK_MODULE := false |
| 646 | # Don't install on release build |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 647 | LOCAL_MODULE_TAGS := eng debug |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 648 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 649 | include $(BUILD_SHARED_LIBRARY) |
| 650 | |
Vladimir Chtchetkine | b74ceb2 | 2009-11-17 14:13:38 -0800 | [diff] [blame] | 651 | |
| 652 | # ======================================================== |
| 653 | # libc_malloc_debug_qemu.so |
| 654 | # ======================================================== |
| 655 | include $(CLEAR_VARS) |
| 656 | |
| 657 | LOCAL_CFLAGS := \ |
| 658 | $(libc_common_cflags) \ |
| 659 | -DMALLOC_QEMU_INSTRUMENT |
| 660 | |
| 661 | LOCAL_C_INCLUDES := $(libc_common_c_includes) |
| 662 | |
| 663 | LOCAL_SRC_FILES := \ |
| 664 | bionic/malloc_debug_qemu.c |
| 665 | |
| 666 | LOCAL_MODULE:= libc_malloc_debug_qemu |
| 667 | |
| 668 | LOCAL_SHARED_LIBRARIES := libc |
| 669 | LOCAL_WHOLE_STATIC_LIBRARIES := libc_common |
| 670 | LOCAL_SYSTEM_SHARED_LIBRARIES := |
| 671 | # Don't prelink |
| 672 | LOCAL_PRELINK_MODULE := false |
| 673 | # Don't install on release build |
| 674 | LOCAL_MODULE_TAGS := eng debug |
| 675 | |
| 676 | include $(BUILD_SHARED_LIBRARY) |
| 677 | |
| 678 | endif #!user |
| 679 | |
| 680 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 681 | # ======================================================== |
| 682 | include $(call all-makefiles-under,$(LOCAL_PATH)) |