[libcxx-commits] [libcxx] [libcxx] Add OHOS support (PR #73114)
Pavel Kosov via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 30 04:06:59 PST 2023
https://github.com/kpdev updated https://github.com/llvm/llvm-project/pull/73114
>From 5ef728bfa6b86ad863059278f38cc6e6c2888532 Mon Sep 17 00:00:00 2001
From: Pavel Kosov <kpdev42 at gmail.com>
Date: Wed, 22 Nov 2023 16:02:59 +0300
Subject: [PATCH 1/4] [libcxx] Add OHOS support
Add support for OpenHarmony OS (OHOS)
OpenHarmony is an open-source project incubated and operated by the OpenAtom Foundation.
It targets IoT, and already used on production devices.
General OpenHarmony OS discussion on discourse thread:
"Add support for OpenHarmony OS"
https://discourse.llvm.org/t/rfc-add-support-for-openharmony-os/66656
LLVM and clang parts of OHOS support: D138202, D145227
Phabricator review: D146804
~~
Huawei RRI, OS Lab
---
libcxx/cmake/config-ix.cmake | 2 ++
libcxx/include/__config | 5 +++--
libcxx/include/__locale | 3 +++
libcxx/src/include/config_elast.h | 2 ++
libcxx/utils/ci/BOT_OWNERS.txt | 5 +++++
libcxx/utils/ci/buildkite-pipeline.yml | 11 +++++++++++
6 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake
index a365517936e7565..c92fd0f8762ea98 100644
--- a/libcxx/cmake/config-ix.cmake
+++ b/libcxx/cmake/config-ix.cmake
@@ -103,6 +103,8 @@ elseif(APPLE)
set(LIBCXX_HAS_PTHREAD_LIB NO)
set(LIBCXX_HAS_RT_LIB NO)
set(LIBCXX_HAS_ATOMIC_LIB NO)
+elseif(OHOS)
+ set(LIBCXX_HAS_ATOMIC_LIB NO)
elseif(FUCHSIA)
set(LIBCXX_HAS_PTHREAD_LIB NO)
set(LIBCXX_HAS_RT_LIB NO)
diff --git a/libcxx/include/__config b/libcxx/include/__config
index e8da358bb8d7cd5..da5613fe189b8cb 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -1098,7 +1098,8 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
defined(__APPLE__) || \
defined(__MVS__) || \
defined(_AIX) || \
- defined(__EMSCRIPTEN__)
+ defined(__EMSCRIPTEN__) || \
+ defined(__OHOS_FAMILY__)
// clang-format on
# define _LIBCPP_HAS_THREAD_API_PTHREAD
# elif defined(__Fuchsia__)
@@ -1176,7 +1177,7 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
# endif
# if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \
- defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__)
+ defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) || defined(__OHOS_FAMILY__)
# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
# endif
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index b1502dd71edadf6..c5d8fe72cdf9631 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -48,6 +48,9 @@
#elif defined(__wasi__)
// WASI libc uses musl's locales support.
# include <__support/musl/xlocale.h>
+#elif defined(__OHOS_FAMILY__)
+// LiteOS libc uses musl's locales support.
+# include <__support/musl/xlocale.h>
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
# include <__support/musl/xlocale.h>
#endif
diff --git a/libcxx/src/include/config_elast.h b/libcxx/src/include/config_elast.h
index a772ea7a01bcefb..64a548f63c98282 100644
--- a/libcxx/src/include/config_elast.h
+++ b/libcxx/src/include/config_elast.h
@@ -29,6 +29,8 @@
// No _LIBCPP_ELAST needed on Fuchsia
#elif defined(__wasi__)
// No _LIBCPP_ELAST needed on WASI
+#elif defined(__OHOS_FAMILY__)
+// No _LIBCPP_ELAST needed on OHOS
#elif defined(__EMSCRIPTEN__)
// No _LIBCPP_ELAST needed on Emscripten
#elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
diff --git a/libcxx/utils/ci/BOT_OWNERS.txt b/libcxx/utils/ci/BOT_OWNERS.txt
index 721b19e52d8bcb1..1e624257d3dfd40 100644
--- a/libcxx/utils/ci/BOT_OWNERS.txt
+++ b/libcxx/utils/ci/BOT_OWNERS.txt
@@ -20,3 +20,8 @@ N: Android libc++
E: rprichard at google.com
H: rprichard
D: Emulator-based x86[-64] libc++ CI testing
+
+N: OpenHarmony libc++
+E: kosov.pavel at huawei.com
+H: kpdev42
+D: AArch64
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index 39db2bfc473813a..a72700c6d83add8 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -82,6 +82,10 @@ agents_definitions:
agents:
queue: libcxx-builders
os: android
+ _ohos_agent: &ohos_agent
+ agents:
+ queue: libcxx-builders
+ os: ohos
environment_definitions:
@@ -274,6 +278,13 @@ steps:
<<: *android_agent
<<: *common
+- group: ':ohos: OpenHarmony'
+ steps:
+ - label: OpenHarmony Aarch64
+ command: libcxx/utils/ci/run-buildbot aarch64-linux-ohos
+ soft_fail: true
+ <<: *ohos_agent
+ <<: *common
# TODO: Re-enable this once we've figured out how to run back-deployment testing on arm64 on recent OSes
# - label: "Apple back-deployment macosx11.0 arm64"
>From 755adf2556d5f524ab46892714211704c87f33dc Mon Sep 17 00:00:00 2001
From: Pavel Kosov <kpdev42 at gmail.com>
Date: Wed, 22 Nov 2023 20:56:24 +0300
Subject: [PATCH 2/4] [libcxx][ohos] Add ohos site to bot_owners file
---
libcxx/utils/ci/BOT_OWNERS.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcxx/utils/ci/BOT_OWNERS.txt b/libcxx/utils/ci/BOT_OWNERS.txt
index 1e624257d3dfd40..e42b2513e4abec6 100644
--- a/libcxx/utils/ci/BOT_OWNERS.txt
+++ b/libcxx/utils/ci/BOT_OWNERS.txt
@@ -22,6 +22,7 @@ H: rprichard
D: Emulator-based x86[-64] libc++ CI testing
N: OpenHarmony libc++
+W: https://www.openharmony.cn/docs/en/overview
E: kosov.pavel at huawei.com
H: kpdev42
-D: AArch64
+D: AArch64 libc++ CI testing
>From 9ca108104dc030ffe976d82c3e1ea60399d5a482 Mon Sep 17 00:00:00 2001
From: Pavel Kosov <kpdev42 at gmail.com>
Date: Wed, 22 Nov 2023 22:48:40 +0300
Subject: [PATCH 3/4] [libcxx][ohos] Simplify ci group name
---
libcxx/utils/ci/buildkite-pipeline.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index a72700c6d83add8..5312201eabe43a4 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -278,7 +278,7 @@ steps:
<<: *android_agent
<<: *common
-- group: ':ohos: OpenHarmony'
+- group: ' OpenHarmony'
steps:
- label: OpenHarmony Aarch64
command: libcxx/utils/ci/run-buildbot aarch64-linux-ohos
>From 1a56ad9916157dc615389d5d07d0aa5db842cde7 Mon Sep 17 00:00:00 2001
From: Pavel Kosov <kpdev42 at gmail.com>
Date: Thu, 30 Nov 2023 15:05:35 +0300
Subject: [PATCH 4/4] [libcxx][ohos] Temporary disable other builders
---
libcxx/utils/ci/run-buildbot | 1094 +++++++++++++++++-----------------
1 file changed, 551 insertions(+), 543 deletions(-)
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index fe99388a799be8a..48a66c3f686744b 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -210,550 +210,557 @@ ${NINJA} --version
if [ ! -z "${CXX}" ]; then ${CXX} --version; fi
case "${BUILDER}" in
-check-generated-output)
- # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
- # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not
- clean
- generate-cmake
-
- set +x # Printing all the commands below just creates extremely confusing output
-
- # Reject patches that forgot to re-run the generator scripts.
- echo "+++ Making sure the generator scripts were run"
- ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
- git diff | tee ${BUILD_DIR}/generated_output.patch
- git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
- ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
- if [ -s ${BUILD_DIR}/generated_output.status ]; then
- echo "It looks like not all the generator scripts were run,"
- echo "did you forget to build the libcxx-generate-files target?"
- echo "Did you add all new files it generated?"
- false
- fi
-
- echo "+++ Making sure libcxx/utils/data/ignore_format.txt was updated appropriately"
- cp ${MONOREPO_ROOT}/libcxx/utils/data/ignore_format.txt ${BUILD_DIR}/before.txt
- ${MONOREPO_ROOT}/libcxx/utils/generate_ignore_format.sh
- diff ${BUILD_DIR}/before.txt ${MONOREPO_ROOT}/libcxx/utils/data/ignore_format.txt | tee ${BUILD_DIR}/ignore_format.diff || true
- if [ -s ${BUILD_DIR}/ignore_format.diff ]; then
- echo "It looks like the list of not formatted files has changed."
- echo "If a file is now properly formatted with clang-format, remove the file name from "
- echo "libcxx/utils/data/ignore_format.txt. Otherwise you have to fix the"
- echo "formatting of some of the changed files. The diff above represents the "
- echo "changes that would be needed to ignore_format.txt to keep it representative "
- echo "of which files are mis-formatted in the project."
- false
- fi
-
- # Reject patches that introduce non-ASCII characters or hard tabs.
- # Depends on LC_COLLATE set at the top of this script.
- set -x
- ! grep -rn '[^ -~]' libcxx/include libcxx/src libcxx/test libcxx/benchmarks \
- --exclude '*.dat' \
- --exclude '*unicode*.cpp' \
- --exclude '*print*.sh.cpp' \
- --exclude 'escaped_output.*.pass.cpp' \
- --exclude 'format_tests.h' \
- --exclude 'format.functions.tests.h' \
- --exclude 'formatter.*.pass.cpp' \
- --exclude 'grep.pass.cpp' \
- --exclude 'locale-specific_form.pass.cpp' \
- --exclude 'ostream.pass.cpp' \
- --exclude 'transcoding.pass.cpp' \
- --exclude 'underflow.pass.cpp' \
- || false
-
- # Reject code with trailing whitespace
- ! grep -rn '[[:blank:]]$' libcxx/include libcxx/src libcxx/test libcxx/benchmarks || false
-;;
-#
-# Various Standard modes
-#
-generic-cxx03)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-cxx11)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-cxx14)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-cxx17)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-cxx20)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-cxx23)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx23.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-cxx26)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx26.cmake"
- check-runtimes
- check-abi-list
-;;
-#
-# Other compiler support
-#
-generic-gcc)
- clean
- generate-cmake -DLIBCXX_ENABLE_WERROR=NO \
- -DLIBCXXABI_ENABLE_WERROR=NO \
- -DLIBUNWIND_ENABLE_WERROR=NO
- check-runtimes
-;;
-generic-gcc-cxx11)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
- -DLIBCXX_ENABLE_WERROR=NO \
- -DLIBCXXABI_ENABLE_WERROR=NO \
- -DLIBUNWIND_ENABLE_WERROR=NO
- check-runtimes
-;;
-#
-# Sanitizers
-#
-generic-asan)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"
- check-runtimes
-;;
-generic-msan)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake"
- check-runtimes
-;;
-generic-tsan)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake"
- check-runtimes
-;;
-generic-ubsan)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake"
- check-runtimes
-;;
-#
-# Various build configurations
-#
-bootstrapping-build)
- clean
-
- echo "--- Generating CMake"
- ${CMAKE} \
- -S "${MONOREPO_ROOT}/llvm" \
- -B "${BUILD_DIR}" \
- -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
- -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
- -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
- -DLLVM_ENABLE_PROJECTS="clang" \
- -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
- -DLLVM_RUNTIME_TARGETS="$(${CXX} --print-target-triple)" \
- -DLLVM_TARGETS_TO_BUILD="host" \
- -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
- -DLLVM_ENABLE_ASSERTIONS=ON \
- -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
-
- echo "+++ Running the libc++ and libc++abi tests"
- ${NINJA} -vC "${BUILD_DIR}" check-runtimes
-
- echo "--- Installing libc++ and libc++abi to a fake location"
- ${NINJA} -vC "${BUILD_DIR}" install-runtimes
-
- ccache -s
-;;
-generic-static)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake"
- check-runtimes
-;;
-generic-merged)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-merged.cmake" \
- -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
- -DLIBCXXABI_TEST_CONFIG="llvm-libc++abi-merged.cfg.in" \
- -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in"
- check-runtimes
-;;
-generic-hardening-mode-fast)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-fast.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-hardening-mode-fast-with-abi-breaks)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-fast-with-abi-breaks.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-hardening-mode-extensive)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-hardening-mode-debug)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-debug.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-with_llvm_unwinder)
- clean
+# check-generated-output)
+# # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
+# # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not
+# clean
+# generate-cmake
+
+# set +x # Printing all the commands below just creates extremely confusing output
+
+# # Reject patches that forgot to re-run the generator scripts.
+# echo "+++ Making sure the generator scripts were run"
+# ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
+# git diff | tee ${BUILD_DIR}/generated_output.patch
+# git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
+# ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
+# if [ -s ${BUILD_DIR}/generated_output.status ]; then
+# echo "It looks like not all the generator scripts were run,"
+# echo "did you forget to build the libcxx-generate-files target?"
+# echo "Did you add all new files it generated?"
+# false
+# fi
+
+# echo "+++ Making sure libcxx/utils/data/ignore_format.txt was updated appropriately"
+# cp ${MONOREPO_ROOT}/libcxx/utils/data/ignore_format.txt ${BUILD_DIR}/before.txt
+# ${MONOREPO_ROOT}/libcxx/utils/generate_ignore_format.sh
+# diff ${BUILD_DIR}/before.txt ${MONOREPO_ROOT}/libcxx/utils/data/ignore_format.txt | tee ${BUILD_DIR}/ignore_format.diff || true
+# if [ -s ${BUILD_DIR}/ignore_format.diff ]; then
+# echo "It looks like the list of not formatted files has changed."
+# echo "If a file is now properly formatted with clang-format, remove the file name from "
+# echo "libcxx/utils/data/ignore_format.txt. Otherwise you have to fix the"
+# echo "formatting of some of the changed files. The diff above represents the "
+# echo "changes that would be needed to ignore_format.txt to keep it representative "
+# echo "of which files are mis-formatted in the project."
+# false
+# fi
+
+# # Reject patches that introduce non-ASCII characters or hard tabs.
+# # Depends on LC_COLLATE set at the top of this script.
+# set -x
+# ! grep -rn '[^ -~]' libcxx/include libcxx/src libcxx/test libcxx/benchmarks \
+# --exclude '*.dat' \
+# --exclude '*unicode*.cpp' \
+# --exclude '*print*.sh.cpp' \
+# --exclude 'escaped_output.*.pass.cpp' \
+# --exclude 'format_tests.h' \
+# --exclude 'format.functions.tests.h' \
+# --exclude 'formatter.*.pass.cpp' \
+# --exclude 'grep.pass.cpp' \
+# --exclude 'locale-specific_form.pass.cpp' \
+# --exclude 'ostream.pass.cpp' \
+# --exclude 'transcoding.pass.cpp' \
+# --exclude 'underflow.pass.cpp' \
+# || false
+
+# # Reject code with trailing whitespace
+# ! grep -rn '[[:blank:]]$' libcxx/include libcxx/src libcxx/test libcxx/benchmarks || false
+# ;;
+# #
+# # Various Standard modes
+# #
+# generic-cxx03)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-cxx11)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-cxx14)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-cxx17)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-cxx20)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-cxx23)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx23.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-cxx26)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx26.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# #
+# # Other compiler support
+# #
+# generic-gcc)
+# clean
+# generate-cmake -DLIBCXX_ENABLE_WERROR=NO \
+# -DLIBCXXABI_ENABLE_WERROR=NO \
+# -DLIBUNWIND_ENABLE_WERROR=NO
+# check-runtimes
+# ;;
+# generic-gcc-cxx11)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
+# -DLIBCXX_ENABLE_WERROR=NO \
+# -DLIBCXXABI_ENABLE_WERROR=NO \
+# -DLIBUNWIND_ENABLE_WERROR=NO
+# check-runtimes
+# ;;
+# #
+# # Sanitizers
+# #
+# generic-asan)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"
+# check-runtimes
+# ;;
+# generic-msan)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake"
+# check-runtimes
+# ;;
+# generic-tsan)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake"
+# check-runtimes
+# ;;
+# generic-ubsan)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake"
+# check-runtimes
+# ;;
+# #
+# # Various build configurations
+# #
+# bootstrapping-build)
+# clean
+
+# echo "--- Generating CMake"
+# ${CMAKE} \
+# -S "${MONOREPO_ROOT}/llvm" \
+# -B "${BUILD_DIR}" \
+# -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+# -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
+# -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+# -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+# -DLLVM_ENABLE_PROJECTS="clang" \
+# -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+# -DLLVM_RUNTIME_TARGETS="$(${CXX} --print-target-triple)" \
+# -DLLVM_TARGETS_TO_BUILD="host" \
+# -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
+# -DLLVM_ENABLE_ASSERTIONS=ON \
+# -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
+
+# echo "+++ Running the libc++ and libc++abi tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-runtimes
+
+# echo "--- Installing libc++ and libc++abi to a fake location"
+# ${NINJA} -vC "${BUILD_DIR}" install-runtimes
+
+# ccache -s
+# ;;
+# generic-static)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake"
+# check-runtimes
+# ;;
+# generic-merged)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-merged.cmake" \
+# -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
+# -DLIBCXXABI_TEST_CONFIG="llvm-libc++abi-merged.cfg.in" \
+# -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in"
+# check-runtimes
+# ;;
+# generic-hardening-mode-fast)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-fast.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-hardening-mode-fast-with-abi-breaks)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-fast-with-abi-breaks.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-hardening-mode-extensive)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-hardening-mode-debug)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-debug.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-with_llvm_unwinder)
+# clean
+# generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON
+# check-runtimes
+# ;;
+# #
+# # Module builds
+# #
+# generic-modules)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-modules-lsv)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules-lsv.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# #
+# # Parts removed
+# #
+# generic-no-threads)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake"
+# check-runtimes
+# ;;
+# generic-no-filesystem)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
+# check-runtimes
+# ;;
+# generic-no-random_device)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake"
+# check-runtimes
+# ;;
+# generic-no-localization)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
+# check-runtimes
+# ;;
+# generic-no-unicode)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake"
+# check-runtimes
+# ;;
+# generic-no-wide-characters)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake"
+# check-runtimes
+# ;;
+# generic-no-tzdb)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-tzdb.cmake"
+# check-runtimes
+# ;;
+# generic-no-experimental)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# generic-no-exceptions)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-exceptions.cmake"
+# check-runtimes
+# check-abi-list
+# ;;
+# #
+# # Other miscellaneous jobs
+# #
+# generic-abi-unstable)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
+# check-runtimes
+# ;;
+# apple-system)
+# clean
+
+# arch="$(uname -m)"
+# xcrun --sdk macosx \
+# ${MONOREPO_ROOT}/libcxx/utils/ci/apple-install-libcxx.sh \
+# --llvm-root ${MONOREPO_ROOT} \
+# --build-dir ${BUILD_DIR} \
+# --install-dir ${INSTALL_DIR} \
+# --symbols-dir "${BUILD_DIR}/symbols" \
+# --architectures "${arch}" \
+# --version "999.99"
+
+# # TODO: It would be better to run the tests against the fake-installed version of libc++ instead
+# xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
+# ;;
+# apple-system-backdeployment-hardened-*)
+# clean
+
+# if [[ "${OSX_ROOTS}" == "" ]]; then
+# echo "--- Downloading previous macOS dylibs"
+# PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
+# OSX_ROOTS="${BUILD_DIR}/macos-roots"
+# mkdir -p "${OSX_ROOTS}"
+# curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
+# fi
+
+# DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-hardened-}"
+
+# # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
+# # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
+# # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
+# cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
+# "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
+# cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
+# "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
+
+# arch="$(uname -m)"
+# PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
+# PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
+# PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
+# PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
+# PARAMS+=";hardening_mode=fast"
+
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
+# -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
+# -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
+# -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
+# -DLIBCXX_TEST_PARAMS="${PARAMS}" \
+# -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
+# -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
+
+# check-runtimes
+# ;;
+# apple-system-backdeployment-*)
+# clean
+
+# if [[ "${OSX_ROOTS}" == "" ]]; then
+# echo "--- Downloading previous macOS dylibs"
+# PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
+# OSX_ROOTS="${BUILD_DIR}/macos-roots"
+# mkdir -p "${OSX_ROOTS}"
+# curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
+# fi
+
+# DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
+
+# # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
+# # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
+# # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
+# cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
+# "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
+# cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
+# "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
+
+# arch="$(uname -m)"
+# PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
+# PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
+# PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
+# PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
+
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
+# -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
+# -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
+# -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
+# -DLIBCXX_TEST_PARAMS="${PARAMS}" \
+# -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
+# -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
+
+# check-runtimes
+# ;;
+# benchmarks)
+# clean
+# generate-cmake
+# check-cxx-benchmarks
+# ;;
+# aarch64)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
+# check-runtimes
+# ;;
+# aarch64-no-exceptions)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
+# -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
+# -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
+# check-runtimes
+# ;;
+# # Aka Armv8 32 bit
+# armv8)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
+# check-runtimes
+# ;;
+# armv8-no-exceptions)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake"
+# check-runtimes
+# ;;
+# # Armv7 32 bit. One building Arm only one Thumb only code.
+# armv7)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
+# check-runtimes
+# ;;
+# armv7-no-exceptions)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake"
+# check-runtimes
+# ;;
+# clang-cl-dll)
+# clean
+# # TODO: Currently, building with the experimental library breaks running
+# # tests (the test linking look for the c++experimental library with the
+# # wrong name, and the statically linked c++experimental can't be linked
+# # correctly when libc++ visibility attributes indicate dllimport linkage
+# # anyway), thus just disable the experimental library. Remove this
+# # setting when cmake and the test driver does the right thing automatically.
+# generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False"
+# echo "+++ Running the libc++ tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxx
+# ;;
+# clang-cl-static)
+# clean
+# generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
+# echo "+++ Running the libc++ tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxx
+# ;;
+# clang-cl-no-vcruntime)
+# clean
+# # Building libc++ in the same way as in clang-cl-dll above, but running
+# # tests with -D_HAS_EXCEPTIONS=0, which users might set in certain
+# # translation units while using libc++, even if libc++ is built with
+# # exceptions enabled.
+# generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \
+# -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-no-vcruntime-clangcl.cfg.in"
+# echo "+++ Running the libc++ tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxx
+# ;;
+# clang-cl-debug)
+# clean
+# generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \
+# -DCMAKE_BUILD_TYPE=Debug
+# echo "+++ Running the libc++ tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxx
+# ;;
+# clang-cl-static-crt)
+# clean
+# # Test linking a static libc++ with the static CRT ("MultiThreaded" denotes
+# # the static CRT, as opposed to "MultiThreadedDLL" which is the default).
+# generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \
+# -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
+# echo "+++ Running the libc++ tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxx
+# ;;
+# mingw-dll)
+# clean
+# # Explicitly specify the compiler with a triple prefix. The CI
+# # environment has got two installations of Clang; the default one
+# # defaults to MSVC mode, while there's an installation of llvm-mingw
+# # further back in PATH. By calling the compiler with an explicit
+# # triple prefix, we use the one that is bundled with a mingw sysroot.
+# generate-cmake \
+# -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
+# -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
+# -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
+# check-runtimes
+# ;;
+# mingw-static)
+# clean
+# generate-cmake \
+# -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
+# -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
+# -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \
+# -DLIBCXX_ENABLE_SHARED=OFF \
+# -DLIBUNWIND_ENABLE_SHARED=OFF
+# check-runtimes
+# ;;
+# mingw-dll-i686)
+# clean
+# generate-cmake \
+# -DCMAKE_C_COMPILER=i686-w64-mingw32-clang \
+# -DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ \
+# -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
+# check-runtimes
+# ;;
+# aix)
+# clean
+# generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AIX.cmake" \
+# -DLIBCXX_TEST_CONFIG="ibm-libc++-shared.cfg.in" \
+# -DLIBCXXABI_TEST_CONFIG="ibm-libc++abi-shared.cfg.in" \
+# -DLIBUNWIND_TEST_CONFIG="ibm-libunwind-shared.cfg.in"
+# check-abi-list
+# check-runtimes
+# ;;
+# android-ndk-*)
+# clean
+
+# ANDROID_EMU_IMG="${BUILDER#android-ndk-}"
+# . "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/emulator-functions.sh"
+# if ! validate_emu_img "${ANDROID_EMU_IMG}"; then
+# echo "error: android-ndk suffix must be a valid emulator image (${ANDROID_EMU_IMG})" >&2
+# exit 1
+# fi
+# ARCH=$(arch_of_emu_img ${ANDROID_EMU_IMG})
+
+# # Use the Android compiler by default.
+# export CC=${CC:-/opt/android/clang/clang-current/bin/clang}
+# export CXX=${CXX:-/opt/android/clang/clang-current/bin/clang++}
+
+# # The NDK libc++_shared.so is always built against the oldest supported API
+# # level. When tests are run against a device with a newer API level, test
+# # programs can be built for any supported API level, but building for the
+# # newest API (i.e. the system image's API) is probably the most interesting.
+# PARAMS="target_triple=$(triple_of_arch ${ARCH})$(api_of_emu_img ${ANDROID_EMU_IMG})"
+# generate-cmake-android -C "${MONOREPO_ROOT}/runtimes/cmake/android/Arch-${ARCH}.cmake" \
+# -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AndroidNDK.cmake" \
+# -DCMAKE_SYSROOT=/opt/android/ndk/sysroot \
+# -DLIBCXX_TEST_PARAMS="${PARAMS}" \
+# -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
+# ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
+
+# # Start the emulator and make sure we can connect to the adb server running
+# # inside of it.
+# "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/start-emulator.sh" ${ANDROID_EMU_IMG}
+# trap "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/stop-emulator.sh" EXIT
+# . "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/setup-env-for-emulator.sh"
+
+# # Create adb_run early to avoid concurrent `mkdir -p` of common parent
+# # directories.
+# adb shell mkdir -p /data/local/tmp/adb_run
+# adb push "${BUILD_DIR}/lib/libc++_shared.so" /data/local/tmp/libc++/libc++_shared.so
+# echo "+++ Running the libc++ tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxx
+# echo "+++ Running the libc++abi tests"
+# ${NINJA} -vC "${BUILD_DIR}" check-cxxabi
+# ;;
+aarch64-linux-ohos)
+ clean
+ # Add its own cmake
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON
+ # Add ohos checks
check-runtimes
;;
-#
-# Module builds
-#
-generic-modules)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-modules-lsv)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules-lsv.cmake"
- check-runtimes
- check-abi-list
-;;
-#
-# Parts removed
-#
-generic-no-threads)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake"
- check-runtimes
-;;
-generic-no-filesystem)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
- check-runtimes
-;;
-generic-no-random_device)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake"
- check-runtimes
-;;
-generic-no-localization)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
- check-runtimes
-;;
-generic-no-unicode)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake"
- check-runtimes
-;;
-generic-no-wide-characters)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake"
- check-runtimes
-;;
-generic-no-tzdb)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-tzdb.cmake"
- check-runtimes
-;;
-generic-no-experimental)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake"
- check-runtimes
- check-abi-list
-;;
-generic-no-exceptions)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-exceptions.cmake"
- check-runtimes
- check-abi-list
-;;
-#
-# Other miscellaneous jobs
-#
-generic-abi-unstable)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
- check-runtimes
-;;
-apple-system)
- clean
-
- arch="$(uname -m)"
- xcrun --sdk macosx \
- ${MONOREPO_ROOT}/libcxx/utils/ci/apple-install-libcxx.sh \
- --llvm-root ${MONOREPO_ROOT} \
- --build-dir ${BUILD_DIR} \
- --install-dir ${INSTALL_DIR} \
- --symbols-dir "${BUILD_DIR}/symbols" \
- --architectures "${arch}" \
- --version "999.99"
-
- # TODO: It would be better to run the tests against the fake-installed version of libc++ instead
- xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
-;;
-apple-system-backdeployment-hardened-*)
- clean
-
- if [[ "${OSX_ROOTS}" == "" ]]; then
- echo "--- Downloading previous macOS dylibs"
- PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
- OSX_ROOTS="${BUILD_DIR}/macos-roots"
- mkdir -p "${OSX_ROOTS}"
- curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
- fi
-
- DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-hardened-}"
-
- # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
- # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
- # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
- cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
- "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
- cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
- "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
-
- arch="$(uname -m)"
- PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
- PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
- PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
- PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
- PARAMS+=";hardening_mode=fast"
-
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
- -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
- -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
- -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
- -DLIBCXX_TEST_PARAMS="${PARAMS}" \
- -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
- -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
-
- check-runtimes
-;;
-apple-system-backdeployment-*)
- clean
-
- if [[ "${OSX_ROOTS}" == "" ]]; then
- echo "--- Downloading previous macOS dylibs"
- PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
- OSX_ROOTS="${BUILD_DIR}/macos-roots"
- mkdir -p "${OSX_ROOTS}"
- curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
- fi
-
- DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
-
- # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
- # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
- # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
- cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
- "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
- cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
- "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
-
- arch="$(uname -m)"
- PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
- PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
- PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
- PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
-
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
- -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
- -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
- -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
- -DLIBCXX_TEST_PARAMS="${PARAMS}" \
- -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
- -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
-
- check-runtimes
-;;
-benchmarks)
- clean
- generate-cmake
- check-cxx-benchmarks
-;;
-aarch64)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
- check-runtimes
-;;
-aarch64-no-exceptions)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
- -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
- -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
- check-runtimes
-;;
-# Aka Armv8 32 bit
-armv8)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
- check-runtimes
-;;
-armv8-no-exceptions)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake"
- check-runtimes
-;;
-# Armv7 32 bit. One building Arm only one Thumb only code.
-armv7)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
- check-runtimes
-;;
-armv7-no-exceptions)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake"
- check-runtimes
-;;
-clang-cl-dll)
- clean
- # TODO: Currently, building with the experimental library breaks running
- # tests (the test linking look for the c++experimental library with the
- # wrong name, and the statically linked c++experimental can't be linked
- # correctly when libc++ visibility attributes indicate dllimport linkage
- # anyway), thus just disable the experimental library. Remove this
- # setting when cmake and the test driver does the right thing automatically.
- generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False"
- echo "+++ Running the libc++ tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxx
-;;
-clang-cl-static)
- clean
- generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
- echo "+++ Running the libc++ tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxx
-;;
-clang-cl-no-vcruntime)
- clean
- # Building libc++ in the same way as in clang-cl-dll above, but running
- # tests with -D_HAS_EXCEPTIONS=0, which users might set in certain
- # translation units while using libc++, even if libc++ is built with
- # exceptions enabled.
- generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \
- -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-no-vcruntime-clangcl.cfg.in"
- echo "+++ Running the libc++ tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxx
-;;
-clang-cl-debug)
- clean
- generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \
- -DCMAKE_BUILD_TYPE=Debug
- echo "+++ Running the libc++ tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxx
-;;
-clang-cl-static-crt)
- clean
- # Test linking a static libc++ with the static CRT ("MultiThreaded" denotes
- # the static CRT, as opposed to "MultiThreadedDLL" which is the default).
- generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \
- -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- echo "+++ Running the libc++ tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxx
-;;
-mingw-dll)
- clean
- # Explicitly specify the compiler with a triple prefix. The CI
- # environment has got two installations of Clang; the default one
- # defaults to MSVC mode, while there's an installation of llvm-mingw
- # further back in PATH. By calling the compiler with an explicit
- # triple prefix, we use the one that is bundled with a mingw sysroot.
- generate-cmake \
- -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
- -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
- -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
- check-runtimes
-;;
-mingw-static)
- clean
- generate-cmake \
- -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
- -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
- -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \
- -DLIBCXX_ENABLE_SHARED=OFF \
- -DLIBUNWIND_ENABLE_SHARED=OFF
- check-runtimes
-;;
-mingw-dll-i686)
- clean
- generate-cmake \
- -DCMAKE_C_COMPILER=i686-w64-mingw32-clang \
- -DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ \
- -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
- check-runtimes
-;;
-aix)
- clean
- generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AIX.cmake" \
- -DLIBCXX_TEST_CONFIG="ibm-libc++-shared.cfg.in" \
- -DLIBCXXABI_TEST_CONFIG="ibm-libc++abi-shared.cfg.in" \
- -DLIBUNWIND_TEST_CONFIG="ibm-libunwind-shared.cfg.in"
- check-abi-list
- check-runtimes
-;;
-android-ndk-*)
- clean
-
- ANDROID_EMU_IMG="${BUILDER#android-ndk-}"
- . "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/emulator-functions.sh"
- if ! validate_emu_img "${ANDROID_EMU_IMG}"; then
- echo "error: android-ndk suffix must be a valid emulator image (${ANDROID_EMU_IMG})" >&2
- exit 1
- fi
- ARCH=$(arch_of_emu_img ${ANDROID_EMU_IMG})
-
- # Use the Android compiler by default.
- export CC=${CC:-/opt/android/clang/clang-current/bin/clang}
- export CXX=${CXX:-/opt/android/clang/clang-current/bin/clang++}
-
- # The NDK libc++_shared.so is always built against the oldest supported API
- # level. When tests are run against a device with a newer API level, test
- # programs can be built for any supported API level, but building for the
- # newest API (i.e. the system image's API) is probably the most interesting.
- PARAMS="target_triple=$(triple_of_arch ${ARCH})$(api_of_emu_img ${ANDROID_EMU_IMG})"
- generate-cmake-android -C "${MONOREPO_ROOT}/runtimes/cmake/android/Arch-${ARCH}.cmake" \
- -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AndroidNDK.cmake" \
- -DCMAKE_SYSROOT=/opt/android/ndk/sysroot \
- -DLIBCXX_TEST_PARAMS="${PARAMS}" \
- -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
- ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
-
- # Start the emulator and make sure we can connect to the adb server running
- # inside of it.
- "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/start-emulator.sh" ${ANDROID_EMU_IMG}
- trap "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/stop-emulator.sh" EXIT
- . "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/setup-env-for-emulator.sh"
-
- # Create adb_run early to avoid concurrent `mkdir -p` of common parent
- # directories.
- adb shell mkdir -p /data/local/tmp/adb_run
- adb push "${BUILD_DIR}/lib/libc++_shared.so" /data/local/tmp/libc++/libc++_shared.so
- echo "+++ Running the libc++ tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxx
- echo "+++ Running the libc++abi tests"
- ${NINJA} -vC "${BUILD_DIR}" check-cxxabi
-;;
#################################################################
# Insert vendor-specific internal configurations below.
#
@@ -763,7 +770,8 @@ android-ndk-*)
#################################################################
*)
- echo "${BUILDER} is not a known configuration"
- exit 1
+ # echo "${BUILDER} is not a known configuration"
+ # exit 1
+ echo "Skipping non-OHOS jobs for now (during setup OHOS builder)"
;;
esac
More information about the libcxx-commits
mailing list