blob: f950c7e1bbbbf23a38f20385e894c84fca37948e [file] [log] [blame]
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -07001LOCAL_PATH:= $(call my-dir)
2
The Android Open Source Project4e468ed2008-12-17 18:03:48 -08003include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -07004libc_common_src_files := \
5 $(syscall_src) \
6 unistd/abort.c \
7 unistd/alarm.c \
8 unistd/brk.c \
9 unistd/creat.c \
10 unistd/daemon.c \
11 unistd/exec.c \
12 unistd/fcntl.c \
13 unistd/fnmatch.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080014 unistd/ftime.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070015 unistd/ftok.c \
16 unistd/getcwd.c \
17 unistd/getdtablesize.c \
18 unistd/gethostname.c \
19 unistd/getopt_long.c \
20 unistd/getpgrp.c \
21 unistd/getpriority.c \
22 unistd/getpt.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080023 unistd/initgroups.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070024 unistd/isatty.c \
25 unistd/issetugid.c \
26 unistd/lseek64.c \
27 unistd/mmap.c \
28 unistd/nice.c \
29 unistd/open.c \
30 unistd/openat.c \
31 unistd/opendir.c \
32 unistd/pathconf.c \
33 unistd/perror.c \
34 unistd/popen.c \
35 unistd/pread.c \
36 unistd/pselect.c \
37 unistd/ptsname.c \
38 unistd/ptsname_r.c \
39 unistd/pwrite.c \
40 unistd/raise.c \
41 unistd/reboot.c \
42 unistd/recv.c \
43 unistd/sbrk.c \
44 unistd/send.c \
45 unistd/setegid.c \
46 unistd/seteuid.c \
47 unistd/setpgrp.c \
48 unistd/sigblock.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080049 unistd/siginterrupt.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070050 unistd/siglist.c \
51 unistd/signal.c \
52 unistd/sigsetmask.c \
53 unistd/sigsuspend.c \
54 unistd/sigwait.c \
55 unistd/sleep.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070056 unistd/statfs.c \
57 unistd/strsignal.c \
58 unistd/sysconf.c \
59 unistd/syslog.c \
60 unistd/system.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080061 unistd/tcgetpgrp.c \
62 unistd/tcsetpgrp.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070063 unistd/time.c \
64 unistd/umount.c \
65 unistd/unlockpt.c \
66 unistd/usleep.c \
67 unistd/wait.c \
68 stdio/asprintf.c \
69 stdio/fclose.c \
70 stdio/fdopen.c \
71 stdio/feof.c \
72 stdio/ferror.c \
73 stdio/fflush.c \
74 stdio/fgetc.c \
75 stdio/fgetln.c \
76 stdio/fgetpos.c \
77 stdio/fgets.c \
78 stdio/fileno.c \
79 stdio/findfp.c \
80 stdio/flags.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -080081 stdio/flockfile.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -070082 stdio/fopen.c \
83 stdio/fprintf.c \
84 stdio/fpurge.c \
85 stdio/fputc.c \
86 stdio/fputs.c \
87 stdio/fread.c \
88 stdio/freopen.c \
89 stdio/fscanf.c \
90 stdio/fseek.c \
91 stdio/fsetpos.c \
92 stdio/ftell.c \
93 stdio/funopen.c \
94 stdio/fvwrite.c \
95 stdio/fwalk.c \
96 stdio/fwrite.c \
97 stdio/getc.c \
98 stdio/getchar.c \
99 stdio/gets.c \
100 stdio/makebuf.c \
101 stdio/mktemp.c \
102 stdio/printf.c \
103 stdio/putc.c \
104 stdio/putchar.c \
105 stdio/puts.c \
106 stdio/putw.c \
107 stdio/refill.c \
108 stdio/remove.c \
109 stdio/rewind.c \
110 stdio/rget.c \
111 stdio/scanf.c \
112 stdio/setbuf.c \
113 stdio/setbuffer.c \
114 stdio/setvbuf.c \
115 stdio/snprintf.c\
116 stdio/sprintf.c \
117 stdio/sscanf.c \
118 stdio/stdio.c \
119 stdio/tempnam.c \
120 stdio/tmpfile.c \
121 stdio/tmpnam.c \
122 stdio/ungetc.c \
123 stdio/vasprintf.c \
124 stdio/vfprintf.c \
125 stdio/vfscanf.c \
126 stdio/vprintf.c \
127 stdio/vsnprintf.c \
128 stdio/vsprintf.c \
129 stdio/vscanf.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800130 stdio/vsscanf.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700131 stdio/wbuf.c \
132 stdio/wsetup.c \
133 stdlib/_rand48.c \
134 stdlib/assert.c \
135 stdlib/atexit.c \
136 stdlib/atoi.c \
137 stdlib/atol.c \
138 stdlib/atoll.c \
139 stdlib/bsearch.c \
140 stdlib/ctype_.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800141 stdlib/div.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700142 stdlib/exit.c \
143 stdlib/getenv.c \
144 stdlib/jrand48.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800145 stdlib/ldiv.c \
146 stdlib/lldiv.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700147 stdlib/locale.c \
148 stdlib/lrand48.c \
149 stdlib/mrand48.c \
150 stdlib/nrand48.c \
151 stdlib/putenv.c \
152 stdlib/qsort.c \
153 stdlib/seed48.c \
154 stdlib/setenv.c \
155 stdlib/setjmperr.c \
156 stdlib/srand48.c \
157 stdlib/strntoimax.c \
158 stdlib/strntoumax.c \
159 stdlib/strtod.c \
160 stdlib/strtoimax.c \
161 stdlib/strtol.c \
162 stdlib/strtoll.c \
163 stdlib/strtoul.c \
164 stdlib/strtoull.c \
165 stdlib/strtoumax.c \
166 stdlib/tolower_.c \
167 stdlib/toupper_.c \
168 stdlib/wchar.c \
169 string/bcopy.c \
170 string/index.c \
171 string/memccpy.c \
172 string/memchr.c \
173 string/memmem.c \
174 string/memmove.c.arm \
175 string/memrchr.c \
176 string/memswap.c \
177 string/strcasecmp.c \
178 string/strcasestr.c \
179 string/strcat.c \
180 string/strchr.c \
181 string/strcmp.c \
182 string/strcpy.c \
183 string/strcspn.c \
184 string/strdup.c \
185 string/strerror.c \
186 string/strerror_r.c \
187 string/strlcat.c \
188 string/strlcpy.c \
189 string/strncat.c \
190 string/strncmp.c \
191 string/strncpy.c \
192 string/strndup.c \
193 string/strnlen.c \
194 string/strpbrk.c \
195 string/strrchr.c \
196 string/strsep.c \
197 string/strspn.c \
198 string/strstr.c \
199 string/strtok.c \
200 string/strtotimeval.c \
201 inet/bindresvport.c \
202 inet/inet_addr.c \
203 inet/inet_aton.c \
204 inet/inet_ntoa.c \
205 inet/inet_ntop.c \
206 inet/inet_pton.c \
207 tzcode/asctime.c \
208 tzcode/difftime.c \
209 tzcode/localtime.c \
210 tzcode/strftime.c \
211 tzcode/strptime.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700212 bionic/__errno.c \
213 bionic/__set_errno.c \
214 bionic/_rand48.c \
215 bionic/arc4random.c \
216 bionic/basename.c \
217 bionic/basename_r.c \
218 bionic/dirname.c \
219 bionic/dirname_r.c \
220 bionic/drand48.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700221 bionic/erand48.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800222 bionic/fork.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700223 bionic/if_nametoindex.c \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800224 bionic/if_indextoname.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700225 bionic/ioctl.c \
226 bionic/ldexp.c \
227 bionic/libc_init_common.c \
228 bionic/logd_write.c \
229 bionic/md5.c \
230 bionic/pututline.c \
231 bionic/realpath.c \
232 bionic/semaphore.c \
233 bionic/sha1.c \
234 bionic/ssp.c \
235 bionic/stubs.c \
236 bionic/system_properties.c \
237 bionic/thread_atexit.c \
238 bionic/utime.c \
239 bionic/utmp.c \
240 netbsd/gethnamaddr.c \
241 netbsd/isc/ev_timers.c \
242 netbsd/isc/ev_streams.c \
243 netbsd/inet/nsap_addr.c \
244 netbsd/resolv/__dn_comp.c \
245 netbsd/resolv/__res_close.c \
246 netbsd/resolv/__res_send.c \
247 netbsd/resolv/herror.c \
248 netbsd/resolv/res_comp.c \
249 netbsd/resolv/res_data.c \
250 netbsd/resolv/res_debug.c \
251 netbsd/resolv/res_init.c \
252 netbsd/resolv/res_mkquery.c \
253 netbsd/resolv/res_query.c \
254 netbsd/resolv/res_send.c \
255 netbsd/resolv/res_state.c.arm \
256 netbsd/resolv/res_cache.c \
257 netbsd/net/nsdispatch.c \
258 netbsd/net/getaddrinfo.c \
259 netbsd/net/getnameinfo.c \
260 netbsd/net/getservbyname.c \
261 netbsd/net/getservent.c \
262 netbsd/net/base64.c \
263 netbsd/net/getservbyport.c \
264 netbsd/nameser/ns_name.c \
265 netbsd/nameser/ns_parse.c \
266 netbsd/nameser/ns_ttl.c \
267 netbsd/nameser/ns_netint.c \
268 netbsd/nameser/ns_print.c \
269 netbsd/nameser/ns_samedomain.c
270
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800271ifeq ($(TARGET_ARCH),arm)
272libc_common_src_files += \
273 bionic/eabi.c \
274 arch-arm/bionic/__get_pc.S \
275 arch-arm/bionic/__get_sp.S \
276 arch-arm/bionic/_exit_with_stack_teardown.S \
277 arch-arm/bionic/_setjmp.S \
278 arch-arm/bionic/atomics_arm.S \
279 arch-arm/bionic/clone.S \
The Android Open Source Project6d6c82c2009-01-09 17:50:54 -0800280 arch-arm/bionic/ffs.S \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800281 arch-arm/bionic/kill.S \
282 arch-arm/bionic/tkill.S \
283 arch-arm/bionic/memcmp.S \
284 arch-arm/bionic/memcmp16.S \
285 arch-arm/bionic/memcpy.S \
286 arch-arm/bionic/memset.S \
287 arch-arm/bionic/setjmp.S \
288 arch-arm/bionic/sigsetjmp.S \
289 arch-arm/bionic/strlen.c.arm \
290 arch-arm/bionic/syscall.S \
291 unistd/socketcalls.c
292
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700293# These files need to be arm so that gdbserver
294# can set breakpoints in them without messing
295# up any thumb code.
296libc_common_src_files += \
297 bionic/pthread.c.arm \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800298 bionic/pthread-timers.c.arm \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700299 bionic/ptrace.c.arm
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800300else # !arm
301
302ifeq ($(TARGET_ARCH),x86)
303libc_common_src_files += \
304 arch-x86/bionic/__get_sp.S \
305 arch-x86/bionic/__get_tls.c \
306 arch-x86/bionic/__set_tls.c \
307 arch-x86/bionic/atomics_x86.S \
308 arch-x86/bionic/clone.S \
309 arch-x86/bionic/_exit_with_stack_teardown.S \
310 arch-x86/bionic/setjmp.S \
311 arch-x86/bionic/_setjmp.S \
312 arch-x86/bionic/vfork.S \
313 arch-x86/string/bzero.S \
314 arch-x86/string/memset.S \
315 arch-x86/string/memcmp.S \
316 arch-x86/string/memcpy.S \
317 arch-x86/string/strlen.S \
318 bionic/pthread.c \
319 bionic/pthread-timers.c \
320 bionic/ptrace.c
321endif # x86
322
323endif # !arm
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700324
325libc_common_cflags := \
326 -DWITH_ERRLIST \
327 -DANDROID_CHANGES \
328 -DUSE_LOCKS \
329 -DREALLOC_ZERO_BYTES_FREES \
330 -D_LIBC=1 \
331 -DSOFTFLOAT \
332 -DFLOATING_POINT \
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800333 -DNEED_PSELECT=1 \
The Android Open Source Project6d6c82c2009-01-09 17:50:54 -0800334 -DINET6 \
335 -I$(LOCAL_PATH)/private \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700336
337ifeq ($(TARGET_BUILD_TYPE),debug)
338 libc_common_cflags += -DDEBUG
339endif
340
341ifeq ($(TARGET_ARCH),arm)
342 libc_common_cflags += -fstrict-aliasing
343endif
344
345libc_common_c_includes := \
346 $(LOCAL_PATH)/stdlib \
347 $(LOCAL_PATH)/string \
348 $(LOCAL_PATH)/stdio
349
350# libc_common.a
351# ========================================================
352
353include $(CLEAR_VARS)
354
355LOCAL_SRC_FILES := $(libc_common_src_files)
356LOCAL_CFLAGS := $(libc_common_cflags) -DUSE_DL_PREFIX
357LOCAL_C_INCLUDES := $(libc_common_c_includes)
358
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800359ifneq ($(TARGET_SIMULATOR),true)
360 ifeq ($(TARGET_ARCH),arm)
361 crtend_target_cflags := -mthumb-interwork
362 else
363 ifeq ($(TARGET_ARCH),x86)
364 crtend_target_cflags := -m32
365 endif
366 endif
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700367# We rename crtend.o to crtend_android.o to avoid a
368# name clash between gcc and bionic.
369GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800370$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700371 @mkdir -p $(dir $@)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800372 $(TARGET_CC) $(crtend_target_cflags) -o $@ -c $<
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700373ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800374endif
375
376
377# crtbegin_so.o/crtend_so.o
378# These are needed for building the shared libs.
379ifneq ($(TARGET_SIMULATOR),true)
380
381ifeq ($(TARGET_ARCH),x86)
382
383crt_begin_end_so_target_cflags := -m32
384
385GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
386$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S
387 @mkdir -p $(dir $@)
388 $(TARGET_CC) $(crt_begin_end_so_target_cflags) -o $@ -c $<
389ALL_GENERATED_SOURCES += $(GEN)
390
391GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
392$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S
393 @mkdir -p $(dir $@)
394 $(TARGET_CC) $(crt_begin_end_so_target_cflags) -o $@ -c $<
395ALL_GENERATED_SOURCES += $(GEN)
396
397endif # TARGET_ARCH == x86
398
399endif # !TARGET_SIMULATOR
400
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700401
402LOCAL_MODULE := libc_common
403LOCAL_SYSTEM_SHARED_LIBRARIES :=
404
405include $(BUILD_STATIC_LIBRARY)
406
407
408# libc.a
409# ========================================================
410
411include $(CLEAR_VARS)
412
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800413include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700414
415# To enable malloc leak check for statically linked programs, add
416# "WITH_MALLOC_CHECK_LIBC_A := true" to device/buildspec.mk
417WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
418
419LOCAL_SRC_FILES := \
420 $(libc_common_src_files) \
421 bionic/dlmalloc.c \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700422 bionic/libc_init_static.c
423
424ifeq ($(WITH_MALLOC_CHECK_LIBC_A),true)
425 LOCAL_SRC_FILES += bionic/malloc_leak.c.arm
426endif
427
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800428ifeq ($(TARGET_ARCH),arm)
429LOCAL_SRC_FILES += \
430 arch-arm/bionic/exidx_static.c
431
432else # TARGET_ARCH != arm
433
434ifeq ($(TARGET_ARCH),x86)
435LOCAL_SRC_FILES += \
436 arch-x86/bionic/dl_iterate_phdr_static.c
437endif
438
439endif
440
441ifneq ($(TARGET_SIMULATOR),true)
442 ifeq ($(TARGET_ARCH),arm)
443 crtbegin_static_target_cflags := -mthumb-interwork
444 else
445 ifeq ($(TARGET_ARCH),x86)
446 crtbegin_static_target_cflags := -m32
447 endif
448 endif
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700449GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800450$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_static.S
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700451 @mkdir -p $(dir $@)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800452 $(TARGET_CC) $(crtbegin_static_target_cflags) -o $@ -c $<
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700453ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800454endif
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700455
456LOCAL_CFLAGS := $(libc_common_cflags)
457
458LOCAL_C_INCLUDES := $(libc_common_c_includes)
459
460ifeq ($(WITH_MALLOC_CHECK_LIBC_A),true)
461 LOCAL_CFLAGS += -DUSE_DL_PREFIX -DMALLOC_LEAK_CHECK
462endif
463
464LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
465LOCAL_MODULE:= libc
466LOCAL_SYSTEM_SHARED_LIBRARIES :=
467
468include $(BUILD_STATIC_LIBRARY)
469
470
471# libc.so
472# ========================================================
473
474include $(CLEAR_VARS)
475
476LOCAL_CFLAGS := $(libc_common_cflags)
477
478LOCAL_CFLAGS += -DUSE_DL_PREFIX
479
480LOCAL_C_INCLUDES := $(libc_common_c_includes)
481
482LOCAL_SRC_FILES := \
483 bionic/dlmalloc.c \
484 bionic/malloc_leak.c.arm \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700485 bionic/libc_init_dynamic.c
486
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800487ifeq ($(TARGET_ARCH),arm)
488LOCAL_SRC_FILES += \
489 arch-arm/bionic/exidx_dynamic.c
490endif
491
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700492LOCAL_MODULE:= libc
493
494# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
495# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
496# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
497# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
498# should, instead relying on the external symbols from the dependent libraries. That would
499# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
500# you wanted!
501
502LOCAL_SHARED_LIBRARIES := libdl
503LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
504LOCAL_SYSTEM_SHARED_LIBRARIES :=
505
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800506ifneq ($(TARGET_SIMULATOR),true)
507 ifeq ($(TARGET_ARCH),arm)
508 crtbegin_dynamic_target_cflags := -mthumb-interwork
509 else
510 ifeq ($(TARGET_ARCH),x86)
511 crtbegin_dynamic_target_cflags := -m32
512 endif
513 endif
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700514GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800515$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_dynamic.S
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700516 @mkdir -p $(dir $@)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800517 $(TARGET_CC) $(crtbegin_dynamic_target_cflags) -o $@ -c $<
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700518ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800519endif
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700520
521include $(BUILD_SHARED_LIBRARY)
522
523
524# libc_debug.so
525# ========================================================
526
527include $(CLEAR_VARS)
528
529LOCAL_CFLAGS := $(libc_common_cflags)
530
531LOCAL_CFLAGS += -DUSE_DL_PREFIX -DMALLOC_LEAK_CHECK
532
533LOCAL_C_INCLUDES := $(libc_common_c_includes)
534
535LOCAL_SRC_FILES := \
536 bionic/dlmalloc.c \
537 bionic/malloc_leak.c.arm \
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700538 bionic/libc_init_dynamic.c
539
The Android Open Source Project4e468ed2008-12-17 18:03:48 -0800540ifeq ($(TARGET_ARCH),arm)
541LOCAL_SRC_FILES += \
542 arch-arm/bionic/exidx_dynamic.c
543endif
544
The Android Open Source Projecta27d2ba2008-10-21 07:00:00 -0700545LOCAL_MODULE:= libc_debug
546
547# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
548# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
549# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
550# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
551# should, instead relying on the external symbols from the dependent libraries. That would
552# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
553# you wanted!
554
555LOCAL_SHARED_LIBRARIES := libdl
556LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
557LOCAL_SYSTEM_SHARED_LIBRARIES :=
558# Don't prelink
559LOCAL_PRELINK_MODULE := false
560# Don't install on release build
561LOCAL_MODULE_TAGS := eng
562
563GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
564ALL_GENERATED_SOURCES += $(GEN)
565
566include $(BUILD_SHARED_LIBRARY)
567
568# ========================================================
569include $(call all-makefiles-under,$(LOCAL_PATH))