diff options
-rw-r--r-- | recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch | 68 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 | ||||
-rw-r--r-- | recipes-devtools/clang/libcxx_git.bb | 5 |
3 files changed, 72 insertions, 2 deletions
diff --git a/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch new file mode 100644 index 0000000..ed0e9ef --- /dev/null +++ b/recipes-devtools/clang/clang/0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From ad79d6051f2c4299b7b286d5a60e2aa1b9a92898 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 27 Aug 2017 10:37:49 -0700 | ||
4 | Subject: [PATCH] libcxxabi: Find libunwind headers when | ||
5 | LIBCXXABI_LIBUNWIND_INCLUDES is set | ||
6 | |||
7 | Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments | ||
8 | then it ends up not searching the specified dir and unwind.h is not found | ||
9 | especially for ARM targets | ||
10 | |||
11 | This patch makes the searching synthesized directories and then set | ||
12 | LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment | ||
13 | |||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | CMakeLists.txt | 21 +++++++++++---------- | ||
17 | 1 file changed, 11 insertions(+), 10 deletions(-) | ||
18 | |||
19 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
20 | index 4db3328..29cba1a 100644 | ||
21 | --- a/CMakeLists.txt | ||
22 | +++ b/CMakeLists.txt | ||
23 | @@ -402,15 +402,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") | ||
24 | # Setup Source Code | ||
25 | #=============================================================================== | ||
26 | |||
27 | -set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH | ||
28 | - "Specify path to libunwind includes." FORCE) | ||
29 | -set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH | ||
30 | - "Specify path to libunwind source." FORCE) | ||
31 | - | ||
32 | include_directories(include) | ||
33 | if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) | ||
34 | find_path( | ||
35 | - LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL | ||
36 | + LIBCXXABI_LIBUNWIND_INCLUDES | ||
37 | libunwind.h | ||
38 | PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} | ||
39 | ${LIBCXXABI_LIBUNWIND_PATH}/include | ||
40 | @@ -420,15 +415,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) | ||
41 | NO_DEFAULT_PATH | ||
42 | ) | ||
43 | |||
44 | - if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND") | ||
45 | - set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "") | ||
46 | + if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND") | ||
47 | + set(LIBCXXABI_LIBUNWIND_INCLUDES "") | ||
48 | endif() | ||
49 | |||
50 | - if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "") | ||
51 | - include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") | ||
52 | + if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "") | ||
53 | + include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") | ||
54 | endif() | ||
55 | endif() | ||
56 | |||
57 | +set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH | ||
58 | + "Specify path to libunwind includes." FORCE) | ||
59 | +set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH | ||
60 | + "Specify path to libunwind source." FORCE) | ||
61 | + | ||
62 | + | ||
63 | # Add source code. This also contains all of the logic for deciding linker flags | ||
64 | # soname, etc... | ||
65 | add_subdirectory(src) | ||
66 | -- | ||
67 | 2.14.1 | ||
68 | |||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 93463b7..194f554 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -24,6 +24,7 @@ CLANGPATCHES += "${@'file://0007-clang-Enable-SSP-and-PIE-by-default.patch;patch | |||
24 | 24 | ||
25 | # libcxxabi patches | 25 | # libcxxabi patches |
26 | LIBCXXABIPATCHES ="\ | 26 | LIBCXXABIPATCHES ="\ |
27 | file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch;patchdir=projects/libcxxabi \ | ||
27 | " | 28 | " |
28 | 29 | ||
29 | # libc++ patches | 30 | # libc++ patches |
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 2ab7951..117562f 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb | |||
@@ -41,14 +41,15 @@ EXTRA_OECMAKE += "\ | |||
41 | -DLIBCXX_CXX_ABI=libcxxabi \ | 41 | -DLIBCXX_CXX_ABI=libcxxabi \ |
42 | -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ | 42 | -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ |
43 | -DCXX_SUPPORTS_CXX11=ON \ | 43 | -DCXX_SUPPORTS_CXX11=ON \ |
44 | -DLIBCXXABI_LIBUNWIND_INCLUDES=${S}/projects/libunwind/include \ | ||
44 | -DLIBCXXABI_LIBCXX_INCLUDES=${S}/projects/libcxx/include \ | 45 | -DLIBCXXABI_LIBCXX_INCLUDES=${S}/projects/libcxx/include \ |
45 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/projects/libcxxabi/include \ | 46 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/projects/libcxxabi/include \ |
46 | -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib \ | 47 | -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib \ |
47 | -DLIBCXXABI_USE_LLVM_UNWINDER=1 \ | 48 | -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ |
48 | -G Ninja \ | 49 | -G Ninja \ |
49 | ${S} \ | 50 | ${S} \ |
50 | " | 51 | " |
51 | EXTRA_OECMAKE_remove_mipsarch = "-DLIBCXXABI_USE_LLVM_UNWINDER=1" | 52 | EXTRA_OECMAKE_remove_mipsarch = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" |
52 | 53 | ||
53 | EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " | 54 | EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=ON " |
54 | 55 | ||