summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch
blob: db46e2ffbab8a0d8ebb71c5b83392fc39f8684f4 (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
From 60d418bdd291f061e32a73ffee7ad7acc27a4768 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 27 Aug 2017 10:37:49 -0700
Subject: [PATCH] libcxxabi: Find libunwind headers when
 LIBCXXABI_LIBUNWIND_INCLUDES is set

Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments
then it ends up not searching the specified dir and unwind.h is not found
especially for ARM targets

This patch makes the searching synthesized directories and then set
LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 libcxxabi/CMakeLists.txt | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 8f48d402bc22..c2470267d8e3 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -483,7 +483,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
     "Specify path to libunwind source." FORCE)
 
 if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
-  find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
+  find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
     PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
           ${LIBCXXABI_LIBUNWIND_PATH}/include
           ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
@@ -494,15 +494,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
     NO_CMAKE_FIND_ROOT_PATH
   )
 
-  if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
-    set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
+  if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
+    set(LIBCXXABI_LIBUNWIND_INCLUDES "")
   endif()
 
-  if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "")
-    include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
+  if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "")
+    include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
   endif()
 endif()
 
+set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
+    "Specify path to libunwind includes." FORCE)
+set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
+    "Specify path to libunwind source." FORCE)
+
+
 # Add source code. This also contains all of the logic for deciding linker flags
 # soname, etc...
 add_subdirectory(include)