merge from open-source master
authorThe Android Open Source Project <initial-contribution@android.com>
Wed, 31 Mar 2010 21:15:30 +0000 (14:15 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Wed, 31 Mar 2010 21:15:30 +0000 (14:15 -0700)
Change-Id: I076e0df8656fdf58c229cc9a168cd6d8e16b6d8e

1  2 
libc/Android.mk

diff --combined libc/Android.mk
index d2e5e1f40efbe480891e4f1d7fba4ac21373e40b,f6276407530e7abcf759bee6e9531136f96233dc..d8cc721ca4a90078d31c96c477a0a5896c4687f2
@@@ -26,7 -26,6 +26,7 @@@ libc_common_src_files := 
        unistd/initgroups.c \
        unistd/isatty.c \
        unistd/issetugid.c \
 +      unistd/killpg.c \
        unistd/lseek64.c \
        unistd/mmap.c \
        unistd/nice.c \
        unistd/sbrk.c \
        unistd/send.c \
        unistd/setegid.c \
 +      unistd/setuid.c \
        unistd/seteuid.c \
 +      unistd/setreuid.c \
 +      unistd/setresuid.c \
        unistd/setpgrp.c \
        unistd/sigblock.c \
        unistd/siginterrupt.c \
        stdlib/tolower_.c \
        stdlib/toupper_.c \
        stdlib/wchar.c \
-       string/bcopy.c \
        string/index.c \
        string/memccpy.c \
        string/memchr.c \
        string/strcasestr.c \
        string/strcat.c \
        string/strchr.c \
-       string/strcmp.c \
        string/strcoll.c \
        string/strcpy.c \
        string/strcspn.c \
        string/strlcat.c \
        string/strlcpy.c \
        string/strncat.c \
-       string/strncmp.c \
        string/strncpy.c \
        string/strndup.c \
        string/strnlen.c \
        bionic/__errno.c \
        bionic/__set_errno.c \
        bionic/_rand48.c \
 +      bionic/cpuacct.c \
        bionic/arc4random.c \
        bionic/basename.c \
        bionic/basename_r.c \
 +      bionic/clearenv.c \
        bionic/dirname.c \
        bionic/dirname_r.c \
        bionic/drand48.c \
        bionic/erand48.c \
 +      bionic/err.c \
 +      bionic/fdprintf.c \
        bionic/fork.c \
 +      bionic/fts.c \
        bionic/if_nametoindex.c \
        bionic/if_indextoname.c \
        bionic/ioctl.c \
        netbsd/nameser/ns_ttl.c \
        netbsd/nameser/ns_netint.c \
        netbsd/nameser/ns_print.c \
 -      netbsd/nameser/ns_samedomain.c
 +      netbsd/nameser/ns_samedomain.c \
 +      regex/regcomp.c \
 +      regex/regerror.c \
 +      regex/regexec.c \
 +      regex/regfree.c \
  
  # Architecture specific source files go here
  # =========================================================
  ifeq ($(TARGET_ARCH),arm)
  libc_common_src_files += \
        bionic/eabi.c \
 +      bionic/bionic_clone.c \
        arch-arm/bionic/__get_pc.S \
        arch-arm/bionic/__get_sp.S \
        arch-arm/bionic/_exit_with_stack_teardown.S \
        arch-arm/bionic/strlen.c.arm \
        arch-arm/bionic/syscall.S \
        string/memmove.c.arm \
+       string/bcopy.c \
+       string/strcmp.c \
+       string/strncmp.c \
        unistd/socketcalls.c
  
  # These files need to be arm so that gdbserver
@@@ -344,12 -330,15 +344,15 @@@ libc_common_src_files += 
        arch-x86/bionic/_setjmp.S \
        arch-x86/bionic/vfork.S \
        arch-x86/bionic/syscall.S \
-       arch-x86/string/bzero.S \
-       arch-x86/string/memset.S \
-       arch-x86/string/memcmp.S \
-       arch-x86/string/memcpy.S \
+       arch-x86/string/bcopy_wrapper.S \
+       arch-x86/string/memcpy_wrapper.S \
+       arch-x86/string/memmove_wrapper.S \
+       arch-x86/string/bzero_wrapper.S \
+       arch-x86/string/memcmp_wrapper.S \
+       arch-x86/string/memset_wrapper.S \
+       arch-x86/string/strcmp_wrapper.S \
+       arch-x86/string/strncmp_wrapper.S \
        arch-x86/string/strlen.S \
-       string/memmove.c \
        bionic/pthread.c \
        bionic/pthread-timers.c \
        bionic/ptrace.c
@@@ -381,6 -370,9 +384,9 @@@ libc_common_src_files += 
        arch-sh/bionic/__set_tls.c \
        arch-sh/bionic/__get_tls.c \
        arch-sh/bionic/ffs.S \
+       string/bcopy.c \
+       string/strcmp.c \
+       string/strncmp.c \
        string/memcmp.c \
        string/strlen.c \
        bionic/eabi.c \
@@@ -406,16 -398,7 +412,16 @@@ libc_common_cflags := 
                -DNEED_PSELECT=1                \
                -DINET6 \
                -I$(LOCAL_PATH)/private \
 -              -DUSE_DL_PREFIX
 +              -DUSE_DL_PREFIX \
 +              -DPOSIX_MISTAKE
 +
 +# these macro definitions are required to implement the
 +# 'timezone' and 'daylight' global variables, as well as
 +# properly update the 'tm_gmtoff' field in 'struct tm'.
 +#
 +libc_common_cflags += \
 +    -DTM_GMTOFF=tm_gmtoff \
 +    -DUSG_COMPAT=1
  
  ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
    libc_common_cflags += -DDEBUG
@@@ -437,6 -420,10 +443,10 @@@ ifeq ($(TARGET_ARCH),arm
  else # !arm
    ifeq ($(TARGET_ARCH),x86)
      libc_crt_target_cflags := -m32
+     # Enable recent IA friendly memory routines (such as for Atom)
+     # These will not work on the earlier x86 machines
+     libc_common_cflags += -mtune=i686 -DUSE_SSSE3 -DUSE_SSE2
    endif # x86
  endif # !arm
  
@@@ -545,12 -532,17 +555,12 @@@ include $(CLEAR_VARS
  LOCAL_SRC_FILES := \
        $(libc_arch_static_src_files) \
        bionic/dlmalloc.c \
 +      bionic/malloc_debug_common.c \
        bionic/libc_init_static.c
  
 -LOCAL_CFLAGS := $(libc_common_cflags)
 -
 -ifeq ($(WITH_MALLOC_CHECK_LIBC_A),true)
 -  LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
 -  LOCAL_SRC_FILES += bionic/malloc_leak.c.arm
 -endif
 -
 +LOCAL_CFLAGS := $(libc_common_cflags) \
 +                -DLIBC_STATIC
  LOCAL_C_INCLUDES := $(libc_common_c_includes)
 -
  LOCAL_MODULE := libc
  LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
  LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@@ -569,7 -561,7 +579,7 @@@ LOCAL_C_INCLUDES := $(libc_common_c_inc
  LOCAL_SRC_FILES := \
        $(libc_arch_dynamic_src_files) \
        bionic/dlmalloc.c \
 -      bionic/malloc_leak.c.arm \
 +      bionic/malloc_debug_common.c \
        bionic/libc_init_dynamic.c
  
  LOCAL_MODULE:= libc
@@@ -589,16 -581,8 +599,16 @@@ LOCAL_SYSTEM_SHARED_LIBRARIES :
  include $(BUILD_SHARED_LIBRARY)
  
  
 +# For all builds, except for the -user build we will enable memory
 +# allocation checking (including memory leaks, buffer overwrites, etc.)
 +# Note that all these checks are also controlled by env. settings
 +# that can enable, or disable specific checks. Note also that some of
 +# the checks are available only in emulator and are implemeted in
 +# libc_malloc_qemu_instrumented.so.
 +ifneq ($(TARGET_BUILD_VARIANT),user)
 +
  # ========================================================
 -# libc_debug.so
 +# libc_malloc_debug_leak.so
  # ========================================================
  include $(CLEAR_VARS)
  
@@@ -609,49 -593,30 +619,49 @@@ LOCAL_CFLAGS := 
  LOCAL_C_INCLUDES := $(libc_common_c_includes)
  
  LOCAL_SRC_FILES := \
 -      $(libc_arch_dynamic_src_files) \
 -      bionic/dlmalloc.c \
 -      bionic/malloc_leak.c.arm \
 -      bionic/libc_init_dynamic.c
 +      bionic/malloc_debug_leak.c
  
 -LOCAL_MODULE:= libc_debug
 +LOCAL_MODULE:= libc_malloc_debug_leak
  
 -# WARNING: The only library libc.so should depend on is libdl.so!  If you add other libraries,
 -# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries.  This
 -# ensures that symbols that are pulled into those new libraries from libgcc.a are not declared
 -# external; if that were the case, then libc would not pull those symbols from libgcc.a as it
 -# should, instead relying on the external symbols from the dependent libraries.  That would
 -# create an "cloaked" dependency on libgcc.a in libc though the libraries, which is not what
 -# you wanted!
 +LOCAL_SHARED_LIBRARIES := libc
 +LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
 +LOCAL_SYSTEM_SHARED_LIBRARIES :=
 +# Don't prelink
 +LOCAL_PRELINK_MODULE := false
 +# Don't install on release build
 +LOCAL_MODULE_TAGS := eng debug
  
 -LOCAL_SHARED_LIBRARIES := libdl
 +include $(BUILD_SHARED_LIBRARY)
 +
 +
 +# ========================================================
 +# libc_malloc_debug_qemu.so
 +# ========================================================
 +include $(CLEAR_VARS)
 +
 +LOCAL_CFLAGS := \
 +      $(libc_common_cflags) \
 +      -DMALLOC_QEMU_INSTRUMENT
 +
 +LOCAL_C_INCLUDES := $(libc_common_c_includes)
 +
 +LOCAL_SRC_FILES := \
 +      bionic/malloc_debug_qemu.c
 +
 +LOCAL_MODULE:= libc_malloc_debug_qemu
 +
 +LOCAL_SHARED_LIBRARIES := libc
  LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
  LOCAL_SYSTEM_SHARED_LIBRARIES :=
  # Don't prelink
  LOCAL_PRELINK_MODULE := false
  # Don't install on release build
 -LOCAL_MODULE_TAGS := eng
 +LOCAL_MODULE_TAGS := eng debug
  
  include $(BUILD_SHARED_LIBRARY)
  
 +endif #!user
 +
 +
  # ========================================================
  include $(call all-makefiles-under,$(LOCAL_PATH))