[PATCH] Refactor sanitizer build scripts.

Sergey Matveev earthdok at google.com
Thu Dec 18 06:14:09 PST 2014


================
Comment at: zorg/buildbot/builders/sanitizers/buildbot_fast.sh:65
@@ -86,42 +64,3 @@
 
-echo @@@BUILD_STEP build libcxx/msan@@@
-if [ ! -d libcxx_build_msan ]; then
-  mkdir libcxx_build_msan
-fi
-
-(cd libcxx_build_msan && \
-  cmake \
-    ${CMAKE_STAGE2_COMMON_OPTIONS} \
-    -DLLVM_USE_SANITIZER=${MEMORY_SANITIZER_KIND} \
-    $LLVM && \
-  ninja cxx cxxabi) || echo @@@STEP_FAILURE@@@
-
-
-echo @@@BUILD_STEP build clang/msan@@@
-if [ ! -d llvm_build_msan ]; then
-  mkdir llvm_build_msan
-fi
-
-MSAN_LDFLAGS="-lc++abi -Wl,--rpath=${ROOT}/libcxx_build_msan/lib -L${ROOT}/libcxx_build_msan/lib"
-# See http://llvm.org/bugs/show_bug.cgi?id=19071, http://www.cmake.org/Bug/view.php?id=15264
-CMAKE_BUG_WORKAROUND_CFLAGS="$MSAN_LDFLAGS -fsanitize=memory -w"
-MSAN_CFLAGS="-I${ROOT}/libcxx_build_msan/include -I${ROOT}/libcxx_build_msan/include/c++/v1 $CMAKE_BUG_WORKAROUND_CFLAGS"
-
-(cd llvm_build_msan && \
- cmake ${CMAKE_STAGE2_COMMON_OPTIONS} \
-   -DLLVM_USE_SANITIZER=${MEMORY_SANITIZER_KIND} \
-   -DLLVM_ENABLE_LIBCXX=ON \
-   -DCMAKE_C_FLAGS="${MSAN_CFLAGS}" \
-   -DCMAKE_CXX_FLAGS="${MSAN_CFLAGS}" \
-   -DCMAKE_EXE_LINKER_FLAGS="${MSAN_LDFLAGS}" \
-   $LLVM && \
- ninja clang) || echo @@@STEP_FAILURE@@@
-
-echo @@@BUILD_STEP check-llvm msan@@@
-
-(cd llvm_build_msan && ninja check-llvm) || echo @@@STEP_WARNINGS@@@
-
-echo @@@BUILD_STEP check-clang msan@@@
-
-(cd llvm_build_msan && ninja check-clang) || echo @@@STEP_FAILURE@@@
+build_stage2_msan
 
----------------
eugenis wrote:
> I think it would be better if stuff in buildbot_functions.sh did not rely on the STAGE2_MSAN_DIR and similar settings, and instead got them through function arguments. That would make it more reusable.
> Ex.
> 
> build_stage2_msan "step name" <target directory> <previous stage compiler directory>
> 
> 
> 
As discussed offline, this is not worth the trobule

================
Comment at: zorg/buildbot/builders/sanitizers/buildbot_functions.sh:99
@@ +98,3 @@
+  type -a gcc
+  type -a g++
+  mkdir -p ${STAGE1_DIR}
----------------
eugenis wrote:
> these are debug leftovers, please remove
Done.

================
Comment at: zorg/buildbot/builders/sanitizers/buildbot_functions.sh:101
@@ +100,3 @@
+  mkdir -p ${STAGE1_DIR}
+  # Build cxx/cxxabi to fool the compiler check in MSan stage 2.
+  cmake_stage1_options="${CMAKE_COMMON_OPTIONS}"
----------------
eugenis wrote:
> the comment is out of date, please remove it
Done.

================
Comment at: zorg/buildbot/builders/sanitizers/buildbot_functions.sh:123
@@ +122,3 @@
+  
+  memory_sanitizer_kind="Memory"
+  BUILDBOT_MSAN_ORIGINS=${BUILDBOT_MSAN_ORIGINS:-}
----------------
eugenis wrote:
> local
done

http://reviews.llvm.org/D6710

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list