@@ -88,7 +88,7 @@ function rm_dirs {
88
88
function cleanup() {
89
89
[[ -v BUILDBOT_BUILDERNAME ]] || return 0
90
90
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* " $@ "
92
92
if ccache -s > /dev/null ; then
93
93
rm_dirs llvm_build64
94
94
fi
@@ -228,6 +228,7 @@ function build_stage2 {
228
228
echo @@@BUILD_STEP stage2/$sanitizer_name build libcxx@@@
229
229
230
230
local libcxx_build_dir=libcxx_build_${sanitizer_name}
231
+ local libcxx_install_dir=libcxx_install_${sanitizer_name}
231
232
local build_dir=llvm_build_${sanitizer_name}
232
233
export STAGE2_DIR=${build_dir}
233
234
local cmake_libcxx_cflags=
@@ -283,18 +284,22 @@ function build_stage2 {
283
284
(cd ${libcxx_build_dir} && \
284
285
cmake \
285
286
${cmake_stage2_common_options} \
287
+ -DCMAKE_INSTALL_PREFIX=" ${ROOT} /${libcxx_install_dir} " \
286
288
-DLLVM_ENABLE_RUNTIMES=' libcxx;libcxxabi;libunwind' \
287
289
-DLIBCXX_TEST_PARAMS=' long_tests=False' \
288
290
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
289
291
-DLLVM_USE_SANITIZER=${llvm_use_sanitizer} \
290
292
-DCMAKE_C_FLAGS=" ${fsanitize_flag} ${cmake_libcxx_cflags} ${fno_sanitize_flag} " \
291
293
-DCMAKE_CXX_FLAGS=" ${fsanitize_flag} ${cmake_libcxx_cflags} ${fno_sanitize_flag} " \
292
294
$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} " )
294
300
295
- local libcxx_runtime_path=$( dirname $( find ${ROOT} /${libcxx_build_dir} -name libc++.so) )
296
301
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 "
298
303
299
304
echo @@@BUILD_STEP stage2/$sanitizer_name build@@@
300
305
0 commit comments