Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | From d6daac04dab4b3acf4b88f16742d1b402cdc3d83 Mon Sep 17 00:00:00 2001 |
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> |
| 3 | Date: Wed, 1 Oct 2014 18:54:04 +0200 |
| 4 | Subject: [PATCH] Explicitly disable tcmalloc |
| 5 | |
| 6 | Without this change leveldb autodetects tcmalloc from sysroot and |
| 7 | sometimes became dependant on gperftools |
| 8 | |
| 9 | Disable autodetection without TCMALLOC_ENABLED=true pased to make |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> |
| 13 | --- |
| 14 | build_detect_platform | 16 +++++++++------- |
| 15 | 1 file changed, 9 insertions(+), 7 deletions(-) |
| 16 | |
| 17 | diff --git a/build_detect_platform b/build_detect_platform |
| 18 | index 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 | -- |
| 47 | 2.1.1 |
| 48 | |