blob: 98b28097581c9e7fe3b6b4fead94546667bbca16 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001LOCAL_PATH:= $(call my-dir)
2
3include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk
Dima Zavinca122b02009-05-27 10:52:37 -07004
5# Define the common source files for all the libc instances
6# =========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08007libc_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 \
29 unistd/lseek64.c \
30 unistd/mmap.c \
31 unistd/nice.c \
32 unistd/open.c \
33 unistd/openat.c \
34 unistd/opendir.c \
35 unistd/pathconf.c \
36 unistd/perror.c \
37 unistd/popen.c \
38 unistd/pread.c \
39 unistd/pselect.c \
40 unistd/ptsname.c \
41 unistd/ptsname_r.c \
42 unistd/pwrite.c \
43 unistd/raise.c \
44 unistd/reboot.c \
45 unistd/recv.c \
46 unistd/sbrk.c \
47 unistd/send.c \
48 unistd/setegid.c \
49 unistd/seteuid.c \
50 unistd/setpgrp.c \
51 unistd/sigblock.c \
52 unistd/siginterrupt.c \
53 unistd/siglist.c \
54 unistd/signal.c \
55 unistd/sigsetmask.c \
56 unistd/sigsuspend.c \
57 unistd/sigwait.c \
58 unistd/sleep.c \
59 unistd/statfs.c \
60 unistd/strsignal.c \
61 unistd/sysconf.c \
62 unistd/syslog.c \
63 unistd/system.c \
64 unistd/tcgetpgrp.c \
65 unistd/tcsetpgrp.c \
66 unistd/time.c \
67 unistd/umount.c \
68 unistd/unlockpt.c \
69 unistd/usleep.c \
70 unistd/wait.c \
71 stdio/asprintf.c \
72 stdio/clrerr.c \
73 stdio/fclose.c \
74 stdio/fdopen.c \
75 stdio/feof.c \
76 stdio/ferror.c \
77 stdio/fflush.c \
78 stdio/fgetc.c \
79 stdio/fgetln.c \
80 stdio/fgetpos.c \
81 stdio/fgets.c \
82 stdio/fileno.c \
83 stdio/findfp.c \
84 stdio/flags.c \
85 stdio/flockfile.c \
86 stdio/fopen.c \
87 stdio/fprintf.c \
88 stdio/fpurge.c \
89 stdio/fputc.c \
90 stdio/fputs.c \
91 stdio/fread.c \
92 stdio/freopen.c \
93 stdio/fscanf.c \
94 stdio/fseek.c \
95 stdio/fsetpos.c \
96 stdio/ftell.c \
97 stdio/funopen.c \
98 stdio/fvwrite.c \
99 stdio/fwalk.c \
100 stdio/fwrite.c \
101 stdio/getc.c \
102 stdio/getchar.c \
103 stdio/gets.c \
104 stdio/makebuf.c \
105 stdio/mktemp.c \
106 stdio/printf.c \
107 stdio/putc.c \
108 stdio/putchar.c \
109 stdio/puts.c \
110 stdio/putw.c \
111 stdio/refill.c \
112 stdio/remove.c \
113 stdio/rewind.c \
114 stdio/rget.c \
115 stdio/scanf.c \
116 stdio/setbuf.c \
117 stdio/setbuffer.c \
118 stdio/setvbuf.c \
119 stdio/snprintf.c\
120 stdio/sprintf.c \
121 stdio/sscanf.c \
122 stdio/stdio.c \
123 stdio/tempnam.c \
124 stdio/tmpfile.c \
125 stdio/tmpnam.c \
126 stdio/ungetc.c \
127 stdio/vasprintf.c \
128 stdio/vfprintf.c \
129 stdio/vfscanf.c \
130 stdio/vprintf.c \
131 stdio/vsnprintf.c \
132 stdio/vsprintf.c \
133 stdio/vscanf.c \
134 stdio/vsscanf.c \
135 stdio/wbuf.c \
136 stdio/wsetup.c \
137 stdlib/_rand48.c \
138 stdlib/assert.c \
139 stdlib/atexit.c \
140 stdlib/atoi.c \
141 stdlib/atol.c \
142 stdlib/atoll.c \
143 stdlib/bsearch.c \
144 stdlib/ctype_.c \
145 stdlib/div.c \
146 stdlib/exit.c \
147 stdlib/getenv.c \
148 stdlib/jrand48.c \
149 stdlib/ldiv.c \
150 stdlib/lldiv.c \
151 stdlib/locale.c \
152 stdlib/lrand48.c \
153 stdlib/mrand48.c \
154 stdlib/nrand48.c \
155 stdlib/putenv.c \
156 stdlib/qsort.c \
157 stdlib/seed48.c \
158 stdlib/setenv.c \
159 stdlib/setjmperr.c \
160 stdlib/srand48.c \
161 stdlib/strntoimax.c \
162 stdlib/strntoumax.c \
163 stdlib/strtod.c \
164 stdlib/strtoimax.c \
165 stdlib/strtol.c \
166 stdlib/strtoll.c \
167 stdlib/strtoul.c \
168 stdlib/strtoull.c \
169 stdlib/strtoumax.c \
170 stdlib/tolower_.c \
171 stdlib/toupper_.c \
172 stdlib/wchar.c \
173 string/bcopy.c \
174 string/index.c \
175 string/memccpy.c \
176 string/memchr.c \
177 string/memmem.c \
178 string/memmove.c.arm \
179 string/memrchr.c \
180 string/memswap.c \
181 string/strcasecmp.c \
182 string/strcasestr.c \
183 string/strcat.c \
184 string/strchr.c \
185 string/strcmp.c \
186 string/strcoll.c \
187 string/strcpy.c \
188 string/strcspn.c \
189 string/strdup.c \
190 string/strerror.c \
191 string/strerror_r.c \
192 string/strlcat.c \
193 string/strlcpy.c \
194 string/strncat.c \
195 string/strncmp.c \
196 string/strncpy.c \
197 string/strndup.c \
198 string/strnlen.c \
199 string/strpbrk.c \
200 string/strrchr.c \
201 string/strsep.c \
202 string/strspn.c \
203 string/strstr.c \
204 string/strtok.c \
205 string/strtotimeval.c \
206 string/strxfrm.c \
207 inet/bindresvport.c \
208 inet/inet_addr.c \
209 inet/inet_aton.c \
210 inet/inet_ntoa.c \
211 inet/inet_ntop.c \
212 inet/inet_pton.c \
213 tzcode/asctime.c \
214 tzcode/difftime.c \
215 tzcode/localtime.c \
216 tzcode/strftime.c \
217 tzcode/strptime.c \
218 bionic/__errno.c \
219 bionic/__set_errno.c \
220 bionic/_rand48.c \
221 bionic/arc4random.c \
222 bionic/basename.c \
223 bionic/basename_r.c \
224 bionic/dirname.c \
225 bionic/dirname_r.c \
226 bionic/drand48.c \
227 bionic/erand48.c \
228 bionic/fork.c \
229 bionic/if_nametoindex.c \
230 bionic/if_indextoname.c \
231 bionic/ioctl.c \
232 bionic/ldexp.c \
233 bionic/libc_init_common.c \
234 bionic/logd_write.c \
235 bionic/md5.c \
236 bionic/pututline.c \
237 bionic/realpath.c \
238 bionic/semaphore.c \
239 bionic/sha1.c \
240 bionic/ssp.c \
241 bionic/stubs.c \
242 bionic/system_properties.c \
243 bionic/time64.c \
244 bionic/thread_atexit.c \
245 bionic/utime.c \
246 bionic/utmp.c \
247 netbsd/gethnamaddr.c \
248 netbsd/isc/ev_timers.c \
249 netbsd/isc/ev_streams.c \
250 netbsd/inet/nsap_addr.c \
251 netbsd/resolv/__dn_comp.c \
252 netbsd/resolv/__res_close.c \
253 netbsd/resolv/__res_send.c \
254 netbsd/resolv/herror.c \
255 netbsd/resolv/res_comp.c \
256 netbsd/resolv/res_data.c \
257 netbsd/resolv/res_debug.c \
258 netbsd/resolv/res_init.c \
259 netbsd/resolv/res_mkquery.c \
260 netbsd/resolv/res_query.c \
261 netbsd/resolv/res_send.c \
262 netbsd/resolv/res_state.c.arm \
263 netbsd/resolv/res_cache.c \
264 netbsd/net/nsdispatch.c \
265 netbsd/net/getaddrinfo.c \
266 netbsd/net/getnameinfo.c \
267 netbsd/net/getservbyname.c \
268 netbsd/net/getservent.c \
269 netbsd/net/base64.c \
270 netbsd/net/getservbyport.c \
271 netbsd/nameser/ns_name.c \
272 netbsd/nameser/ns_parse.c \
273 netbsd/nameser/ns_ttl.c \
274 netbsd/nameser/ns_netint.c \
275 netbsd/nameser/ns_print.c \
276 netbsd/nameser/ns_samedomain.c
277
Dima Zavinca122b02009-05-27 10:52:37 -0700278# Architecture specific source files go here
279# =========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800280ifeq ($(TARGET_ARCH),arm)
281libc_common_src_files += \
282 bionic/eabi.c \
283 arch-arm/bionic/__get_pc.S \
284 arch-arm/bionic/__get_sp.S \
285 arch-arm/bionic/_exit_with_stack_teardown.S \
286 arch-arm/bionic/_setjmp.S \
287 arch-arm/bionic/atomics_arm.S \
288 arch-arm/bionic/clone.S \
289 arch-arm/bionic/ffs.S \
290 arch-arm/bionic/kill.S \
David 'Digit' Turner2a7ad972009-09-29 14:43:38 -0700291 arch-arm/bionic/libgcc_compat.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800292 arch-arm/bionic/tkill.S \
293 arch-arm/bionic/memcmp.S \
294 arch-arm/bionic/memcmp16.S \
295 arch-arm/bionic/memcpy.S \
296 arch-arm/bionic/memset.S \
297 arch-arm/bionic/setjmp.S \
298 arch-arm/bionic/sigsetjmp.S \
299 arch-arm/bionic/strlen.c.arm \
300 arch-arm/bionic/syscall.S \
301 unistd/socketcalls.c
302
303# These files need to be arm so that gdbserver
304# can set breakpoints in them without messing
305# up any thumb code.
306libc_common_src_files += \
307 bionic/pthread.c.arm \
308 bionic/pthread-timers.c.arm \
309 bionic/ptrace.c.arm
Dima Zavinca122b02009-05-27 10:52:37 -0700310
311# these are used by the static and dynamic versions of the libc
312# respectively
313libc_arch_static_src_files := \
314 arch-arm/bionic/exidx_static.c
315
316libc_arch_dynamic_src_files := \
317 arch-arm/bionic/exidx_dynamic.c
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800318else # !arm
319
320ifeq ($(TARGET_ARCH),x86)
321libc_common_src_files += \
322 arch-x86/bionic/__get_sp.S \
323 arch-x86/bionic/__get_tls.c \
324 arch-x86/bionic/__set_tls.c \
325 arch-x86/bionic/atomics_x86.S \
326 arch-x86/bionic/clone.S \
327 arch-x86/bionic/_exit_with_stack_teardown.S \
328 arch-x86/bionic/setjmp.S \
329 arch-x86/bionic/_setjmp.S \
330 arch-x86/bionic/vfork.S \
331 arch-x86/string/bzero.S \
332 arch-x86/string/memset.S \
333 arch-x86/string/memcmp.S \
334 arch-x86/string/memcpy.S \
335 arch-x86/string/strlen.S \
336 bionic/pthread.c \
337 bionic/pthread-timers.c \
338 bionic/ptrace.c
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800339
Dima Zavinca122b02009-05-27 10:52:37 -0700340# this is needed for static versions of libc
341libc_arch_static_src_files := \
342 arch-x86/bionic/dl_iterate_phdr_static.c
343
344libc_arch_dynamic_src_files :=
345endif # x86
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800346endif # !arm
347
Dima Zavinca122b02009-05-27 10:52:37 -0700348# Define some common cflags
349# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800350libc_common_cflags := \
351 -DWITH_ERRLIST \
352 -DANDROID_CHANGES \
353 -DUSE_LOCKS \
354 -DREALLOC_ZERO_BYTES_FREES \
355 -D_LIBC=1 \
356 -DSOFTFLOAT \
357 -DFLOATING_POINT \
358 -DNEED_PSELECT=1 \
359 -DINET6 \
360 -I$(LOCAL_PATH)/private \
Dima Zavinca122b02009-05-27 10:52:37 -0700361 -DUSE_DL_PREFIX
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800362
Dave Bortd2c9dcc2009-04-23 15:50:03 -0700363ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800364 libc_common_cflags += -DDEBUG
365endif
366
367ifeq ($(TARGET_ARCH),arm)
368 libc_common_cflags += -fstrict-aliasing
Dima Zavinca122b02009-05-27 10:52:37 -0700369 libc_crt_target_cflags := -mthumb-interwork
David 'Digit' Turner4a05d122009-09-18 13:35:05 -0700370 #
371 # Define HAVE_ARM_TLS_REGISTER macro to indicate to the C library
372 # that it should access the hardware TLS register directly in
373 # private/bionic_tls.h
374 #
375 # The value must match your kernel configuration
376 #
377 ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
378 libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
379 endif
Dima Zavinca122b02009-05-27 10:52:37 -0700380else # !arm
381 ifeq ($(TARGET_ARCH),x86)
382 libc_crt_target_cflags := -m32
383 endif # x86
384endif # !arm
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800385
Dima Zavinca122b02009-05-27 10:52:37 -0700386# Define some common includes
387# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800388libc_common_c_includes := \
389 $(LOCAL_PATH)/stdlib \
390 $(LOCAL_PATH)/string \
391 $(LOCAL_PATH)/stdio
392
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800393
Dima Zavinca122b02009-05-27 10:52:37 -0700394# Define the libc run-time (crt) support object files that must be built,
395# which are needed to build all other objects (shared/static libs and
396# executables)
397# ==========================================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800398
399ifeq ($(TARGET_ARCH),x86)
Dima Zavinca122b02009-05-27 10:52:37 -0700400# we only need begin_so/end_so for x86, since it needs an appropriate .init
401# section in the shared library with a function to call all the entries in
402# .ctors section. ARM uses init_array, and does not need the function.
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800403GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
404$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S
405 @mkdir -p $(dir $@)
Dima Zavinca122b02009-05-27 10:52:37 -0700406 $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800407ALL_GENERATED_SOURCES += $(GEN)
408
409GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
410$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S
411 @mkdir -p $(dir $@)
Dima Zavinca122b02009-05-27 10:52:37 -0700412 $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800413ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800414endif # TARGET_ARCH == x86
415
Dima Zavinca122b02009-05-27 10:52:37 -0700416
417GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o
418$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_static.S
419 @mkdir -p $(dir $@)
420 $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
421ALL_GENERATED_SOURCES += $(GEN)
422
423GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
424$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_dynamic.S
425 @mkdir -p $(dir $@)
426 $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
427ALL_GENERATED_SOURCES += $(GEN)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800428
429
Dima Zavinca122b02009-05-27 10:52:37 -0700430# We rename crtend.o to crtend_android.o to avoid a
431# name clash between gcc and bionic.
432GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
433$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S
434 @mkdir -p $(dir $@)
435 $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
436ALL_GENERATED_SOURCES += $(GEN)
437
438
439# To enable malloc leak check for statically linked programs, add
440# "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk
441WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
442
443# ========================================================
444# libc_common.a
445# ========================================================
446include $(CLEAR_VARS)
447
448LOCAL_SRC_FILES := $(libc_common_src_files)
449LOCAL_CFLAGS := $(libc_common_cflags)
450LOCAL_C_INCLUDES := $(libc_common_c_includes)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800451LOCAL_MODULE := libc_common
452LOCAL_SYSTEM_SHARED_LIBRARIES :=
453
454include $(BUILD_STATIC_LIBRARY)
455
456
Dima Zavinca122b02009-05-27 10:52:37 -0700457# ========================================================
Dima Zavin49e55332009-05-27 10:52:37 -0700458# libc_nomalloc.a
459# ========================================================
460#
461# This is a version of the static C library that does not
462# include malloc. It's useful in situations when calling
463# the user wants to provide their own malloc implementation,
464# or wants to explicitly disallow the use of the use of malloc,
465# like the dynamic loader.
466
467include $(CLEAR_VARS)
468
469LOCAL_SRC_FILES := \
470 $(libc_arch_static_src_files) \
471 bionic/libc_init_static.c
472
473LOCAL_C_INCLUDES := $(libc_common_c_includes)
474LOCAL_CFLAGS := $(libc_common_cflags)
475
476LOCAL_MODULE := libc_nomalloc
477LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
478LOCAL_SYSTEM_SHARED_LIBRARIES :=
479
480include $(BUILD_STATIC_LIBRARY)
481
482
483# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800484# libc.a
485# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800486include $(CLEAR_VARS)
487
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800488LOCAL_SRC_FILES := \
Dima Zavinca122b02009-05-27 10:52:37 -0700489 $(libc_arch_static_src_files) \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800490 bionic/dlmalloc.c \
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800491 bionic/malloc_debug_common.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800492 bionic/libc_init_static.c
493
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800494LOCAL_CFLAGS := $(libc_common_cflags) \
495 -DLIBC_STATIC
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800496LOCAL_C_INCLUDES := $(libc_common_c_includes)
Dima Zavinca122b02009-05-27 10:52:37 -0700497LOCAL_MODULE := libc
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800498LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800499LOCAL_SYSTEM_SHARED_LIBRARIES :=
500
501include $(BUILD_STATIC_LIBRARY)
502
503
Dima Zavinca122b02009-05-27 10:52:37 -0700504# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800505# libc.so
506# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800507include $(CLEAR_VARS)
508
509LOCAL_CFLAGS := $(libc_common_cflags)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800510LOCAL_C_INCLUDES := $(libc_common_c_includes)
511
512LOCAL_SRC_FILES := \
Dima Zavinca122b02009-05-27 10:52:37 -0700513 $(libc_arch_dynamic_src_files) \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800514 bionic/dlmalloc.c \
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800515 bionic/malloc_debug_common.c \
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800516 bionic/libc_init_dynamic.c
517
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800518LOCAL_MODULE:= libc
519
520# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
521# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
522# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
523# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
524# should, instead relying on the external symbols from the dependent libraries. That would
525# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
526# you wanted!
527
528LOCAL_SHARED_LIBRARIES := libdl
529LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
530LOCAL_SYSTEM_SHARED_LIBRARIES :=
531
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800532include $(BUILD_SHARED_LIBRARY)
533
534
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800535# For all builds, except for the -user build we will enable memory
536# allocation checking (including memory leaks, buffer overwrites, etc.)
537# Note that all these checks are also controlled by env. settings
538# that can enable, or disable specific checks. Note also that some of
539# the checks are available only in emulator and are implemeted in
540# libc_malloc_qemu_instrumented.so.
541ifneq ($(TARGET_BUILD_VARIANT),user)
542
Dima Zavinca122b02009-05-27 10:52:37 -0700543# ========================================================
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800544# libc_malloc_debug_leak.so
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800545# ========================================================
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800546include $(CLEAR_VARS)
547
Dima Zavinca122b02009-05-27 10:52:37 -0700548LOCAL_CFLAGS := \
549 $(libc_common_cflags) \
550 -DMALLOC_LEAK_CHECK
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800551
552LOCAL_C_INCLUDES := $(libc_common_c_includes)
553
554LOCAL_SRC_FILES := \
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800555 bionic/malloc_debug_leak.c
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800556
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800557LOCAL_MODULE:= libc_malloc_debug_leak
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800558
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800559LOCAL_SHARED_LIBRARIES := libc
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800560LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
561LOCAL_SYSTEM_SHARED_LIBRARIES :=
562# Don't prelink
563LOCAL_PRELINK_MODULE := false
564# Don't install on release build
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800565LOCAL_MODULE_TAGS := eng debug
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800566
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800567include $(BUILD_SHARED_LIBRARY)
568
Vladimir Chtchetkineb74ceb22009-11-17 14:13:38 -0800569
570# ========================================================
571# libc_malloc_debug_qemu.so
572# ========================================================
573include $(CLEAR_VARS)
574
575LOCAL_CFLAGS := \
576 $(libc_common_cflags) \
577 -DMALLOC_QEMU_INSTRUMENT
578
579LOCAL_C_INCLUDES := $(libc_common_c_includes)
580
581LOCAL_SRC_FILES := \
582 bionic/malloc_debug_qemu.c
583
584LOCAL_MODULE:= libc_malloc_debug_qemu
585
586LOCAL_SHARED_LIBRARIES := libc
587LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
588LOCAL_SYSTEM_SHARED_LIBRARIES :=
589# Don't prelink
590LOCAL_PRELINK_MODULE := false
591# Don't install on release build
592LOCAL_MODULE_TAGS := eng debug
593
594include $(BUILD_SHARED_LIBRARY)
595
596endif #!user
597
598
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800599# ========================================================
600include $(call all-makefiles-under,$(LOCAL_PATH))