diff --git a/build_tools/build_detect_platform b/build_tools/build_detect_platform index 333b0ecbb..5c68eb33c 100755 --- a/build_tools/build_detect_platform +++ b/build_tools/build_detect_platform @@ -40,7 +40,7 @@ fi # Default to fbcode gcc on internal fb machines if [ -d /mnt/gvfs/third-party -a -z "$CXX" ]; then if [ -z "$USE_CLANG" ]; then - source $PWD/build_tools/fbcode.gcc471.sh + source $PWD/build_tools/fbcode.gcc481.sh else source $PWD/build_tools/fbcode.clang31.sh fi diff --git a/build_tools/fbcode.gcc471.sh b/build_tools/fbcode.gcc471.sh index 3f2e38fc6..ac3f03db3 100644 --- a/build_tools/fbcode.gcc471.sh +++ b/build_tools/fbcode.gcc471.sh @@ -43,7 +43,7 @@ CXX="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.7.1-glibc-2.14.1/bin/g++ $JINCLUDE $SNAPPY AR=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ar RANLIB=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ranlib -CFLAGS="-B$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/bin/gold -m64 -mtune=generic -fPIC" +CFLAGS="-B$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/gold -m64 -mtune=generic -fPIC" CFLAGS+=" -I $TOOLCHAIN_LIB_BASE/jemalloc/$TOOL_JEMALLOC/include -DHAVE_JEMALLOC" EXEC_LDFLAGS=" -Wl,--whole-archive $TOOLCHAIN_LIB_BASE/jemalloc/$TOOL_JEMALLOC/lib/libjemalloc.a" diff --git a/build_tools/fbcode.gcc481.sh b/build_tools/fbcode.gcc481.sh new file mode 100644 index 000000000..6540c352a --- /dev/null +++ b/build_tools/fbcode.gcc481.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Set environment variables so that we can compile rocksdb using +# fbcode settings. It uses the latest g++ compiler and also +# uses jemalloc + +TOOLCHAIN_REV=53dc1fe83f84e9145b9ffb81b81aa7f6a49c87cc +TOOLCHAIN_EXECUTABLES="/mnt/gvfs/third-party/$TOOLCHAIN_REV/centos6-native" +TOOLCHAIN_LIB_BASE="/mnt/gvfs/third-party/$TOOLCHAIN_REV/gcc-4.8.1-glibc-2.17" +TOOL_JEMALLOC=jemalloc-3.3.1/4d53c6f + +# location of libhdfs libraries +if test "$USE_HDFS"; then + JAVA_HOME="/usr/local/jdk-6u22-64" + JINCLUDE="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + GLIBC_RUNTIME_PATH="/usr/local/fbcode/gcc-4.8.1-glibc-2.17" + HDFSLIB=" -Wl,--no-whole-archive hdfs/libhdfs.a -L$JAVA_HOME/jre/lib/amd64 " + HDFSLIB+=" -L$JAVA_HOME/jre/lib/amd64/server -L$GLIBC_RUNTIME_PATH/lib " + HDFSLIB+=" -ldl -lverify -ljava -ljvm " +fi + +# location of snappy headers and libraries +SNAPPY_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/snappy/snappy-1.0.3/43d84e2/include" +SNAPPY_LIBS=" $TOOLCHAIN_LIB_BASE/snappy/snappy-1.0.3/43d84e2/lib/libsnappy.a" + +# location of zlib headers and libraries +ZLIB_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/zlib/zlib-1.2.5/c3f970a/include" +ZLIB_LIBS=" $TOOLCHAIN_LIB_BASE/zlib/zlib-1.2.5/c3f970a/lib/libz.a" + +# location of libevent +LIBEVENT_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/libevent/libevent-1.4.14b/c3f970a/include" +LIBEVENT_LIBS=" -L $TOOLCHAIN_LIB_BASE/libevent/libevent-1.4.14b/c3f970a/lib" + +# location of gflags headers and libraries +GFLAGS_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/gflags/gflags-1.6/c3f970a/include" +GFLAGS_LIBS=" $TOOLCHAIN_LIB_BASE/gflags/gflags-1.6/c3f970a/lib/libgflags.a" + +# use Intel SSE support for checksum calculations +export USE_SSE=" -msse -msse4.2 " + +CC="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.8.1/cc6c9dc/bin/gcc" +CXX="$TOOLCHAIN_EXECUTABLES/gcc/gcc-4.8.1/cc6c9dc/bin/g++ $JINCLUDE $SNAPPY_INCLUDE $ZLIB_INCLUDE $LIBEVENT_INCLUDE $GFLAGS_INCLUDE" +AR=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ar +RANLIB=$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/ranlib + +CFLAGS="-B$TOOLCHAIN_EXECUTABLES/binutils/binutils-2.21.1/da39a3e/bin/gold -m64 -mtune=generic -fPIC" +CFLAGS+=" -I $TOOLCHAIN_LIB_BASE/jemalloc/$TOOL_JEMALLOC/include -DHAVE_JEMALLOC -nostdlib" + +EXEC_LDFLAGS="-Wl,--dynamic-linker,/usr/local/fbcode/gcc-4.8.1-glibc-2.17/lib/ld.so" +EXEC_LDFLAGS+=" -Wl,--whole-archive $TOOLCHAIN_LIB_BASE/jemalloc/$TOOL_JEMALLOC/lib/libjemalloc.a" +EXEC_LDFLAGS+=" -Wl,--no-whole-archive $TOOLCHAIN_LIB_BASE/libunwind/libunwind-1.0.1/675d945/lib/libunwind.a" +EXEC_LDFLAGS+=" $HDFSLIB $SNAPPY_LIBS $ZLIB_LIBS $LIBEVENT_LIBS $GFLAGS_LIBS" + +PLATFORM_LDFLAGS="-L$TOOLCHAIN_LIB_BASE/libgcc/libgcc-4.8.1/8aac7fc/lib -L$TOOLCHAIN_LIB_BASE/glibc/glibc-2.17/99df8fc/lib" + +EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $ZLIB_LIBS $GFLAGS_LIBS" +SNAPPY_LDFLAGS="$SNAPPY_LIBS $ZLIB_LIBS" + +VALGRIND_VER="$TOOLCHAIN_LIB_BASE/valgrind/valgrind-3.8.1/c3f970a/bin/" + +export CC CXX AR RANLIB CFLAGS EXEC_LDFLAGS EXEC_LDFLAGS_SHARED SNAPPY_LDFLAGS VALGRIND_VER diff --git a/db/db_test.cc b/db/db_test.cc index e246798d7..1d2789de2 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -500,7 +500,7 @@ class DBTest { result = "[ "; bool first = true; while (iter->Valid()) { - ParsedInternalKey ikey; + ParsedInternalKey ikey(Slice(), 0, kTypeValue); if (!ParseInternalKey(iter->key(), &ikey)) { result += "CORRUPTED"; } else { @@ -2487,7 +2487,7 @@ TEST(DBTest, InPlaceUpdate) { iter->SeekToFirst(); ASSERT_EQ(iter->status().ok(), true); while (iter->Valid()) { - ParsedInternalKey ikey; + ParsedInternalKey ikey(Slice(), 0, kTypeValue); ikey.sequence = -1; ASSERT_EQ(ParseInternalKey(iter->key(), &ikey), true); count++; @@ -2514,7 +2514,7 @@ TEST(DBTest, InPlaceUpdate) { ASSERT_EQ(iter->status().ok(), true); int seq = numValues; while (iter->Valid()) { - ParsedInternalKey ikey; + ParsedInternalKey ikey(Slice(), 0, kTypeValue); ikey.sequence = -1; ASSERT_EQ(ParseInternalKey(iter->key(), &ikey), true); count++; @@ -2670,7 +2670,7 @@ TEST(DBTest, CompactionFilter) { iter->SeekToFirst(); ASSERT_OK(iter->status()); while (iter->Valid()) { - ParsedInternalKey ikey; + ParsedInternalKey ikey(Slice(), 0, kTypeValue); ikey.sequence = -1; ASSERT_EQ(ParseInternalKey(iter->key(), &ikey), true); total++; @@ -2755,7 +2755,7 @@ TEST(DBTest, CompactionFilter) { iter->SeekToFirst(); ASSERT_OK(iter->status()); while (iter->Valid()) { - ParsedInternalKey ikey; + ParsedInternalKey ikey(Slice(), 0, kTypeValue); ASSERT_EQ(ParseInternalKey(iter->key(), &ikey), true); ASSERT_NE(ikey.sequence, (unsigned)0); count++;