Skip to content

Commit d81465f

Browse files
committed
compiler-rt: Simplify cross-compilation. Don't use native-compiled llvm-config.
Note: AddLLVM.cmake does not expose the LLVM source directory. So if you want to run the test suite, you need to either: 1) set LLVM_MAIN_SRC_DIR explicitly (to find lit.py) 2) change AddLLVM.cmake to point to an installed 'lit'. 3) add_subdirectory(compiler-rt/test) from clang instead of compiler-rt. https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation.patch Upstream-Status: Pending Signed-off-by: Greg Fitzgerald <gregf@codeaurora.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent 1f44d77 commit d81465f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

compiler-rt/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,16 @@ if (COMPILER_RT_STANDALONE_BUILD)
107107
set(CMAKE_CXX_EXTENSIONS NO)
108108

109109
if (NOT LLVM_RUNTIMES_BUILD)
110-
load_llvm_config()
110+
find_package(LLVM REQUIRED)
111+
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
112+
113+
# Variables that AddLLVM.cmake depends on (included by AddCompilerRT)
114+
set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin")
115+
set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib")
116+
117+
set(LLVM_LIBRARY_OUTPUT_INTDIR
118+
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
119+
111120
endif()
112121
if (TARGET intrinsics_gen)
113122
# Loading the llvm config causes this target to be imported so place it

0 commit comments

Comments
 (0)