Skip to content

Commit

Permalink
Revert the removal of LLVM_ENABLE_PROJECTS for libc++ and libc++abi
Browse files Browse the repository at this point in the history
This commit reverts the following commits:

- 952f90b
- e6a0800 (D132298)
- 176db3b (D132324)

These commits caused CI instability and need to be reverted in order
to figure things out again. See the discussion in https://llvm.org/D132324
for more information.
  • Loading branch information
ldionne committed Aug 23, 2022
1 parent 7e24354 commit 342e0eb
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 25 deletions.
7 changes: 7 additions & 0 deletions clang/lib/Driver/ToolChains/Linux.cpp
Expand Up @@ -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);
}
Expand Down
Expand Up @@ -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 \
Expand Down
14 changes: 14 additions & 0 deletions libcxx/utils/ci/buildkite-pipeline.yml
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion libcxx/utils/ci/oss-fuzz.sh
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions libcxx/utils/ci/run-buildbot
Expand Up @@ -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"
Expand Down
11 changes: 2 additions & 9 deletions libcxxabi/CMakeLists.txt
Expand Up @@ -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)
Expand Down
10 changes: 3 additions & 7 deletions libcxxabi/test/CMakeLists.txt
Expand Up @@ -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!")
Expand Down
7 changes: 2 additions & 5 deletions llvm/CMakeLists.txt
Expand Up @@ -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()

Expand Down

0 comments on commit 342e0eb

Please sign in to comment.