Bug 788955 - Mangle system malloc functions on BSDs. r=glandium
authorJan Beich <jbeich@tormail.org>
Wed, 17 Oct 2012 16:39:03 +0200
changeset 110678 3e0d9ab85a5c904da3ced1a6cb4470198dab5f7f
parent 110677 b741e9670dd0c92e40756fbcabe2e976a926cad5
child 110679 542a978f042cbcaeeef75e89d9a818c35e5fb287
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersglandium
bugs788955
milestone19.0a1
Bug 788955 - Mangle system malloc functions on BSDs. r=glandium
configure.in
--- a/configure.in
+++ b/configure.in
@@ -8962,18 +8962,30 @@ if cmp -s ./mozinfo.json.tmp ./mozinfo.j
 else
   mv -f ./mozinfo.json.tmp ./mozinfo.json
 fi
 
 # Run jemalloc configure script
 
 if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_JEMALLOC" -a "$MOZ_MEMORY" ; then
   ac_configure_args="$_SUBDIR_CONFIG_ARGS --build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
-  if test "$OS_ARCH" = "Linux"; then
-    MANGLE="malloc calloc valloc free realloc memalign posix_memalign malloc_usable_size"
+  case "$OS_ARCH" in
+    Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
+      MANGLE="malloc calloc valloc free realloc posix_memalign"
+      case "$OS_ARCH" in
+        Linux)
+          MANGLE="$MANGLE memalign malloc_usable_size"
+          ;;
+        FreeBSD)
+          MANGLE="$MANGLE malloc_usable_size"
+          ;;
+      esac
+      ;;
+  esac
+  if test -n "$MANGLE"; then
     MANGLED=
     JEMALLOC_WRAPPER=
     if test -n "$_WRAP_MALLOC"; then
       JEMALLOC_WRAPPER=__wrap_
     fi
     for mangle in ${MANGLE}; do
       if test -n "$MANGLED"; then
         MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"