diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index 29f385f31564..cf5cdbcd86f3 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -308,6 +308,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths); + // The deprecated -DLLVM_ENABLE_PROJECTS=libcxx configuration installs + // libc++.so in D.Dir+"/../lib/". Detect this path. + // TODO Remove once LLVM_ENABLE_PROJECTS=libcxx is unsupported. + if (StringRef(D.Dir).startswith(SysRoot) && + D.getVFS().exists(D.Dir + "/../lib/libc++.so")) + addPathIfExists(D, D.Dir + "/../lib", Paths); + addPathIfExists(D, concat(SysRoot, "/lib"), Paths); addPathIfExists(D, concat(SysRoot, "/usr/lib"), Paths); } diff --git a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh index a0a9ac312e22..52c45d48de15 100755 --- a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh +++ b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh @@ -100,12 +100,12 @@ if [[ ! -d ${LIBCXX_BUILD} ]]; then mkdir -p ${LIBCXX_BUILD} cd ${LIBCXX_BUILD} LIBCXX_FLAGS="${FLAGS} -Wno-macro-redefined" - RUNTIMES= + PROJECTS= if [[ ! -d $LLVM_SRC/projects/libcxxabi ]] ; then - RUNTIMES="-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi'" + PROJECTS="-DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi'" fi cmake -GNinja \ - ${RUNTIMES} \ + ${PROJECTS} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml index bf9db29ce7f5..8e804552f359 100644 --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -321,6 +321,20 @@ steps: limit: 2 timeout_in_minutes: 120 + - label: "Legacy LLVM_ENABLE_PROJECTS build" + command: "libcxx/utils/ci/run-buildbot legacy-project-build" + artifact_paths: + - "**/test-results.xml" + - "**/*.abilist" + agents: + queue: "libcxx-builders" + os: "linux" + retry: + automatic: + - exit_status: -1 # Agent was lost + limit: 2 + timeout_in_minutes: 120 + # Tests with various build configurations. - label: "Static libraries" command: "libcxx/utils/ci/run-buildbot generic-static" diff --git a/libcxx/utils/ci/oss-fuzz.sh b/libcxx/utils/ci/oss-fuzz.sh index 123ac47fc449..12149de87ce5 100755 --- a/libcxx/utils/ci/oss-fuzz.sh +++ b/libcxx/utils/ci/oss-fuzz.sh @@ -13,7 +13,7 @@ INSTALL=cxx_install_dir mkdir ${BUILD} cmake -S ${PWD} -B ${BUILD} \ - -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ + -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL}" cmake --build ${BUILD} --target install-cxx-headers diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index 220082c1209c..27431f3c2cac 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -510,6 +510,21 @@ legacy-test-config) -DLIBUNWIND_TEST_CONFIG="${MONOREPO_ROOT}/libunwind/test/lit.site.cfg.in" check-runtimes ;; +legacy-project-build) + clean + + echo "--- Generating CMake" + ${CMAKE} \ + -S "${MONOREPO_ROOT}/llvm" \ + -B "${BUILD_DIR}" \ + -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \ + -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml --timeout=1500" \ + -DLIBCXX_CXX_ABI=libcxxabi + check-runtimes +;; aarch64) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 9064afbe890f..b8326d08d23a 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -131,17 +131,10 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC) message(FATAL_ERROR "libc++abi must be built as either a shared or static library.") endif() +# TODO: Remove this, which shouldn't be necessary since we know we're being built +# side-by-side with libc++. set(LIBCXXABI_LIBCXX_INCLUDES "" CACHE PATH "Specify path to libc++ includes.") -if (NOT libcxx IN_LIST LLVM_ENABLE_RUNTIMES) - if (NOT IS_DIRECTORY ${LIBCXXABI_LIBCXX_INCLUDES}) - message(FATAL_ERROR - "LIBCXXABI_LIBCXX_INCLUDES=${LIBCXXABI_LIBCXX_INCLUDES} is not a valid directory. " - "Please provide the path to where the libc++ headers have been installed.") - endif() - add_library(cxx-headers INTERFACE) - target_include_directories(cxx-headers INTERFACE "${LIBCXXABI_LIBCXX_INCLUDES}") -endif() set(LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT OFF) if (WIN32) diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt index 0b82943c5a63..0a4541b9443c 100644 --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -61,13 +61,9 @@ if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY) list(APPEND LIBCXXABI_TEST_DEPS cxx_external_threads) endif() -if(libcxx IN_LIST LLVM_ENABLE_RUNTIMES) - list(APPEND LIBCXXABI_TEST_DEPS cxx) -endif() -if(libunwind IN_LIST LLVM_ENABLE_RUNTIMES) - if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind) - list(APPEND LIBCXXABI_TEST_DEPS unwind) - endif() +list(APPEND LIBCXXABI_TEST_DEPS cxx) +if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind) + list(APPEND LIBCXXABI_TEST_DEPS unwind) endif() set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!") diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index c9cbf420fdc3..1c1a38d102a6 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -127,11 +127,8 @@ foreach(proj ${LLVM_ENABLE_PROJECTS}) endforeach() foreach(proj "libcxx" "libcxxabi" "libunwind") if (${proj} IN_LIST LLVM_ENABLE_PROJECTS) - # TODO(Ericson2314): Making non-fatal for now because of out-of-tree docs - # CI jobs use this. - message(SEND_ERROR - "Using LLVM_ENABLE_PROJECTS=${proj} is incorrect. Please use -DLLVM_ENABLE_RUNTIMES=${proj} or " - "see the instructions at https://libcxx.llvm.org/BuildingLibcxx.html for building the runtimes.") + message(WARNING "Using LLVM_ENABLE_PROJECTS=${proj} is deprecated now, please use -DLLVM_ENABLE_RUNTIMES=${proj} or " + "see the instructions at https://libcxx.llvm.org/BuildingLibcxx.html for building the runtimes.") endif() endforeach()