Commit 5f66c58f authored by Sergei Petrunia's avatar Sergei Petrunia Committed by Sergey Vojtovich

Issue #904: Crash in rocksdb::IOStatsContext::Reset, this=NULL

Fix both code paths:
- Change the test source code so it doesn't cause the "Unused variable"
  warning (which -Werror converted into error and caused CMake not to set
  HAVE_THREAD_LOCAL)

- If the system doesn't seem to support HAVE_THREAD_LOCAL, refuse to
  compile (rather than producing a binary that crashes for some tests)

Originally submitted at https://github.com/facebook/mysql-5.6/pull/905
parent 76a94a03
......@@ -124,10 +124,15 @@ CHECK_CXX_SOURCE_COMPILES("
#endif
int main() {
static __thread int tls;
tls=0;
return tls;
}
" HAVE_THREAD_LOCAL)
if(HAVE_THREAD_LOCAL)
ADD_DEFINITIONS(-DROCKSDB_SUPPORT_THREAD_LOCAL)
else()
MESSAGE(SEND_ERROR "The compiler failed the check for ROCKSDB_SUPPORT_THREAD_LOCAL. "
"MyRocks requires that feature.")
endif()
INCLUDE(build_rocksdb.cmake)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment