Skip to content

Commit e0eed65

Browse files
committedAug 7, 2019
[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there
Summary: Otherwise, when libcxxabi is not an enabled project in the monorepo, we get a link error because we try to link against non-existent cxxabi_shared. More generally, we shouldn't change the behavior of the build based on implicit things like whether a file happens to be at a specific path or not. This is a re-application of r365222 that had been reverted in r365233 and then r365359 because it broke the build bots. The build bots should now specify explicitly what ABI library they want to use (libc++abi), so this commit should now be OK to merge. It takes a while for build bots to pick up configuration changes, which is why this failed the last time around. Differential Revision: https://reviews.llvm.org/D63883 llvm-svn: 368213
1 parent 1b1f1d6 commit e0eed65

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed
 

‎libcxx/CMakeLists.txt

-13
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,9 @@ if (DEFINED ENV{USER})
160160
endif()
161161
# Setup the default options if LIBCXX_CXX_ABI is not specified.
162162
if (LIBCXX_CXX_ABI STREQUAL "default")
163-
find_path(
164-
LIBCXX_LIBCXXABI_INCLUDES_INTERNAL cxxabi.h
165-
PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include
166-
${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
167-
${LLVM_MAIN_SRC_DIR}/../libcxxabi/include
168-
NO_DEFAULT_PATH
169-
NO_CMAKE_FIND_ROOT_PATH
170-
)
171163
if (LIBCXX_TARGETING_MSVC)
172164
# FIXME: Figure out how to configure the ABI library on Windows.
173165
set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
174-
elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
175-
IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
176-
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
177-
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
178-
set(LIBCXX_CXX_ABI_INTREE 1)
179166
elseif (APPLE)
180167
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
181168
set(LIBCXX_CXX_ABI_SYSTEM 1)

‎libcxx/cmake/Modules/HandleLibCXXABI.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
9898
"${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
9999
)
100100
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
101-
if (LIBCXX_CXX_ABI_INTREE)
101+
if (TARGET cxxabi_shared AND TARGET cxxabi_static)
102102
# Link against just-built "cxxabi" target.
103103
set(CXXABI_SHARED_LIBNAME cxxabi_shared)
104104
set(CXXABI_STATIC_LIBNAME cxxabi_static)

0 commit comments

Comments
 (0)
Please sign in to comment.