Skip to content

Commit 3cfda11

Browse files
committed
[π˜€π—½π—Ώ] initial version
Created using spr 1.3.6-beta.1
2 parents 26a33cd + 8fde12f commit 3cfda11

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

β€Žzorg/buildbot/builders/sanitizers/buildbot_functions.shβ€Ž

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ function cmake() {
8282
}
8383

8484
function rm_dirs {
85-
while ! rm -rf $@ ; do sleep 1; done
85+
while ! rm -rf "$@" ; do sleep 1; done
8686
}
8787

8888
function cleanup() {
8989
[[ -v BUILDBOT_BUILDERNAME ]] || return 0
9090
echo @@@BUILD_STEP cleanup@@@
91-
rm_dirs llvm_build2_* llvm_build_* libcxx_build_* compiler_rt_build* symbolizer_build* $@
91+
rm_dirs llvm_build2_* llvm_build_* libcxx_build_* libcxx_install_* compiler_rt_build* symbolizer_build* "$@"
9292
if ccache -s >/dev/null ; then
9393
rm_dirs llvm_build64
9494
fi
9595
# Workaround the case when a new unittest was reverted, but incremental build continues to execute the leftover binary.
9696
find -path ./llvm-project -prune -o -executable -type f -path '*unittests*' -print -exec rm -f {} \;
97-
du -hs * | sort -h
97+
du -hs ./* | sort -h
9898
}
9999

100100
function clobber {
@@ -104,9 +104,9 @@ function clobber {
104104
echo "Clobbering is supported only on buildbot only!"
105105
exit 1
106106
fi
107-
rm_dirs *
107+
rm_dirs ./*
108108
else
109-
BUILDBOT_BUILDERNAME=1 cleanup $@
109+
BUILDBOT_BUILDERNAME=1 cleanup "$@"
110110
fi
111111
}
112112

@@ -204,7 +204,7 @@ function build_clang_at_release_tag {
204204
then
205205
echo "@@@BUILD_STEP using pre-built stage1 clang at r${host_clang_revision}@@@"
206206
else
207-
BUILDBOT_MONO_REPO_PATH= BUILDBOT_REVISION="${host_clang_revision}" buildbot_update
207+
BUILDBOT_MONO_REPO_PATH="" BUILDBOT_REVISION="${host_clang_revision}" buildbot_update
208208

209209
rm -rf ${STAGE1_DIR}
210210
echo @@@BUILD_STEP build stage1 clang at $host_clang_revision@@@
@@ -228,6 +228,7 @@ function build_stage2 {
228228
echo @@@BUILD_STEP stage2/$sanitizer_name build libcxx@@@
229229

230230
local libcxx_build_dir=libcxx_build_${sanitizer_name}
231+
local libcxx_install_dir=libcxx_install_${sanitizer_name}
231232
local build_dir=llvm_build_${sanitizer_name}
232233
export STAGE2_DIR=${build_dir}
233234
local cmake_libcxx_cflags=
@@ -283,18 +284,22 @@ function build_stage2 {
283284
(cd ${libcxx_build_dir} && \
284285
cmake \
285286
${cmake_stage2_common_options} \
287+
-DCMAKE_INSTALL_PREFIX="${ROOT}/${libcxx_install_dir}" \
286288
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind' \
287289
-DLIBCXX_TEST_PARAMS='long_tests=False' \
288290
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
289291
-DLLVM_USE_SANITIZER=${llvm_use_sanitizer} \
290292
-DCMAKE_C_FLAGS="${fsanitize_flag} ${cmake_libcxx_cflags} ${fno_sanitize_flag}" \
291293
-DCMAKE_CXX_FLAGS="${fsanitize_flag} ${cmake_libcxx_cflags} ${fno_sanitize_flag}" \
292294
$LLVM/../runtimes && \
293-
ninja cxx cxxabi) || build_failure
295+
ninja cxx cxxabi && ninja install-cxx install-cxxabi) || build_failure
296+
297+
local libcxx_so_path="$(find "${ROOT}/${libcxx_install_dir}" -name libc++.so)"
298+
test -f "${libcxx_so_path}" || build_failure
299+
local libcxx_runtime_path=$(dirname "${libcxx_so_path}")
294300

295-
local libcxx_runtime_path=$(dirname $(find ${ROOT}/${libcxx_build_dir} -name libc++.so))
296301
local sanitizer_ldflags="-Wl,--rpath=${libcxx_runtime_path} -L${libcxx_runtime_path}"
297-
local sanitizer_cflags="-nostdinc++ -isystem ${ROOT}/${libcxx_build_dir}/include -isystem ${ROOT}/${libcxx_build_dir}/include/c++/v1 $fsanitize_flag"
302+
local sanitizer_cflags="-nostdinc++ -isystem ${ROOT}/${libcxx_install_dir}/include -isystem ${ROOT}/${libcxx_install_dir}/include/c++/v1 $fsanitize_flag"
298303

299304
echo @@@BUILD_STEP stage2/$sanitizer_name build@@@
300305

0 commit comments

Comments
Β (0)