bug 1081034 part 4 - Remove wrapping for weak libc symbols. r=nfroyd
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 16 Oct 2014 09:20:16 +0900
changeset 210650 0004a6330d53c07baea3f31b7819fee5cf631540
parent 210649 fdf75d54f631cff6440ab5aee8957ed913f47de4
child 210651 a5eca3f1dee878b7d183ef72b5a0b6ea5c84abf2
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersnfroyd
bugs1081034, 791419, 850332, 1001703
milestone36.0a1
bug 1081034 part 4 - Remove wrapping for weak libc symbols. r=nfroyd This effectively backs out bug 791419, a part of bug 850332, and bug 1001703.
configure.in
js/src/configure.in
mozglue/build/BionicGlue.cpp
--- a/configure.in
+++ b/configure.in
@@ -7236,19 +7236,16 @@ AC_SUBST_LIST(WIN32_CRT_LIBS)
 dnl Need to set this for make because NSS doesn't have configure
 AC_SUBST(DLLFLAGS)
 
 dnl We need to wrap dlopen and related functions on Android because we use
 dnl our own linker.
 if test "$OS_TARGET" = Android; then
     WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
     WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=PR_GetEnv,--wrap=PR_SetEnv"
-    if test -z "$gonkdir"; then
-        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=memccpy,--wrap=memchr,--wrap=memrchr,--wrap=memcmp,--wrap=memcpy,--wrap=memmove,--wrap=memset,--wrap=memmem,--wrap=index,--wrap=strchr,--wrap=strrchr,--wrap=strlen,--wrap=strcmp,--wrap=strcpy,--wrap=strcat,--wrap=strcasecmp,--wrap=strncasecmp,--wrap=strstr,--wrap=strcasestr,--wrap=strtok,--wrap=strtok_r,--wrap=strerror,--wrap=strerror_r,--wrap=strnlen,--wrap=strncat,--wrap=strncmp,--wrap=strncpy,--wrap=strlcat,--wrap=strlcpy,--wrap=strcspn,--wrap=strpbrk,--wrap=strsep,--wrap=strspn,--wrap=strcoll,--wrap=strxfrm"
-    fi
     if test "$MOZ_WIDGET_TOOLKIT" = gonk -a -n "$MOZ_NUWA_PROCESS"; then
         WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=pthread_create,--wrap=epoll_wait,--wrap=poll,--wrap=pthread_cond_timedwait,--wrap=__pthread_cond_timedwait,--wrap=pthread_cond_wait,--wrap=epoll_create,--wrap=epoll_ctl,--wrap=close,--wrap=pthread_key_create,--wrap=pthread_key_delete,--wrap=socketpair,--wrap=pthread_self,--wrap=pthread_mutex_lock,--wrap=pthread_join,--wrap=pipe,--wrap=pipe2,--wrap=tgkill"
     fi
 fi
 
 dnl ========================================================
 dnl = Use JS Call tracing
 dnl ========================================================
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -169,17 +169,16 @@ AC_SUBST(JS_SHARED_LIBRARY)
 if test "$JS_STANDALONE" = no; then
   autoconfmk=autoconf-js.mk
   JS_STANDALONE=
 else
   JS_STANDALONE=1
   LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
   AC_DEFINE(JS_STANDALONE)
 fi
-
 AC_SUBST(JS_STANDALONE)
 BUILDING_JS=1
 AC_SUBST(autoconfmk)
 
 MOZ_ARG_WITH_STRING(gonk,
 [  --with-gonk=DIR
                location of gonk dir],
     gonkdir=$withval)
--- a/mozglue/build/BionicGlue.cpp
+++ b/mozglue/build/BionicGlue.cpp
@@ -175,97 +175,16 @@ extern "C" NS_EXPORT int
 }
 
 extern "C" NS_EXPORT pthread_mutex_t *
 PR_GetEnvLock(void)
 {
   return &_pr_envLock;
 }
 
