aboutsummaryrefslogtreecommitdiff
path: root/databases/rocksdb/files/patch-build_tools-build_detect_platform
blob: b6b5906c5c83936b597258c1df7f7e02ba4bcc3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Remove -fno-builtin-memcmp and -ltcmalloc

--- build_tools/build_detect_platform.orig	2021-06-25 21:15:04 UTC
+++ build_tools/build_detect_platform
@@ -145,7 +145,7 @@ PLATFORM_SHARED_VERSIONED=true
 # generic port files (working on all platform by #ifdef) go directly in /port
 GENERIC_PORT_FILES=`cd "$ROCKSDB_ROOT"; find port -name '*.cc' | tr "\n" " "`
 
-# On GCC, we pick libc's memcmp over GCC's memcmp via -fno-builtin-memcmp
+# On GCC, we pick libc's memcmp over GCC's memcmp via
 case "$TARGET_OS" in
     Darwin)
         PLATFORM=OS_MACOSX
@@ -166,7 +166,7 @@ case "$TARGET_OS" in
         PLATFORM=OS_LINUX
         COMMON_FLAGS="$COMMON_FLAGS -DOS_LINUX"
         if [ -z "$USE_CLANG" ]; then
-            COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp"
+            COMMON_FLAGS="$COMMON_FLAGS"
         else
             PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -latomic"
         fi
@@ -196,21 +196,21 @@ EOF
         ;;
     SunOS)
         PLATFORM=OS_SOLARIS
-        COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_SOLARIS -m64"
+        COMMON_FLAGS="$COMMON_FLAGS -D_REENTRANT -DOS_SOLARIS -m64"
         PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lpthread -lrt -static-libstdc++ -static-libgcc -m64"
         # PORT_FILES=port/sunos/sunos_specific.cc
         ;;
     AIX)
         PLATFORM=OS_AIX
         CC=gcc
-        COMMON_FLAGS="$COMMON_FLAGS -maix64 -pthread -fno-builtin-memcmp -D_REENTRANT -DOS_AIX -D__STDC_FORMAT_MACROS"
+        COMMON_FLAGS="$COMMON_FLAGS -maix64 -pthread -D_REENTRANT -DOS_AIX -D__STDC_FORMAT_MACROS"
         PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -pthread -lpthread -lrt -maix64 -static-libstdc++ -static-libgcc"
         # PORT_FILES=port/aix/aix_specific.cc
         ;;
     FreeBSD)
         PLATFORM=OS_FREEBSD
         CXX=clang++
-        COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_FREEBSD"
+        COMMON_FLAGS="$COMMON_FLAGS -D_REENTRANT -DOS_FREEBSD"
         PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lpthread"
         # PORT_FILES=port/freebsd/freebsd_specific.cc
         ;;
@@ -218,7 +218,7 @@ EOF
         PLATFORM=OS_GNU_KFREEBSD
         COMMON_FLAGS="$COMMON_FLAGS -DOS_GNU_KFREEBSD"
         if [ -z "$USE_CLANG" ]; then
-            COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp"
+            COMMON_FLAGS="$COMMON_FLAGS"
         else
             PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -latomic"
         fi
@@ -227,14 +227,14 @@ EOF
         ;;
     NetBSD)
         PLATFORM=OS_NETBSD
-        COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_NETBSD"
+        COMMON_FLAGS="$COMMON_FLAGS -D_REENTRANT -DOS_NETBSD"
         PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lpthread -lgcc_s"
         # PORT_FILES=port/netbsd/netbsd_specific.cc
         ;;
     OpenBSD)
         PLATFORM=OS_OPENBSD
 	CXX=clang++
-        COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_OPENBSD"
+        COMMON_FLAGS="$COMMON_FLAGS -D_REENTRANT -DOS_OPENBSD"
         PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -pthread"
         # PORT_FILES=port/openbsd/openbsd_specific.cc
 	FIND=gfind
@@ -242,7 +242,7 @@ EOF
         ;;
     DragonFly)
         PLATFORM=OS_DRAGONFLYBSD
-        COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_DRAGONFLYBSD"
+        COMMON_FLAGS="$COMMON_FLAGS -D_REENTRANT -DOS_DRAGONFLYBSD"
         PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lpthread"
         # PORT_FILES=port/dragonfly/dragonfly_specific.cc
         ;;
@@ -252,7 +252,7 @@ EOF
         PLATFORM_CXXFLAGS="-std=gnu++11"
         COMMON_FLAGS="$COMMON_FLAGS -DCYGWIN"
         if [ -z "$USE_CLANG" ]; then
-            COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp"
+            COMMON_FLAGS="$COMMON_FLAGS"
         else
             PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -latomic"
         fi
@@ -261,7 +261,7 @@ EOF
         ;;
     OS_ANDROID_CROSSCOMPILE)
         PLATFORM=OS_ANDROID
-	COMMON_FLAGS="$COMMON_FLAGS -fno-builtin-memcmp -D_REENTRANT -DOS_ANDROID -DROCKSDB_PLATFORM_POSIX"
+	COMMON_FLAGS="$COMMON_FLAGS -D_REENTRANT -DOS_ANDROID -DROCKSDB_PLATFORM_POSIX"
 	PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS "  # All pthread features are in the Android C library
         # PORT_FILES=port/android/android.cc
         CROSS_COMPILE=true
@@ -451,9 +451,9 @@ EOF
     if ! test $JEMALLOC && ! test $ROCKSDB_DISABLE_TCMALLOC; then
         # jemalloc is not available. Let's try tcmalloc
         if echo 'int main() {}' | $CXX $PLATFORM_CXXFLAGS -x c++ - -o /dev/null \
-          -ltcmalloc 2>/dev/null; then
-            PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -ltcmalloc"
-            JAVA_LDFLAGS="$JAVA_LDFLAGS -ltcmalloc"
+          2>/dev/null; then
+            PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS"
+            JAVA_LDFLAGS="$JAVA_LDFLAGS"
         fi
     fi