Revert "[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there"

This also reverts "[libc++] Remove temporary hack for D63883".
Clearly, I don't understand how the Linux build bots are configured.

Differential Revision: https://reviews.llvm.org/D63883

llvm-svn: 368238
This commit is contained in:
Louis Dionne 2019-08-08 00:28:06 +00:00
parent 155b8d02c3
commit 80ef2f05d8
2 changed files with 24 additions and 1 deletions

View File

@ -148,11 +148,34 @@ set(LIBCXX_CXX_ABI "default" CACHE STRING
set(CXXABIS none default libcxxabi libcxxrt libstdc++ libsupc++ vcruntime)
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
# FIXME: This is a temporary hack to get the buildbots working while D63883 is in flight.
# Without this all the bots fail while building libc++
if (DEFINED ENV{USER})
if (("$ENV{USER}" STREQUAL "buildbot") OR (("$ENV{USER}" STREQUAL "llvmbb") OR ("$ENV{USER}" STREQUAL "buildslave")))
if (LIBCXX_CXX_ABI STREQUAL "libcxxabi" AND NOT DEFINED LIBCXX_CXX_ABI_INCLUDE_PATHS)
message(WARNING "OVERRIDING BUILDBOT CONFIG")
set(LIBCXX_CXX_ABI "default" CACHE STRING "FIXME" FORCE)
endif()
endif()
endif()
# Setup the default options if LIBCXX_CXX_ABI is not specified.
if (LIBCXX_CXX_ABI STREQUAL "default")
find_path(
LIBCXX_LIBCXXABI_INCLUDES_INTERNAL cxxabi.h
PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
if (LIBCXX_TARGETING_MSVC)
# FIXME: Figure out how to configure the ABI library on Windows.
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_INTREE 1)
elseif (APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)

View File

@ -98,7 +98,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
"${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
)
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
if (TARGET cxxabi_shared AND TARGET cxxabi_static)
if (LIBCXX_CXX_ABI_INTREE)
# Link against just-built "cxxabi" target.
set(CXXABI_SHARED_LIBNAME cxxabi_shared)
set(CXXABI_STATIC_LIBNAME cxxabi_static)