summaryrefslogtreecommitdiffstats
path: root/build/build-clang/revert-r362047-and-r362065.patch
blob: c522c9ae027617ac9d90a8d4c7c75dd548964525 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Bisection found that r362047 (and its followup build fix r362065) cause the
build to install the android PGO library into the following location:
stage2/clang/lib/linux/libclang_rt.profile-arm-android.a
rather than the expected:
stage2/clang/lib64/clang/$VERSION/lib/linux/libclang_rt.profile-arm-android.a

For lack of any progress in debugging this, revert those two patches.

--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -60,12 +60,11 @@
   project(Runtimes C CXX ASM)
 
-  find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-
   # Add the root project's CMake modules, and the LLVM build's modules to the
   # CMake module path.
   list(INSERT CMAKE_MODULE_PATH 0
     "${CMAKE_CURRENT_SOURCE_DIR}/../cmake"
     "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules"
+    "${LLVM_LIBRARY_DIR}/cmake/llvm"
   )
 
   # Some of the runtimes will conditionally use the compiler-rt sanitizers
@@ -80,6 +79,11 @@
     endif()
   endif()
 
+  # LLVMConfig.cmake contains a bunch of CMake variables from the LLVM build.
+  # This file is installed as part of LLVM distributions, so this can be used
+  # either from a build directory or an installed LLVM.
+  include(LLVMConfig)
+
   # Setting these variables will allow the sub-build to put their outputs into
   # the library and bin directories of the top-level build.
   set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})
@@ -89,9 +93,6 @@
   set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR})
   set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)
 
-  # This variable is used by individual runtimes to locate LLVM files.
-  set(LLVM_PATH ${LLVM_BUILD_MAIN_SRC_DIR})
-
   if(APPLE)
     set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "")
   endif()
@@ -381,4 +382,6 @@
                              CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
                                         -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
+                                        -DLLVM_BINARY_DIR=${LLVM_BINARY_DIR}
+                                        -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
                                         -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_TRIPLE}
                                         -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
@@ -470,6 +473,8 @@
                              # Builtins were built separately above
                              CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
                                         -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
+                                        -DLLVM_BINARY_DIR=${LLVM_BINARY_DIR}
+                                        -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
                                         -DLLVM_DEFAULT_TARGET_TRIPLE=${target}
                                         -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
                                         -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON