blob: 4b76dd0c31b4edba0aa4a2273ea4139d4210cdfd [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From d6daac04dab4b3acf4b88f16742d1b402cdc3d83 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Wed, 1 Oct 2014 18:54:04 +0200
4Subject: [PATCH] Explicitly disable tcmalloc
5
6Without this change leveldb autodetects tcmalloc from sysroot and
7sometimes became dependant on gperftools
8
9Disable autodetection without TCMALLOC_ENABLED=true pased to make
10
11Upstream-Status: Pending
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 build_detect_platform | 16 +++++++++-------
15 1 file changed, 9 insertions(+), 7 deletions(-)
16
17diff --git a/build_detect_platform b/build_detect_platform
18index bb76c4f..a586364 100755
19--- a/build_detect_platform
20+++ b/build_detect_platform
21@@ -201,15 +201,17 @@ EOF
22 PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy"
23 fi
24
25- # Test whether tcmalloc is available
26- $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF
27- int main() {}
28+ if [ "$TCMALLOC_ENABLED" = "true" ]; then
29+ # Test whether tcmalloc is available
30+ $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF
31+ int main() {}
32 EOF
33- if [ "$?" = 0 ]; then
34- PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
35- fi
36+ if [ "$?" = 0 ]; then
37+ PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
38+ fi
39
40- rm -f $CXXOUTPUT 2>/dev/null
41+ rm -f $CXXOUTPUT 2>/dev/null
42+ fi
43 fi
44
45 PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
46--
472.1.1
48