-/* Amazon Kindle Fire HD's libc provides most of the
- * functions in string.h as weak symbols, which dlsym
- * cannot resolve. Thus, we must wrap these functions.
- * See bug 791419.
- */
-
-#ifndef MOZ_WIDGET_GONK
-#include <string.h>
-extern "C" NS_EXPORT void* __real_memccpy(void * a0, const void * a1, int a2, size_t a3);
-extern "C" NS_EXPORT void* __real_memchr(const void * a0, int a1, size_t a2);
-extern "C" NS_EXPORT void* __real_memrchr(const void * a0, int a1, size_t a2);
-extern "C" NS_EXPORT int __real_memcmp(const void * a0, const void * a1, size_t a2);
-extern "C" NS_EXPORT void* __real_memcpy(void * a0, const void * a1, size_t a2);
-extern "C" NS_EXPORT void* __real_memmove(void * a0, const void * a1, size_t a2);
-extern "C" NS_EXPORT void* __real_memset(void * a0, int a1, size_t a2);
-extern "C" NS_EXPORT void* __real_memmem(const void * a0, size_t a1, const void * a2, size_t a3);
-extern "C" NS_EXPORT char* __real_index(const char * a0, int a1);
-extern "C" NS_EXPORT char* __real_strchr(const char * a0, int a1);
-extern "C" NS_EXPORT char* __real_strrchr(const char * a0, int a1);
-extern "C" NS_EXPORT size_t __real_strlen(const char * a0);
-extern "C" NS_EXPORT int __real_strcmp(const char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strcpy(char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strcat(char * a0, const char * a1);
-extern "C" NS_EXPORT int __real_strcasecmp(const char * a0, const char * a1);
-extern "C" NS_EXPORT int __real_strncasecmp(const char * a0, const char * a1, size_t a2);
-extern "C" NS_EXPORT char* __real_strstr(const char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strcasestr(const char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strtok(char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strtok_r(char * a0, const char * a1, char** a2);
-extern "C" NS_EXPORT char* __real_strerror(int a0);
-extern "C" NS_EXPORT int __real_strerror_r(int a0, char * a1, size_t a2);
-extern "C" NS_EXPORT size_t __real_strnlen(const char * a0, size_t a1);
-extern "C" NS_EXPORT char* __real_strncat(char * a0, const char * a1, size_t a2);
-extern "C" NS_EXPORT int __real_strncmp(const char * a0, const char * a1, size_t a2);
-extern "C" NS_EXPORT char* __real_strncpy(char * a0, const char * a1, size_t a2);
-extern "C" NS_EXPORT size_t __real_strlcat(char * a0, const char * a1, size_t a2);
-extern "C" NS_EXPORT size_t __real_strlcpy(char * a0, const char * a1, size_t a2);
-extern "C" NS_EXPORT size_t __real_strcspn(const char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strpbrk(const char * a0, const char * a1);
-extern "C" NS_EXPORT char* __real_strsep(char ** a0, const char * a1);
-extern "C" NS_EXPORT size_t __real_strspn(const char * a0, const char * a1);
-extern "C" NS_EXPORT int __real_strcoll(const char * a0, const char * a1);
-extern "C" NS_EXPORT size_t __real_strxfrm(char * a0, const char * a1, size_t a2);
-
-extern "C" NS_EXPORT void* __wrap_memccpy(void * a0, const void * a1, int a2, size_t a3) { return __real_memccpy(a0, a1, a2, a3); }
-extern "C" NS_EXPORT void* __wrap_memchr(const void * a0, int a1, size_t a2) { return __real_memchr(a0, a1, a2); }
-extern "C" NS_EXPORT void* __wrap_memrchr(const void * a0, int a1, size_t a2) { return __real_memrchr(a0, a1, a2); }
-extern "C" NS_EXPORT int __wrap_memcmp(const void * a0, const void * a1, size_t a2) { return __real_memcmp(a0, a1, a2); }
-extern "C" NS_EXPORT void* __wrap_memcpy(void * a0, const void * a1, size_t a2) { return __real_memcpy(a0, a1, a2); }
-extern "C" NS_EXPORT void* __wrap_memmove(void * a0, const void * a1, size_t a2) { return __real_memmove(a0, a1, a2); }
-extern "C" NS_EXPORT void* __wrap_memset(void * a0, int a1, size_t a2) { return __real_memset(a0, a1, a2); }
-extern "C" NS_EXPORT void* __wrap_memmem(const void * a0, size_t a1, const void * a2, size_t a3) { return __real_memmem(a0, a1, a2, a3); }
-extern "C" NS_EXPORT char* __wrap_index(const char * a0, int a1) { return __real_index(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strchr(const char * a0, int a1) { return __real_strchr(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strrchr(const char * a0, int a1) { return __real_strrchr(a0, a1); }
-extern "C" NS_EXPORT size_t __wrap_strlen(const char * a0) { return __real_strlen(a0); }
-extern "C" NS_EXPORT int __wrap_strcmp(const char * a0, const char * a1) { return __real_strcmp(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strcpy(char * a0, const char * a1) { return __real_strcpy(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strcat(char * a0, const char * a1) { return __real_strcat(a0, a1); }
-extern "C" NS_EXPORT int __wrap_strcasecmp(const char * a0, const char * a1) { return __real_strcasecmp(a0, a1); }
-extern "C" NS_EXPORT int __wrap_strncasecmp(const char * a0, const char * a1, size_t a2) { return __real_strncasecmp(a0, a1, a2); }
-extern "C" NS_EXPORT char* __wrap_strstr(const char * a0, const char * a1) { return __real_strstr(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strcasestr(const char * a0, const char * a1) { return __real_strcasestr(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strtok(char * a0, const char * a1) { return __real_strtok(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strtok_r(char * a0, const char * a1, char** a2) { return __real_strtok_r(a0, a1, a2); }
-extern "C" NS_EXPORT char* __wrap_strerror(int a0) { return __real_strerror(a0); }
-extern "C" NS_EXPORT int __wrap_strerror_r(int a0, char * a1, size_t a2) { return __real_strerror_r(a0, a1, a2); }
-extern "C" NS_EXPORT size_t __wrap_strnlen(const char * a0, size_t a1) { return __real_strnlen(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strncat(char * a0, const char * a1, size_t a2) { return __real_strncat(a0, a1, a2); }
-extern "C" NS_EXPORT int __wrap_strncmp(const char * a0, const char * a1, size_t a2) { return __real_strncmp(a0, a1, a2); }
-extern "C" NS_EXPORT char* __wrap_strncpy(char * a0, const char * a1, size_t a2) { return __real_strncpy(a0, a1, a2); }
-extern "C" NS_EXPORT size_t __wrap_strlcat(char * a0, const char * a1, size_t a2) { return __real_strlcat(a0, a1, a2); }
-extern "C" NS_EXPORT size_t __wrap_strlcpy(char * a0, const char * a1, size_t a2) { return __real_strlcpy(a0, a1, a2); }
-extern "C" NS_EXPORT size_t __wrap_strcspn(const char * a0, const char * a1) { return __real_strcspn(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strpbrk(const char * a0, const char * a1) { return __real_strpbrk(a0, a1); }
-extern "C" NS_EXPORT char* __wrap_strsep(char ** a0, const char * a1) { return __real_strsep(a0, a1); }
-extern "C" NS_EXPORT size_t __wrap_strspn(const char * a0, const char * a1) { return __real_strspn(a0, a1); }
-extern "C" NS_EXPORT int __wrap_strcoll(const char * a0, const char * a1) { return __real_strcoll(a0, a1); }
-extern "C" NS_EXPORT size_t __wrap_strxfrm(char * a0, const char * a1, size_t a2) { return __real_strxfrm(a0, a1, a2); }
-#endif
-
 /* Flash plugin uses symbols that are not present in Android >= 4.4 */
 #ifndef MOZ_WIDGET_GONK
 namespace android {
   namespace VectorImpl {
     NS_EXPORT void reservedVectorImpl1(void) { }
     NS_EXPORT void reservedVectorImpl2(void) { }
     NS_EXPORT void reservedVectorImpl3(void) { }
     NS_EXPORT void reservedVectorImpl4(void) { }