[libcxx-commits] [libcxxabi] 228b3b7 - [libc++][AIX] Add scripts and config for building with the libcxx CI infrastructure
David Tenty via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Oct 14 11:31:15 PDT 2021
Author: David Tenty
Date: 2021-10-14T14:31:10-04:00
New Revision: 228b3b729d903ab539774385effbf215a45619ba
URL: https://github.com/llvm/llvm-project/commit/228b3b729d903ab539774385effbf215a45619ba
DIFF: https://github.com/llvm/llvm-project/commit/228b3b729d903ab539774385effbf215a45619ba.diff
LOG: [libc++][AIX] Add scripts and config for building with the libcxx CI infrastructure
This initial change adds the AIX configuration to run-buildbot, an AIX
CMake cache file, and appropriate compiler and linker flags for testing
AIX to the lit "from scratch" configuration files. Either of the 32-bit or 64-bit configurations
can be built by setting `OBJECT_MODE` in the build environment (as is
typical for AIX).
Reviewed By: ldionne, #libc, #libc_abi
Differential Revision: https://reviews.llvm.org/D111244
Added:
libcxx/cmake/caches/AIX.cmake
libcxx/test/configs/ibm-libc++-shared.cfg.in
libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
Modified:
libcxx/utils/ci/run-buildbot
Removed:
################################################################################
diff --git a/libcxx/cmake/caches/AIX.cmake b/libcxx/cmake/caches/AIX.cmake
new file mode 100644
index 0000000000000..029b8deae3d76
--- /dev/null
+++ b/libcxx/cmake/caches/AIX.cmake
@@ -0,0 +1,16 @@
+set(CMAKE_BUILD_TYPE Release CACHE STRING "")
+set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
+set(CMAKE_C_FLAGS "-D__LIBC_NO_CPP_MATH_OVERLOADS__" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-D__LIBC_NO_CPP_MATH_OVERLOADS__" CACHE STRING "")
+set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-G -Wl,-bcdtors:all:-2147483548:s" CACHE STRING "")
+
+set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBCXX_ENABLE_ASSERTIONS OFF CACHE BOOL "")
+set(LIBCXX_ABI_VERSION "1" CACHE STRING "")
+set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
+set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "")
+set(LIBCXX_ENABLE_STATIC OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_SHARED ON CACHE BOOL "")
+set(LIBCXXABI_ENABLE_STATIC OFF CACHE BOOL "")
+set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
diff --git a/libcxx/test/configs/ibm-libc++-shared.cfg.in b/libcxx/test/configs/ibm-libc++-shared.cfg.in
new file mode 100644
index 0000000000000..620990d029b0b
--- /dev/null
+++ b/libcxx/test/configs/ibm-libc++-shared.cfg.in
@@ -0,0 +1,28 @@
+# This testing configuration handles running the test suite against libc++ on
+# AIX using a shared library.
+#
+
+import sys
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}', ''))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -D__LIBC_NO_CPP_MATH_OVERLOADS__ -isystem %{install}/include/c++/v1 -I %{libcxx}/test/support'
+))
+config.substitutions.append(('%{link_flags}',
+ '-nostdlib++ -L %{install}/lib -lc++ -lc++abi -latomic -Wl,-bbigtoc'
+))
+config.substitutions.append(('%{exec}',
+ '{} %{{libcxx}}/utils/run.py --execdir %T --env LIBPATH=%{{install}}/lib -- '.format(sys.executable)
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
+import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
+libcxx.test.newconfig.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 0976145b93398..79b72eeb3bf87 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -113,6 +113,13 @@ function generate-cmake-libcxx-win() {
"${@}"
}
+function generate-cmake-aix() {
+ generate-cmake-base \
+ -S "${MONOREPO_ROOT}/llvm" \
+ -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
+ "${@}"
+}
+
function check-runtimes() {
echo "--- Installing libc++, libc++abi and libunwind to a fake location"
${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind
@@ -564,6 +571,17 @@ windows-static)
echo "+++ Running the libc++ tests"
${NINJA} -vC "${BUILD_DIR}" check-cxx
;;
+aix)
+ export CC=ibm-clang
+ export CXX=ibm-clang++_r
+ clean
+ generate-cmake-aix -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"
+ # TODO: use check-runtimes once libunwind builds cleanly on AIX.
+ ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
+ ${NINJA} -vC "${BUILD_DIR}" check-cxx check-cxxabi
+;;
#################################################################
# Insert vendor-specific internal configurations below.
#
diff --git a/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in b/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
new file mode 100644
index 0000000000000..feb5e7b3e9dce
--- /dev/null
+++ b/libcxxabi/test/configs/ibm-libc++abi-shared.cfg.in
@@ -0,0 +1,29 @@
+# Testing configuration for libc++abi on AIX.
+
+import sys
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',''))
+config.substitutions.append(('%{compile_flags}',
+ '-nostdinc++ -isystem %{install}/include/c++/v1 ' +
+ '-D__LIBC_NO_CPP_MATH_OVERLOADS__ -DLIBCXXABI_NO_TIMER ' +
+ '-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS ' +
+ '-I %{libcxx}/test/support -I %{libcxx}/src'
+))
+config.substitutions.append(('%{link_flags}',
+ '-nostdlib++ -L %{install}/lib -lc++ -lc++abi -Wl,-bbigtoc'
+))
+config.substitutions.append(('%{exec}',
+ '{} %{{libcxx}}/utils/run.py --execdir %T --env LIBPATH=%{{install}}/lib -- '.format(sys.executable)
+))
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
+libcxx.test.newconfig.configure(
+ libcxx.test.params.DEFAULT_PARAMETERS,
+ libcxx.test.features.DEFAULT_FEATURES,
+ config,
+ lit_config
+)
More information about the libcxx-commits
mailing list