kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [2/2] incubator-kudu git commit: Use thirdparty libstdcxx stdlib headers during TSAN build
Date Sat, 23 Jan 2016 19:02:33 GMT
Use thirdparty libstdcxx stdlib headers during TSAN build

Change-Id: Id4cc858c550f6b03255dd29484abd4e9d1a42442
Reviewed-on: http://gerrit.cloudera.org:8080/1880
Reviewed-by: Adar Dembo <adar@cloudera.com>
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/faeffdc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/faeffdc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/faeffdc9

Branch: refs/heads/master
Commit: faeffdc9d2496fd4cf98d6fabfaff0c7b582572f
Parents: be3ea35
Author: Dan Burkert <dan@cloudera.com>
Authored: Fri Jan 22 14:42:49 2016 -0800
Committer: Dan Burkert <dan@cloudera.com>
Committed: Sat Jan 23 19:01:44 2016 +0000

----------------------------------------------------------------------
 CMakeLists.txt                  | 10 ++++++----
 thirdparty/build-definitions.sh |  6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/faeffdc9/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 80c0110..81b56be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -265,10 +265,12 @@ if (${KUDU_USE_TSAN})
   # so that the annotations in the header actually take effect.
   add_definitions("-D_GLIBCXX_EXTERN_TEMPLATE=0")
 
-  # Some of the above also need to be passed to the linker.
-  set(TSAN_LIB_DIR "${CMAKE_SOURCE_DIR}/thirdparty/installed-deps-tsan/gcc/lib")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${TSAN_LIB_DIR} -fsanitize=thread")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${TSAN_LIB_DIR}")
+  # Compile and link against the thirdparty TSAN instrumented libstdcxx.
+  set(TSAN_GCC_DIR "${CMAKE_SOURCE_DIR}/thirdparty/installed-deps-tsan/gcc")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${TSAN_GCC_DIR}/lib -fsanitize=thread")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc++ -L${TSAN_GCC_DIR}/lib")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${TSAN_GCC_DIR}/include/c++/4.9.3")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${TSAN_GCC_DIR}/include/c++/4.9.3/backward")
 
   # Strictly speaking, TSAN doesn't require dynamic linking. But it does
   # require all code to be position independent, and the easiest way to

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/faeffdc9/thirdparty/build-definitions.sh
----------------------------------------------------------------------
diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index e85d68f..ed570f7 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -95,6 +95,12 @@ build_llvm() {
 }
 
 build_libstdcxx() {
+  # Configure libstdcxx to use posix threads by default. Normally this symlink
+  # would be created automatically while building libgcc as part of the overall
+  # GCC build, but since we are only building libstdcxx we must configure it
+  # manually.
+  ln -sf $GCC_DIR/libgcc/gthr-posix.h $GCC_DIR/libgcc/gthr-default.h
+
   # Remove the GCC build directory to remove cached build configuration.
   rm -rf $GCC_BUILD_DIR
   mkdir -p $GCC_BUILD_DIR


Mime
View raw message