summaryrefslogtreecommitdiff
path: root/runtimes
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2021-03-02 16:59:32 -0800
committerPetr Hosek <phosek@google.com>2021-03-02 16:59:32 -0800
commitb3ac90da1df490fb8ca5280f9dfb40d26f5a9c40 (patch)
tree3f84d7474cc9c4bb85fe8ac7db7f4d0302d090ea /runtimes
parent1d1983f2d0a04f2516881aae258d7264624a609e (diff)
downloadllvm-b3ac90da1df490fb8ca5280f9dfb40d26f5a9c40.tar.gz
Revert "[runtimes] Use standalone build only for compiler-rt"
This reverts commit 4e421b2323b38e94e82ac71e5a4dfd78f6744e87 as this seemed to have broke Python 3 executable detection on some builders.
Diffstat (limited to 'runtimes')
-rw-r--r--runtimes/CMakeLists.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 6c031d1656fe..a1017d91f36a 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -82,6 +82,10 @@ include(CheckCCompilerFlag)
# these flags.
if (NOT MSVC)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdinc++ -nostdlib++")
+
+ if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR AND "libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -isystem ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}/include")
+ endif()
endif()
# Avoid checking whether the compiler is working.
@@ -92,6 +96,9 @@ include(AddLLVM)
include(HandleLLVMOptions)
include(FindPythonInterp)
+# Remove the -nostdlib++ option we've added earlier.
+string(REPLACE "-nostdlib++" "" CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+
# Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
if(CMAKE_HOST_APPLE AND APPLE)
include(UseLibtool)
@@ -107,11 +114,12 @@ foreach(entry ${runtimes})
string(REPLACE "-" "_" canon_name ${projName})
string(TOUPPER ${canon_name} canon_name)
- # TODO: compiler-rt has to use standalone build for now. We tried to remove
- # this in D57992 but this broke the build because compiler-rt assumes that
- # LLVM and Clang are configured in the same build to set up dependencies. We
- # should clean up the compiler-rt build and remove this eventually.
- if ("${canon_name}" STREQUAL "COMPILER_RT")
+ # The subdirectories need to treat this as standalone builds. D57992 tried
+ # to get rid of this, but the runtimes treat *_STANDALONE_BUILD=OFF as if
+ # llvm & clang are configured in the same CMake, and setup dependencies
+ # against their targets. OpenMP has fixed the issue so we don't set the
+ # variable.
+ if (NOT ${canon_name} STREQUAL "OPENMP")
set(${canon_name}_STANDALONE_BUILD ON)
endif()