[zorg] r370133 - [sanitizer] Move more of STAGE1 build into functions.sh
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 27 17:27:24 PDT 2019
Author: vitalybuka
Date: Tue Aug 27 17:27:24 2019
New Revision: 370133
URL: http://llvm.org/viewvc/llvm-project?rev=370133&view=rev
Log:
[sanitizer] Move more of STAGE1 build into functions.sh
Modified:
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_asan.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_ubsan.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fuzzer.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh
zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_mte.sh
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh Tue Aug 27 17:27:24 2019
@@ -17,7 +17,6 @@ USE_GIT=0
CHECK_LIBCXX=${CHECK_LIBCXX:-1}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
STAGE1_CLOBBER="llvm_build64 compiler_rt_build_android_* llvm_build_android_*"
LLVM=$ROOT/llvm
CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_PARALLEL_LINK_JOBS=20"
@@ -36,7 +35,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
echo @@@BUILD_STEP clobber@@@
rm -rf llvm
rm -rf llvm-project
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
rm -rf android_ndk
rm -rf platform-tools
fi
@@ -47,7 +46,6 @@ download_android_tools r16
build_stage1_clang_at_revison
### From now on we use just-built Clang as a host compiler ###
-CLANG_PATH=${ROOT}/${STAGE1_DIR}/bin
echo @@@BUILD_STEP update@@@
buildbot_update
@@ -55,7 +53,7 @@ buildbot_update
CMAKE_COMMON_OPTIONS="$CMAKE_COMMON_OPTIONS -DLLVM_ENABLE_ASSERTIONS=ON"
# Build self-hosted tree with fresh Clang and -Werror.
-CMAKE_OPTIONS="${CMAKE_COMMON_OPTIONS} -DLLVM_ENABLE_WERROR=ON -DCMAKE_C_COMPILER=${CLANG_PATH}/clang -DCMAKE_CXX_COMPILER=${CLANG_PATH}/clang++ -DCMAKE_C_FLAGS=-gmlt -DCMAKE_CXX_FLAGS=-gmlt"
+CMAKE_OPTIONS="${CMAKE_COMMON_OPTIONS} -DLLVM_ENABLE_WERROR=ON ${STAGE1_AS_COMPILER} -DCMAKE_C_FLAGS=-gmlt -DCMAKE_CXX_FLAGS=-gmlt"
echo @@@BUILD_STEP bootstrap clang@@@
mkdir -p llvm_build64
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_asan.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_asan.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_asan.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_asan.sh Tue Aug 27 17:27:24 2019
@@ -15,7 +15,6 @@ USE_GIT=0
CHECK_LIBCXX=${CHECK_LIBCXX:-1}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
LLVM=$ROOT/llvm
CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_PARALLEL_LINK_JOBS=20"
@@ -23,7 +22,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
echo @@@BUILD_STEP clobber@@@
rm -rf llvm
rm -rf llvm-project
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
fi
# CMake does not notice that the compiler itself has changed.
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_msan.sh Tue Aug 27 17:27:24 2019
@@ -15,7 +15,6 @@ USE_GIT=0
CHECK_LIBCXX=${CHECK_LIBCXX:-1}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
LLVM=$ROOT/llvm
CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_PARALLEL_LINK_JOBS=20"
@@ -23,7 +22,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
echo @@@BUILD_STEP clobber@@@
rm -rf llvm
rm -rf llvm-project
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
fi
# CMake does not notice that the compiler itself has changed.
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_ubsan.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_ubsan.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_ubsan.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_bootstrap_ubsan.sh Tue Aug 27 17:27:24 2019
@@ -15,7 +15,6 @@ USE_GIT=0
CHECK_LIBCXX=${CHECK_LIBCXX:-1}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
LLVM=$ROOT/llvm
CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_PARALLEL_LINK_JOBS=20"
@@ -23,7 +22,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
echo @@@BUILD_STEP clobber@@@
rm -rf llvm
rm -rf llvm-project
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
fi
# CMake does not notice that the compiler itself has changed.
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fast.sh Tue Aug 27 17:27:24 2019
@@ -15,7 +15,6 @@ USE_GIT=1
CHECK_LIBCXX=${CHECK_LIBCXX:-1}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
LLVM=$ROOT/llvm
STAGE1_CLOBBER="llvm_build_* libcxx_build_*"
CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_PARALLEL_LINK_JOBS=20"
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_functions.sh Tue Aug 27 17:27:24 2019
@@ -175,6 +175,13 @@ function gclient_runhooks {
)
}
+function common_stage1_variables {
+ STAGE1_DIR=llvm_build0
+ stage1_clang_path=$ROOT/${STAGE1_DIR}/bin
+ llvm_symbolizer_path=${stage1_clang_path}/llvm-symbolizer
+ STAGE1_AS_COMPILER="-DCMAKE_C_COMPILER=${stage1_clang_path}/clang -DCMAKE_CXX_COMPILER=${stage1_clang_path}/clang++"
+}
+
function build_stage1_clang_impl {
mkdir -p ${STAGE1_DIR}
local cmake_stage1_options="${CMAKE_COMMON_OPTIONS}"
@@ -187,11 +194,14 @@ function build_stage1_clang_impl {
function build_stage1_clang {
echo @@@BUILD_STEP build stage1 clang@@@
+ export STAGE1_DIR=llvm_build0
+ common_stage1_variables
build_stage1_clang_impl
}
function build_stage1_clang_at_revison {
local HOST_CLANG_REVISION=360832
+ common_stage1_variables
if [ -r ${STAGE1_DIR}/host_clang_revision ] && \
[ "$(cat ${STAGE1_DIR}/host_clang_revision)" == $HOST_CLANG_REVISION ]
@@ -211,13 +221,8 @@ function build_stage1_clang_at_revison {
}
function common_stage2_variables {
- local stage1_clang_path=$ROOT/${STAGE1_DIR}/bin
cmake_stage2_common_options="\
- ${CMAKE_COMMON_OPTIONS} \
- -DCMAKE_C_COMPILER=${stage1_clang_path}/clang \
- -DCMAKE_CXX_COMPILER=${stage1_clang_path}/clang++ \
- "
- llvm_symbolizer_path=${stage1_clang_path}/llvm-symbolizer
+ ${CMAKE_COMMON_OPTIONS} ${STAGE1_AS_COMPILER}"
}
function build_stage2 {
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fuzzer.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fuzzer.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fuzzer.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_fuzzer.sh Tue Aug 27 17:27:24 2019
@@ -15,7 +15,6 @@ USE_GIT=1
CHECK_LIBCXX=${CHECK_LIBCXX:-0}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
MAKE_JOBS=${MAX_MAKE_JOBS:-$(nproc)}
LLVM=$ROOT/llvm
LIBFUZZER=$LLVM/lib/Fuzzer
@@ -27,7 +26,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
echo @@@BUILD_STEP clobber@@@
rm -rf llvm
rm -rf llvm-project
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
fi
# Make sure asan intercepts SIGABRT so that the fuzzer can print the test cases
@@ -41,9 +40,8 @@ buildbot_update
build_stage1_clang
-clang_path=$ROOT/${STAGE1_DIR}/bin
# export ASAN_SYMBOLIZER_PATH="${llvm_symbolizer_path}"
-export PATH="${clang_path}:$PATH"
+export PATH="$(readlink -f ${STAGE1_DIR}/bin):$PATH"
echo @@@BUILD_STEP check-fuzzer@@@
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_gn.sh Tue Aug 27 17:27:24 2019
@@ -10,7 +10,6 @@ PLATFORM=`uname`
CHECK_LIBCXX=${CHECK_LIBCXX:-0}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
STAGE1_CLOBBER=
STAGE2_DIR=llvm_build
@@ -19,7 +18,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
rm -rf llvm
rm -rf llvm-project
rm -rf gn
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
rm -rf ${STAGE2_DIR}
fi
@@ -32,7 +31,7 @@ fi
echo @@@BUILD_STEP build GN@@@
[[ -d gn ]] || git clone https://gn.googlesource.com/gn
(
- export PATH="$PATH:$(readlink -f $STAGE1_DIR)/bin"
+ export PATH="$PATH:$(readlink -f ${STAGE1_DIR}/bin)"
cd gn
git checkout d3304fbba9e39a5e996cbc8c769499a1079a8743
python build/gen.py
@@ -54,7 +53,7 @@ buildbot_update_git
export PATH=$(readlink -f gn/out/):$PATH
$LLVM/utils/gn/gn.py gen ${STAGE2_DIR} \
--list --short --overrides-only \
- --args="clang_base_path=\"$(readlink -f $STAGE1_DIR)\""
+ --args="clang_base_path=\"$(readlink -f ${STAGE1_DIR})\""
) || echo @@@STEP_FAILURE@@@
(
Modified: zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_mte.sh
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_mte.sh?rev=370133&r1=370132&r2=370133&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_mte.sh (original)
+++ zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_mte.sh Tue Aug 27 17:27:24 2019
@@ -15,7 +15,6 @@ USE_GIT=0
CHECK_LIBCXX=${CHECK_LIBCXX:-1}
CHECK_LLD=${CHECK_LLD:-1}
-STAGE1_DIR=llvm_build0
LLVM=$ROOT/llvm
CMAKE_COMMON_OPTIONS="-GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_PARALLEL_COMPILE_JOBS=100 -DLLVM_PARALLEL_LINK_JOBS=20"
@@ -23,7 +22,7 @@ if [ "$BUILDBOT_CLOBBER" != "" ]; then
echo @@@BUILD_STEP clobber@@@
rm -rf llvm
rm -rf llvm-project
- rm -rf ${STAGE1_DIR}
+ rm -rf llvm_build0
fi
echo @@@BUILD_STEP update@@@
More information about the llvm-commits
mailing list