summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-05-19 23:35:43 -0700
committerKhem Raj <raj.khem@gmail.com>2016-05-20 00:15:15 -0700
commit7364ca41b93841437667c84bb66c15fcb39763d9 (patch)
tree5f0f6ae79156109f66d817b53a14d7bbc252b5f5 /recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch
parented0cc9804381763e6c0baebcb2a5793645531a83 (diff)
downloadmeta-clang-7364ca41b93841437667c84bb66c15fcb39763d9.tar.gz
clang: Switch to master (3.9) branch
Drop upstreamed patches Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch')
-rw-r--r--recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch b/recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch
new file mode 100644
index 0000000..ffbe537
--- /dev/null
+++ b/recipes-devtools/clang/compiler-rt/0003-Simplify-cross-compilation.-Don-t-use-native-compile.patch
@@ -0,0 +1,67 @@
1From f8617c08ad6e38ccb4623a777cd8c9601af6e2ec Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 May 2016 23:11:45 -0700
4Subject: [PATCH 3/3] Simplify cross-compilation. Don't use native-compiled
5 llvm-config.
6
7 Note: AddLLVM.cmake does not expose the LLVM source directory.
8 So if you want to run the test suite, you need to either:
9
10 1) set LLVM_MAIN_SRC_DIR explicitly (to find lit.py)
11 2) change AddLLVM.cmake to point to an installed 'lit'.
12 3) add_subdirectory(compiler-rt/test) from clang instead of compiler-rt.
13
14https://us.codeaurora.org/patches/quic/llvm/50683/compiler-rt-cross-compilation.patch
15
16Signed-off-by: Greg Fitzgerald <gregf@codeaurora.org>
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 CMakeLists.txt | 32 ++++++--------------------------
20 1 file changed, 6 insertions(+), 26 deletions(-)
21
22diff --git a/CMakeLists.txt b/CMakeLists.txt
23index d8794b5..d5477cf 100644
24--- a/CMakeLists.txt
25+++ b/CMakeLists.txt
26@@ -60,32 +60,12 @@ option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON)
27 mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS)
28
29 if (COMPILER_RT_STANDALONE_BUILD)
30- if (NOT LLVM_CONFIG_PATH)
31- find_program(LLVM_CONFIG_PATH "llvm-config"
32- DOC "Path to llvm-config binary")
33- if (NOT LLVM_CONFIG_PATH)
34- message(FATAL_ERROR "llvm-config not found: specify LLVM_CONFIG_PATH")
35- endif()
36- endif()
37- execute_process(
38- COMMAND ${LLVM_CONFIG_PATH} "--obj-root" "--bindir" "--libdir" "--src-root"
39- RESULT_VARIABLE HAD_ERROR
40- OUTPUT_VARIABLE CONFIG_OUTPUT)
41- if (HAD_ERROR)
42- message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
43- endif()
44- string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT})
45- list(GET CONFIG_OUTPUT 0 LLVM_BINARY_DIR)
46- list(GET CONFIG_OUTPUT 1 LLVM_TOOLS_BINARY_DIR)
47- list(GET CONFIG_OUTPUT 2 LLVM_LIBRARY_DIR)
48- list(GET CONFIG_OUTPUT 3 LLVM_MAIN_SRC_DIR)
49-
50- # Make use of LLVM CMake modules.
51- file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE)
52- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
53- list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
54- # Get some LLVM variables from LLVMConfig.
55- include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
56+ find_package(LLVM REQUIRED)
57+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
58+
59+ # Variables that AddLLVM.cmake depends on (included by AddCompilerRT)
60+ set(LLVM_TOOLS_BINARY_DIR "${LLVM_INSTALL_PREFIX}/bin")
61+ set(LLVM_LIBRARY_DIR "${LLVM_INSTALL_PREFIX}/lib")
62
63 set(LLVM_LIBRARY_OUTPUT_INTDIR
64 ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
65--
662.8.2
67