summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-05-22 18:38:27 -0700
committerKhem Raj <raj.khem@gmail.com>2017-05-22 18:38:27 -0700
commitc1dbc0aa3bc9cc9e51fa00d9cd07b8ab5acf3ce9 (patch)
tree02e8837f3d9b892ad387da255cef77b5a86d52d2
parent2baa00b8a919a1c29c891b900a48239856d01438 (diff)
downloadmeta-clang-c1dbc0aa3bc9cc9e51fa00d9cd07b8ab5acf3ce9.tar.gz
clang/llvm: Move to upcoming 5.0.0 ( trunk ) release
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-devtools/clang/clang.inc20
-rw-r--r--recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch22
-rw-r--r--recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch (renamed from recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch)27
-rw-r--r--recipes-devtools/clang/clang/0001-libcxxabi-Fix-arm-EHABI-code-to-work.-armhf-had-exce.patch148
-rw-r--r--recipes-devtools/clang/clang/0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch34
-rw-r--r--recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch (renamed from recipes-devtools/clang/clang/0003-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch)22
-rw-r--r--recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch18
-rw-r--r--recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch26
-rw-r--r--recipes-devtools/clang/clang/0002-llvm-Do-not-assume-linux-glibc.patch28
-rw-r--r--recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch10
-rw-r--r--recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch (renamed from recipes-devtools/clang/clang/0004-llvm-allow-env-override-of-exe-path.patch)11
-rw-r--r--recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch18
-rw-r--r--recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch31
-rw-r--r--recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch27
-rw-r--r--recipes-devtools/clang/clang_git.bb28
-rw-r--r--recipes-devtools/clang/common.inc34
-rw-r--r--recipes-devtools/clang/compiler-rt/0001-support-a-new-embedded-linux-target.patch12
-rw-r--r--recipes-devtools/clang/compiler-rt/0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch12
-rw-r--r--recipes-devtools/clang/compiler-rt/0003-Disable-tsan-on-OE-glibc.patch12
-rw-r--r--recipes-devtools/clang/compiler-rt/0004-cmake-mips-Do-not-specify-target-with-OE.patch8
-rw-r--r--recipes-devtools/clang/compiler-rt_git.bb11
-rw-r--r--recipes-devtools/clang/libcxx_git.bb27
-rw-r--r--recipes-devtools/clang/libcxxabi/0001-Do-not-use-LIBCXXABI_ARM_EHABI.patch30
-rw-r--r--recipes-devtools/clang/libcxxabi_git.bb17
-rw-r--r--recipes-devtools/clang/lld_git.bb12
-rw-r--r--recipes-devtools/clang/lldb/0001-Include-limits.h-for-PATH_MAX-definition.patch33
-rw-r--r--recipes-devtools/clang/lldb/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch42
-rw-r--r--recipes-devtools/clang/lldb_git.bb47
-rw-r--r--recipes-devtools/clang/llvm-libunwind_git.bb29
29 files changed, 492 insertions, 304 deletions
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc
index b8bf28f..ebef3ef 100644
--- a/recipes-devtools/clang/clang.inc
+++ b/recipes-devtools/clang/clang.inc
@@ -7,19 +7,19 @@ LLVM_GIT_PROTOCOL ?= "git"
7# 7#
8# Uncomment below to enable master version of clang/llvm 8# Uncomment below to enable master version of clang/llvm
9# 9#
10MAJOR_VER="4" 10MAJOR_VER="5"
11MINOR_VER="0" 11MINOR_VER="0"
12PATCH_VER="0" 12PATCH_VER="0"
13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" 13PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}"
14BRANCH = "release_40" 14BRANCH = "master"
15SRCREV_llvm = "5ed13a6cd922be74ad12b1ba36c15906336e0e3b" 15SRCREV_llvm = "ddfddd8ea50eb54b6d3a87c2668c23dce6b6f5ae"
16SRCREV_clang = "21fe7e8f8ab44b67238af7bf9ba9d8afdf0c0e2c" 16SRCREV_clang = "f35b1d4090ccbfc38d1758d22eb359bd492ed7a7"
17SRCREV_compiler-rt = "76ab2e5c9b2a2e3d638e217cc21622f9be54f633" 17SRCREV_compiler-rt = "06f1c090cb4e27ea82320bfa7af1e3cfb681edeb"
18SRCREV_cxxabi = "c4e6c8a10dea6f569fa99d56945ec1eba4be40dd" 18SRCREV_cxxabi = "c515867bc14c433febcc574baedd081c078124d1"
19SRCREV_libcxx = "2a0436688e5f1cf233b5cef9d9d0a4dc6acf8a97" 19SRCREV_libcxx = "64182a5877865cde2538c6038f98e3df33c93a03"
20SRCREV_libunwind = "e1a24d4951a60ea51a7bd2505d6cc16c0bcb2c61" 20SRCREV_libunwind = "86219d8c6a73f95e694b4e1594e1a8a0a33613b6"
21SRCREV_lld = "ada5756959e1356d1911702872ba625b8ee67210" 21SRCREV_lld = "2658112fcdc127036cbef4d54c0e72ab2fd12de2"
22SRCREV_lldb = "fcd2aac9f179b968a20cf0231c3386dcef8a6659" 22SRCREV_lldb = "cf6c5b3386fa5b0667f1abe53bff8a6d4193afad"
23 23
24LLVMMD5SUM = "e825e017edc35cfd58e26116e5251771" 24LLVMMD5SUM = "e825e017edc35cfd58e26116e5251771"
25CLANGMD5SUM = "a77eac638a3aae44a2d604217d6f0f01" 25CLANGMD5SUM = "a77eac638a3aae44a2d604217d6f0f01"
diff --git a/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch b/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch
index ab4d6e7..06f3b9e 100644
--- a/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch
+++ b/recipes-devtools/clang/clang/0001-clang-driver-Use-lib-for-ldso-on-OE.patch
@@ -1,7 +1,7 @@
1From 68661f7960e6f5ebc95f16f08d7e1a66e9ae9a23 Mon Sep 17 00:00:00 2001 1From 40c82edf60ec3ee7f62b9029856f9eee8a81ae2e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 May 2016 21:52:36 -0700 3Date: Sat, 21 May 2016 21:52:36 -0700
4Subject: [PATCH 1/3] clang: driver: Use /lib for ldso on OE 4Subject: [PATCH 1/6] clang: driver: Use /lib for ldso on OE
5 5
6OE does not follow the default base_libdir 6OE does not follow the default base_libdir
7that clang has, therefore adjust it for OE 7that clang has, therefore adjust it for OE
@@ -11,14 +11,14 @@ for 64bit to /lib64 instead of /lib
11 11
12Signed-off-by: Khem Raj <raj.khem@gmail.com> 12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13--- 13---
14 lib/Driver/ToolChains.cpp | 8 ++++---- 14 lib/Driver/ToolChains/Linux.cpp | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-) 15 1 file changed, 4 insertions(+), 4 deletions(-)
16 16
17diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp 17diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
18index 968b0cb..214169f 100644 18index 50443a1252..4865ec99da 100644
19--- a/lib/Driver/ToolChains.cpp 19--- a/lib/Driver/ToolChains/Linux.cpp
20+++ b/lib/Driver/ToolChains.cpp 20+++ b/lib/Driver/ToolChains/Linux.cpp
21@@ -4389,12 +4389,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 21@@ -540,12 +540,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
22 Loader = "ld.so.1"; 22 Loader = "ld.so.1";
23 break; 23 break;
24 case llvm::Triple::ppc64: 24 case llvm::Triple::ppc64:
@@ -33,7 +33,7 @@ index 968b0cb..214169f 100644
33 Loader = 33 Loader =
34 (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2"; 34 (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
35 break; 35 break;
36@@ -4404,7 +4404,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 36@@ -555,7 +555,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
37 Loader = "ld-linux.so.2"; 37 Loader = "ld-linux.so.2";
38 break; 38 break;
39 case llvm::Triple::sparcv9: 39 case llvm::Triple::sparcv9:
@@ -42,7 +42,7 @@ index 968b0cb..214169f 100644
42 Loader = "ld-linux.so.2"; 42 Loader = "ld-linux.so.2";
43 break; 43 break;
44 case llvm::Triple::systemz: 44 case llvm::Triple::systemz:
45@@ -4418,7 +4418,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 45@@ -569,7 +569,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
46 case llvm::Triple::x86_64: { 46 case llvm::Triple::x86_64: {
47 bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32; 47 bool X32 = Triple.getEnvironment() == llvm::Triple::GNUX32;
48 48
@@ -52,5 +52,5 @@ index 968b0cb..214169f 100644
52 break; 52 break;
53 } 53 }
54-- 54--
552.10.2 552.13.0
56 56
diff --git a/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch b/recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch
index be9cf0b..43387a3 100644
--- a/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch
+++ b/recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch
@@ -1,7 +1,7 @@
1From 7d56f7fc304a4acf69c44b4c6f4ffb5e2af1fc0c Mon Sep 17 00:00:00 2001 1From 7eef5975d0c68e8b34505a334061610efe50df3b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 May 2016 23:22:52 -0700 3Date: Thu, 19 May 2016 23:22:52 -0700
4Subject: [PATCH] use constexpr when using glibc 4Subject: [PATCH] libcxx: use constexpr when using glibc
5 5
6POSIX does not permit using PTHREAD_COND_INITIALIZER except for static 6POSIX does not permit using PTHREAD_COND_INITIALIZER except for static
7initialization, and certainly does not permit using it as a value 7initialization, and certainly does not permit using it as a value
@@ -12,17 +12,17 @@ code is invalid
12 12
13Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14--- 14---
15 include/__mutex_base | 10 ++++++++-- 15 include/__mutex_base | 13 ++++++++++++-
16 1 file changed, 8 insertions(+), 2 deletions(-) 16 1 file changed, 12 insertions(+), 1 deletion(-)
17 17
18diff --git a/include/__mutex_base b/include/__mutex_base 18Index: libcxx/include/__mutex_base
19index 59458ec..0a12e62 100644 19===================================================================
20--- a/include/__mutex_base 20--- libcxx.orig/include/__mutex_base
21+++ b/include/__mutex_base 21+++ libcxx/include/__mutex_base
22@@ -43,7 +43,10 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mut 22@@ -44,7 +44,10 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SA
23 public: 23 public:
24 _LIBCPP_INLINE_VISIBILITY 24 _LIBCPP_INLINE_VISIBILITY
25 #ifndef _LIBCPP_HAS_NO_CONSTEXPR 25 #ifndef _LIBCPP_CXX03_LANG
26- constexpr mutex() _NOEXCEPT = default; 26- constexpr mutex() _NOEXCEPT = default;
27+#ifdef __GLIBC__ 27+#ifdef __GLIBC__
28+ constexpr 28+ constexpr
@@ -31,10 +31,10 @@ index 59458ec..0a12e62 100644
31 #else 31 #else
32 mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;} 32 mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;}
33 #endif 33 #endif
34@@ -300,7 +303,10 @@ class _LIBCPP_TYPE_VIS condition_variable 34@@ -289,7 +292,10 @@ class _LIBCPP_TYPE_VIS condition_variabl
35 public: 35 public:
36 _LIBCPP_INLINE_VISIBILITY 36 _LIBCPP_INLINE_VISIBILITY
37 #ifndef _LIBCPP_HAS_NO_CONSTEXPR 37 #ifndef _LIBCPP_CXX03_LANG
38- constexpr condition_variable() _NOEXCEPT = default; 38- constexpr condition_variable() _NOEXCEPT = default;
39+#ifdef __GLIBC__ 39+#ifdef __GLIBC__
40+ constexpr 40+ constexpr
@@ -43,6 +43,3 @@ index 59458ec..0a12e62 100644
43 #else 43 #else
44 condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;} 44 condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;}
45 #endif 45 #endif
46--
472.10.2
48
diff --git a/recipes-devtools/clang/clang/0001-libcxxabi-Fix-arm-EHABI-code-to-work.-armhf-had-exce.patch b/recipes-devtools/clang/clang/0001-libcxxabi-Fix-arm-EHABI-code-to-work.-armhf-had-exce.patch
new file mode 100644
index 0000000..c2dbe1f
--- /dev/null
+++ b/recipes-devtools/clang/clang/0001-libcxxabi-Fix-arm-EHABI-code-to-work.-armhf-had-exce.patch
@@ -0,0 +1,148 @@
1From 6f53040b8810cc2ed5c03cea79e536bbbd032a9e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 21 May 2017 19:18:02 -0700
4Subject: [PATCH] libcxxabi: Fix arm EHABI code to work. armhf had exception
5 test failing without EHABI support
6
7No known upstream bug about this. Actual code change is more like workaround than
8something that upstream would accept. Proper fix would be adding _Unwind_Control_Block
9to clang unwind.h. _Unwind_Control_Block should also extend _Unwind_Exception to make
10sure their ABI stays in sync.
11
12No known upstream bug about this.
13
14Adapted from Debian
15
16http://sources.debian.net/src/libc%2B%2B/3.9.1-2/debian/patches/libcxxabi-arm-ehabi-fix.patch/
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 src/cxa_exception.cpp | 23 ++++++++++++++---------
21 src/cxa_exception.hpp | 39 +++++++++++++++++++++++++++++++++++++++
22 2 files changed, 53 insertions(+), 9 deletions(-)
23
24diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp
25index 0794444..ef78b7e 100644
26--- a/src/cxa_exception.cpp
27+++ b/src/cxa_exception.cpp
28@@ -219,15 +219,16 @@ __cxa_throw(void *thrown_object, std::type_info *tinfo, void (*dest)(void *)) {
29 exception_header->unwindHeader.exception_cleanup = exception_cleanup_func;
30 #ifdef __USING_SJLJ_EXCEPTIONS__
31 _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
32-#else
33+#elif !defined(_LIBCXXABI_ARM_EHABI)
34 _Unwind_RaiseException(&exception_header->unwindHeader);
35+#else
36+ _Unwind_RaiseException(exception_header->unwindHeader);
37 #endif
38 // This only happens when there is no handler, or some unexpected unwinding
39 // error happens.
40 failed_throw(exception_header);
41 }
42
43-
44 // 2.5.3 Exception Handlers
45 /*
46 The adjusted pointer is computed by the personality routine during phase 1
47@@ -388,11 +389,7 @@ __cxa_begin_catch(void* unwind_arg) throw()
48 globals->caughtExceptions = exception_header;
49 }
50 globals->uncaughtExceptions -= 1; // Not atomically, since globals are thread-local
51-#if defined(_LIBCXXABI_ARM_EHABI)
52- return reinterpret_cast<void*>(exception_header->unwindHeader.barrier_cache.bitpattern[0]);
53-#else
54- return exception_header->adjustedPtr;
55-#endif
56+ return __cxa_get_exception_ptr((void*)&exception_header->unwindHeader);
57 }
58 // Else this is a foreign exception
59 // If the caughtExceptions stack is not empty, terminate
60@@ -490,7 +487,11 @@ void __cxa_end_catch() {
61 // to touch a foreign exception in any way, that is undefined
62 // behavior. They likely can't since the only way to catch
63 // a foreign exception is with catch (...)!
64+#if !defined(_LIBCXXABI_ARM_EHABI)
65 _Unwind_DeleteException(&globals->caughtExceptions->unwindHeader);
66+#else
67+ _Unwind_DeleteException(globals->caughtExceptions->unwindHeader);
68+#endif
69 globals->caughtExceptions = 0;
70 }
71 }
72@@ -547,8 +548,10 @@ void __cxa_rethrow() {
73 }
74 #ifdef __USING_SJLJ_EXCEPTIONS__
75 _Unwind_SjLj_RaiseException(&exception_header->unwindHeader);
76-#else
77+#elif !defined(_LIBCXXABI_ARM_EHABI)
78 _Unwind_RaiseException(&exception_header->unwindHeader);
79+#else
80+ _Unwind_RaiseException(exception_header->unwindHeader);
81 #endif
82
83 // If we get here, some kind of unwinding error has occurred.
84@@ -672,8 +675,10 @@ __cxa_rethrow_primary_exception(void* thrown_object)
85 dep_exception_header->unwindHeader.exception_cleanup = dependent_exception_cleanup;
86 #ifdef __USING_SJLJ_EXCEPTIONS__
87 _Unwind_SjLj_RaiseException(&dep_exception_header->unwindHeader);
88+#elif !defined(_LIBCXXABI_ARM_EHABI)
89+ _Unwind_RaiseException(&dep_exception_header->unwindHeader);
90 #else
91- _Unwind_RaiseException(&dep_exception_header->unwindHeader);
92+ _Unwind_RaiseException(dep_exception_header->unwindHeader);
93 #endif
94 // Some sort of unwinding error. Note that terminate is a handler.
95 __cxa_begin_catch(&dep_exception_header->unwindHeader);
96diff --git a/src/cxa_exception.hpp b/src/cxa_exception.hpp
97index b9f74e3..fd8a266 100644
98--- a/src/cxa_exception.hpp
99+++ b/src/cxa_exception.hpp
100@@ -24,6 +24,45 @@ static const uint64_t kOurExceptionClass = 0x434C4E47432B2B00; // CLNGC
101 static const uint64_t kOurDependentExceptionClass = 0x434C4E47432B2B01; // CLNGC++\1
102 static const uint64_t get_vendor_and_language = 0xFFFFFFFFFFFFFF00; // mask for CLNGC++
103
104+#if defined(_LIBCXXABI_ARM_EHABI)
105+// GCC has _Unwind_Control_Block in unwind.h (unwind_arm_common.h)
106+#if defined(__clang__)
107+struct _Unwind_Control_Block
108+{
109+ uint64_t exception_class;
110+ void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
111+ struct {
112+ _Unwind_Word reserved1;
113+ _Unwind_Word reserved2;
114+ _Unwind_Word reserved3;
115+ _Unwind_Word reserved4;
116+ _Unwind_Word reserved5;
117+ } unwinder_cache;
118+ struct {
119+ _Unwind_Word sp;
120+ _Unwind_Word bitpattern[5];
121+ } barrier_cache;
122+ struct {
123+ _Unwind_Word bitpattern[4];
124+ } cleanup_cache;
125+ struct {
126+ _Unwind_Word fnstart;
127+ _Unwind_Word *ehtp;
128+ _Unwind_Word additional;
129+ _Unwind_Word reserved1;
130+ } pr_cache;
131+ long long int :0;
132+ operator _Unwind_Exception*() noexcept
133+ {
134+ return reinterpret_cast<_Unwind_Exception*>(this);
135+ }
136+};
137+
138+#endif
139+
140+#define _Unwind_Exception _Unwind_Control_Block
141+#endif
142+
143 struct _LIBCXXABI_HIDDEN __cxa_exception {
144 #if defined(__LP64__) || defined(_LIBCXXABI_ARM_EHABI)
145 // This is a new field to support C++ 0x exception_ptr.
146--
1472.13.0
148
diff --git a/recipes-devtools/clang/clang/0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch b/recipes-devtools/clang/clang/0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch
deleted file mode 100644
index ba2f20d..0000000
--- a/recipes-devtools/clang/clang/0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From f7c00426faede13d8ba7e8cbfbe31368dcba97d4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 15 May 2015 12:13:17 -0700
4Subject: [PATCH 1/3] llvm: Remove CMAKE_CROSSCOMPILING so it can cross compile
5
6we already have llvm-config from clang-native
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 tools/llvm-config/CMakeLists.txt | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
14index 744fa4e..6713523 100644
15--- a/tools/llvm-config/CMakeLists.txt
16+++ b/tools/llvm-config/CMakeLists.txt
17@@ -61,7 +61,7 @@ add_definitions(-DCMAKE_CFG_INTDIR="${CMAKE_CFG_INTDIR}")
18 # Add the dependency on the generation step.
19 add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
20
21-if(CMAKE_CROSSCOMPILING)
22+if(CMAKE_CROSSCOMPILING1)
23 set(${project}_LLVM_CONFIG_EXE "${LLVM_NATIVE_BUILD}/bin/llvm-config")
24 set(${project}_LLVM_CONFIG_EXE ${${project}_LLVM_CONFIG_EXE} PARENT_SCOPE)
25
26@@ -74,4 +74,4 @@ if(CMAKE_CROSSCOMPILING)
27 add_dependencies(${project}NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
28
29 add_dependencies(llvm-config ${project}NativeLLVMConfig)
30-endif(CMAKE_CROSSCOMPILING)
31+endif(CMAKE_CROSSCOMPILING1)
32--
332.10.0
34
diff --git a/recipes-devtools/clang/clang/0003-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
index 0e09e66..fff2179 100644
--- a/recipes-devtools/clang/clang/0003-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
+++ b/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
@@ -1,7 +1,7 @@
1From 594e0c73c9c37b3016a558914bf3024dc78746ac Mon Sep 17 00:00:00 2001 1From f5c30ecd374aae4bef7a13084c8254894748e7f5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 21 May 2016 00:33:20 +0000 3Date: Sat, 21 May 2016 00:33:20 +0000
4Subject: [PATCH 3/3] llvm: TargetLibraryInfo: Undefine libc functions if they 4Subject: [PATCH 1/3] llvm: TargetLibraryInfo: Undefine libc functions if they
5 are macros 5 are macros
6 6
7musl defines some functions as macros and not inline functions 7musl defines some functions as macros and not inline functions
@@ -13,10 +13,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 1 file changed, 21 insertions(+) 13 1 file changed, 21 insertions(+)
14 14
15diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def 15diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def
16index 5d5e5b1..af4d901 100644 16index 9cbe917c146..aff8419cf54 100644
17--- a/include/llvm/Analysis/TargetLibraryInfo.def 17--- a/include/llvm/Analysis/TargetLibraryInfo.def
18+++ b/include/llvm/Analysis/TargetLibraryInfo.def 18+++ b/include/llvm/Analysis/TargetLibraryInfo.def
19@@ -531,6 +531,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") 19@@ -656,6 +656,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl")
20 TLI_DEFINE_ENUM_INTERNAL(fopen) 20 TLI_DEFINE_ENUM_INTERNAL(fopen)
21 TLI_DEFINE_STRING_INTERNAL("fopen") 21 TLI_DEFINE_STRING_INTERNAL("fopen")
22 /// FILE *fopen64(const char *filename, const char *opentype) 22 /// FILE *fopen64(const char *filename, const char *opentype)
@@ -26,7 +26,7 @@ index 5d5e5b1..af4d901 100644
26 TLI_DEFINE_ENUM_INTERNAL(fopen64) 26 TLI_DEFINE_ENUM_INTERNAL(fopen64)
27 TLI_DEFINE_STRING_INTERNAL("fopen64") 27 TLI_DEFINE_STRING_INTERNAL("fopen64")
28 /// int fprintf(FILE *stream, const char *format, ...); 28 /// int fprintf(FILE *stream, const char *format, ...);
29@@ -566,6 +569,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") 29@@ -691,6 +694,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek")
30 /// int fseeko(FILE *stream, off_t offset, int whence); 30 /// int fseeko(FILE *stream, off_t offset, int whence);
31 TLI_DEFINE_ENUM_INTERNAL(fseeko) 31 TLI_DEFINE_ENUM_INTERNAL(fseeko)
32 TLI_DEFINE_STRING_INTERNAL("fseeko") 32 TLI_DEFINE_STRING_INTERNAL("fseeko")
@@ -36,7 +36,7 @@ index 5d5e5b1..af4d901 100644
36 /// int fseeko64(FILE *stream, off64_t offset, int whence) 36 /// int fseeko64(FILE *stream, off64_t offset, int whence)
37 TLI_DEFINE_ENUM_INTERNAL(fseeko64) 37 TLI_DEFINE_ENUM_INTERNAL(fseeko64)
38 TLI_DEFINE_STRING_INTERNAL("fseeko64") 38 TLI_DEFINE_STRING_INTERNAL("fseeko64")
39@@ -576,6 +582,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") 39@@ -701,6 +707,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos")
40 TLI_DEFINE_ENUM_INTERNAL(fstat) 40 TLI_DEFINE_ENUM_INTERNAL(fstat)
41 TLI_DEFINE_STRING_INTERNAL("fstat") 41 TLI_DEFINE_STRING_INTERNAL("fstat")
42 /// int fstat64(int filedes, struct stat64 *buf) 42 /// int fstat64(int filedes, struct stat64 *buf)
@@ -46,7 +46,7 @@ index 5d5e5b1..af4d901 100644
46 TLI_DEFINE_ENUM_INTERNAL(fstat64) 46 TLI_DEFINE_ENUM_INTERNAL(fstat64)
47 TLI_DEFINE_STRING_INTERNAL("fstat64") 47 TLI_DEFINE_STRING_INTERNAL("fstat64")
48 /// int fstatvfs(int fildes, struct statvfs *buf); 48 /// int fstatvfs(int fildes, struct statvfs *buf);
49@@ -591,6 +600,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") 49@@ -716,6 +725,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell")
50 TLI_DEFINE_ENUM_INTERNAL(ftello) 50 TLI_DEFINE_ENUM_INTERNAL(ftello)
51 TLI_DEFINE_STRING_INTERNAL("ftello") 51 TLI_DEFINE_STRING_INTERNAL("ftello")
52 /// off64_t ftello64(FILE *stream) 52 /// off64_t ftello64(FILE *stream)
@@ -56,7 +56,7 @@ index 5d5e5b1..af4d901 100644
56 TLI_DEFINE_ENUM_INTERNAL(ftello64) 56 TLI_DEFINE_ENUM_INTERNAL(ftello64)
57 TLI_DEFINE_STRING_INTERNAL("ftello64") 57 TLI_DEFINE_STRING_INTERNAL("ftello64")
58 /// int ftrylockfile(FILE *file); 58 /// int ftrylockfile(FILE *file);
59@@ -711,6 +723,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") 59@@ -836,6 +848,9 @@ TLI_DEFINE_STRING_INTERNAL("logl")
60 TLI_DEFINE_ENUM_INTERNAL(lstat) 60 TLI_DEFINE_ENUM_INTERNAL(lstat)
61 TLI_DEFINE_STRING_INTERNAL("lstat") 61 TLI_DEFINE_STRING_INTERNAL("lstat")
62 /// int lstat64(const char *path, struct stat64 *buf); 62 /// int lstat64(const char *path, struct stat64 *buf);
@@ -66,7 +66,7 @@ index 5d5e5b1..af4d901 100644
66 TLI_DEFINE_ENUM_INTERNAL(lstat64) 66 TLI_DEFINE_ENUM_INTERNAL(lstat64)
67 TLI_DEFINE_STRING_INTERNAL("lstat64") 67 TLI_DEFINE_STRING_INTERNAL("lstat64")
68 /// void *malloc(size_t size); 68 /// void *malloc(size_t size);
69@@ -930,6 +945,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") 69@@ -1055,6 +1070,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf")
70 TLI_DEFINE_ENUM_INTERNAL(stat) 70 TLI_DEFINE_ENUM_INTERNAL(stat)
71 TLI_DEFINE_STRING_INTERNAL("stat") 71 TLI_DEFINE_STRING_INTERNAL("stat")
72 /// int stat64(const char *path, struct stat64 *buf); 72 /// int stat64(const char *path, struct stat64 *buf);
@@ -76,7 +76,7 @@ index 5d5e5b1..af4d901 100644
76 TLI_DEFINE_ENUM_INTERNAL(stat64) 76 TLI_DEFINE_ENUM_INTERNAL(stat64)
77 TLI_DEFINE_STRING_INTERNAL("stat64") 77 TLI_DEFINE_STRING_INTERNAL("stat64")
78 /// int statvfs(const char *path, struct statvfs *buf); 78 /// int statvfs(const char *path, struct statvfs *buf);
79@@ -1059,6 +1077,9 @@ TLI_DEFINE_STRING_INTERNAL("times") 79@@ -1184,6 +1202,9 @@ TLI_DEFINE_STRING_INTERNAL("times")
80 TLI_DEFINE_ENUM_INTERNAL(tmpfile) 80 TLI_DEFINE_ENUM_INTERNAL(tmpfile)
81 TLI_DEFINE_STRING_INTERNAL("tmpfile") 81 TLI_DEFINE_STRING_INTERNAL("tmpfile")
82 /// FILE *tmpfile64(void) 82 /// FILE *tmpfile64(void)
@@ -87,5 +87,5 @@ index 5d5e5b1..af4d901 100644
87 TLI_DEFINE_STRING_INTERNAL("tmpfile64") 87 TLI_DEFINE_STRING_INTERNAL("tmpfile64")
88 /// int toascii(int c); 88 /// int toascii(int c);
89-- 89--
902.10.0 902.13.0
91 91
diff --git a/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch b/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch
index 4b52cb5..8792a51 100644
--- a/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch
+++ b/recipes-devtools/clang/clang/0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch
@@ -1,7 +1,7 @@
1From 89b429136b2850025919b6f2f5c616a0f22d0daf Mon Sep 17 00:00:00 2001 1From 94d3e80a88c58043bd22d7aafbfcb0579c8356e7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 May 2016 21:11:06 -0700 3Date: Thu, 19 May 2016 21:11:06 -0700
4Subject: [PATCH 2/3] clang: Driver/tools.cpp: Add -lssp and -lssp_nonshared on 4Subject: [PATCH 2/6] clang: Driver/tools.cpp: Add -lssp and -lssp_nonshared on
5 musl 5 musl
6 6
7musl driver will need to add ssp libraries to linker cmdline 7musl driver will need to add ssp libraries to linker cmdline
@@ -9,14 +9,14 @@ when using stack protector commands on compiler cmdline
9 9
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- 11---
12 lib/Driver/Tools.cpp | 7 +++++++ 12 lib/Driver/ToolChains/Gnu.cpp | 7 +++++++
13 1 file changed, 7 insertions(+) 13 1 file changed, 7 insertions(+)
14 14
15diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp 15diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
16index 3b20805..740205b 100644 16index f1015e62ee..1843150b45 100644
17--- a/lib/Driver/Tools.cpp 17--- a/lib/Driver/ToolChains/Gnu.cpp
18+++ b/lib/Driver/Tools.cpp 18+++ b/lib/Driver/ToolChains/Gnu.cpp
19@@ -10192,6 +10192,13 @@ void gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 19@@ -609,6 +609,13 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
20 if (IsIAMCU) 20 if (IsIAMCU)
21 CmdArgs.push_back("-lgloss"); 21 CmdArgs.push_back("-lgloss");
22 22
@@ -31,5 +31,5 @@ index 3b20805..740205b 100644
31 CmdArgs.push_back("--end-group"); 31 CmdArgs.push_back("--end-group");
32 else 32 else
33-- 33--
342.10.2 342.13.0
35 35
diff --git a/recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch b/recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch
new file mode 100644
index 0000000..a4cc474
--- /dev/null
+++ b/recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch
@@ -0,0 +1,26 @@
1From c838ab629c64a98e194520f10b391f174fbccc96 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 9 May 2017 15:16:45 -0700
4Subject: [PATCH 2/3] llvm: Differentiate between glibc and linux
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 lib/Support/Unix/DynamicLibrary.inc | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
12index a0526fa2c1b..aca85c62e54 100644
13--- a/lib/Support/Unix/DynamicLibrary.inc
14+++ b/lib/Support/Unix/DynamicLibrary.inc
15@@ -104,7 +104,7 @@ static void *DoSearch(const char* SymbolName) {
16 // On linux we have a weird situation. The stderr/out/in symbols are both
17 // macros and global variables because of standards requirements. So, we
18 // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
19-#if defined(__linux__) and !defined(__ANDROID__)
20+#if defined(__linux__) and !defined(__ANDROID__) and defined(__GLIBC__)
21 {
22 EXPLICIT_SYMBOL(stderr);
23 EXPLICIT_SYMBOL(stdout);
24--
252.13.0
26
diff --git a/recipes-devtools/clang/clang/0002-llvm-Do-not-assume-linux-glibc.patch b/recipes-devtools/clang/clang/0002-llvm-Do-not-assume-linux-glibc.patch
deleted file mode 100644
index ffa30ac..0000000
--- a/recipes-devtools/clang/clang/0002-llvm-Do-not-assume-linux-glibc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 17624af2fddd212cc76a5d3c645c4eed3bc897fe Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 15 Mar 2016 05:26:47 +0000
4Subject: [PATCH 2/3] llvm: Do not assume linux == glibc
5
6musl's implementation of std functions is different
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 lib/Support/DynamicLibrary.cpp | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
14index 9a7aeb5..e3b7fe2 100644
15--- a/lib/Support/DynamicLibrary.cpp
16+++ b/lib/Support/DynamicLibrary.cpp
17@@ -143,7 +143,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
18 // On linux we have a weird situation. The stderr/out/in symbols are both
19 // macros and global variables because of standards requirements. So, we
20 // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
21-#if defined(__linux__) and !defined(__ANDROID__)
22+#if defined(__linux__) and defined(__GLIBC__)
23 {
24 EXPLICIT_SYMBOL(stderr);
25 EXPLICIT_SYMBOL(stdout);
26--
272.10.0
28
diff --git a/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch
index 7da26b9..3c52b40 100644
--- a/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch
+++ b/recipes-devtools/clang/clang/0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch
@@ -1,7 +1,7 @@
1From fe28e9e2bbe2e95460768dd256f20360b2ea9515 Mon Sep 17 00:00:00 2001 1From b6c1b462d2b08726a4dbce717012e3c52f447906 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 10 May 2016 02:00:11 -0700 3Date: Tue, 10 May 2016 02:00:11 -0700
4Subject: [PATCH 3/3] clang: musl/ppc does not support 128-bit long double 4Subject: [PATCH 3/6] clang: musl/ppc does not support 128-bit long double
5 5
6Signed-off-by: Khem Raj <raj.khem@gmail.com> 6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7--- 7---
@@ -9,10 +9,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
9 1 file changed, 2 insertions(+), 1 deletion(-) 9 1 file changed, 2 insertions(+), 1 deletion(-)
10 10
11diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp 11diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
12index 91eabb3..775348c 100644 12index 1b9fbed177..d0a2ca6997 100644
13--- a/lib/Basic/Targets.cpp 13--- a/lib/Basic/Targets.cpp
14+++ b/lib/Basic/Targets.cpp 14+++ b/lib/Basic/Targets.cpp
15@@ -1648,7 +1648,8 @@ public: 15@@ -1693,7 +1693,8 @@ public:
16 break; 16 break;
17 } 17 }
18 18
@@ -23,5 +23,5 @@ index 91eabb3..775348c 100644
23 LongDoubleFormat = &llvm::APFloat::IEEEdouble(); 23 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
24 } 24 }
25-- 25--
262.10.2 262.13.0
27 27
diff --git a/recipes-devtools/clang/clang/0004-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch
index 739d188..8e9ac23 100644
--- a/recipes-devtools/clang/clang/0004-llvm-allow-env-override-of-exe-path.patch
+++ b/recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch
@@ -1,7 +1,7 @@
1From 60eb14f995e0359aef4ef144338d932cbf9c4531 Mon Sep 17 00:00:00 2001 1From 31fd46a8b262b67c143b10c72c01d7289468fc8f Mon Sep 17 00:00:00 2001
2From: Martin Kelly <mkelly@xevo.com> 2From: Martin Kelly <mkelly@xevo.com>
3Date: Wed, 15 Mar 2017 10:50:25 -0700 3Date: Fri, 19 May 2017 00:22:57 -0700
4Subject: [PATCH] allow env override of exe path 4Subject: [PATCH 3/3] llvm: allow env override of exe path
5 5
6When using a native llvm-config from inside a sysroot, we need llvm-config to 6When using a native llvm-config from inside a sysroot, we need llvm-config to
7return the libraries, include directories, etc. from inside the sysroot rather 7return the libraries, include directories, etc. from inside the sysroot rather
@@ -9,12 +9,13 @@ than from the native sysroot. Thus provide an env override for calling
9llvm-config from a target sysroot. 9llvm-config from a target sysroot.
10 10
11Signed-off-by: Martin Kelly <mkelly@xevo.com> 11Signed-off-by: Martin Kelly <mkelly@xevo.com>
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 13---
13 tools/llvm-config/llvm-config.cpp | 7 +++++++ 14 tools/llvm-config/llvm-config.cpp | 7 +++++++
14 1 file changed, 7 insertions(+) 15 1 file changed, 7 insertions(+)
15 16
16diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp 17diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
17index 25344e4..26724c1 100644 18index 25344e4cd01..26724c1b825 100644
18--- a/tools/llvm-config/llvm-config.cpp 19--- a/tools/llvm-config/llvm-config.cpp
19+++ b/tools/llvm-config/llvm-config.cpp 20+++ b/tools/llvm-config/llvm-config.cpp
20@@ -225,6 +225,13 @@ Typical components:\n\ 21@@ -225,6 +225,13 @@ Typical components:\n\
@@ -32,5 +33,5 @@ index 25344e4..26724c1 100644
32 // allow taking the address of ::main however. 33 // allow taking the address of ::main however.
33 void *P = (void *)(intptr_t)GetExecutablePath; 34 void *P = (void *)(intptr_t)GetExecutablePath;
34-- 35--
352.1.4 362.13.0
36 37
diff --git a/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch
index fbab45e..50ce4d0 100644
--- a/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch
+++ b/recipes-devtools/clang/clang/0004-clang-Prepend-trailing-to-sysroot.patch
@@ -1,7 +1,7 @@
1From b261f7a113462c8f91e729e4dd090b93ea7528e1 Mon Sep 17 00:00:00 2001 1From 3257464995af44e5baafa1d1dd80b79b6260754d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Mar 2017 09:02:13 -0700 3Date: Thu, 16 Mar 2017 09:02:13 -0700
4Subject: [PATCH 4/4] clang: Prepend trailing '/' to sysroot 4Subject: [PATCH 4/6] clang: Prepend trailing '/' to sysroot
5 5
6This is needed to handle a case where clang 6This is needed to handle a case where clang
7isntall and target sysroot are perilously same 7isntall and target sysroot are perilously same
@@ -20,14 +20,14 @@ installation and not sysroot
20 20
21Signed-off-by: Khem Raj <raj.khem@gmail.com> 21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22--- 22---
23 lib/Driver/ToolChains.cpp | 2 +- 23 lib/Driver/ToolChains/Linux.cpp | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-) 24 1 file changed, 1 insertion(+), 1 deletion(-)
25 25
26diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp 26diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
27index 9d2e343536..2f3aa0680f 100644 27index 4865ec99da..719525ad7d 100644
28--- a/lib/Driver/ToolChains.cpp 28--- a/lib/Driver/ToolChains/Linux.cpp
29+++ b/lib/Driver/ToolChains.cpp 29+++ b/lib/Driver/ToolChains/Linux.cpp
30@@ -4095,7 +4095,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 30@@ -193,7 +193,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
31 GCCInstallation.init(Triple, Args); 31 GCCInstallation.init(Triple, Args);
32 Multilibs = GCCInstallation.getMultilibs(); 32 Multilibs = GCCInstallation.getMultilibs();
33 llvm::Triple::ArchType Arch = Triple.getArch(); 33 llvm::Triple::ArchType Arch = Triple.getArch();
@@ -37,5 +37,5 @@ index 9d2e343536..2f3aa0680f 100644
37 // Cross-compiling binutils and GCC installations (vanilla and openSUSE at 37 // Cross-compiling binutils and GCC installations (vanilla and openSUSE at
38 // least) put various tools in a triple-prefixed directory off of the parent 38 // least) put various tools in a triple-prefixed directory off of the parent
39-- 39--
402.12.0 402.13.0
41 41
diff --git a/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
index a887588..14db1e6 100644
--- a/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
+++ b/recipes-devtools/clang/clang/0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch
@@ -1,7 +1,7 @@
1From 63b01a5bf84c836a42b792cdee5ac6322296ae0b Mon Sep 17 00:00:00 2001 1From b47912e2304c1e3d3bca7e973037b859739aea15 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Mar 2017 17:06:45 -0700 3Date: Thu, 16 Mar 2017 19:06:26 -0700
4Subject: [PATCH 5/5] clang: Look inside the target sysroot for compiler 4Subject: [PATCH 5/6] clang: Look inside the target sysroot for compiler
5 runtime 5 runtime
6 6
7In OE compiler-rt and libc++ are built and staged into target 7In OE compiler-rt and libc++ are built and staged into target
@@ -12,22 +12,22 @@ Specific to cross compiling the way yocto/OE works
12 12
13Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14--- 14---
15 lib/Driver/ToolChain.cpp | 4 +++- 15 lib/Driver/ToolChain.cpp | 6 +++++-
16 1 file changed, 3 insertions(+), 1 deletion(-) 16 1 file changed, 5 insertions(+), 1 deletion(-)
17 17
18Index: clang/lib/Driver/ToolChain.cpp 18diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
19=================================================================== 19index 4f82503276..507e051afc 100644
20--- clang.orig/lib/Driver/ToolChain.cpp 20--- a/lib/Driver/ToolChain.cpp
21+++ clang/lib/Driver/ToolChain.cpp 21+++ b/lib/Driver/ToolChain.cpp
22@@ -10,6 +10,7 @@ 22@@ -12,6 +12,7 @@
23 #include "clang/Driver/ToolChain.h" 23 #include "ToolChains/Arch/ARM.h"
24 #include "Tools.h" 24 #include "ToolChains/Clang.h"
25 #include "clang/Basic/ObjCRuntime.h" 25 #include "clang/Basic/ObjCRuntime.h"
26+#include "clang/Basic/Version.h" 26+#include "clang/Basic/Version.h"
27 #include "clang/Basic/VirtualFileSystem.h"
27 #include "clang/Config/config.h" 28 #include "clang/Config/config.h"
28 #include "clang/Driver/Action.h" 29 #include "clang/Driver/Action.h"
29 #include "clang/Driver/Driver.h" 30@@ -320,7 +321,10 @@ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
30@@ -306,7 +307,10 @@ std::string ToolChain::getCompilerRT(con
31 const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so") 31 const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so")
32 : (IsITANMSVCWindows ? ".lib" : ".a"); 32 : (IsITANMSVCWindows ? ".lib" : ".a");
33 33
@@ -39,3 +39,6 @@ Index: clang/lib/Driver/ToolChain.cpp
39 StringRef OSLibName = Triple.isOSFreeBSD() ? "freebsd" : getOS(); 39 StringRef OSLibName = Triple.isOSFreeBSD() ? "freebsd" : getOS();
40 llvm::sys::path::append(Path, "lib", OSLibName); 40 llvm::sys::path::append(Path, "lib", OSLibName);
41 llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" + 41 llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" +
42--
432.13.0
44
diff --git a/recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch
new file mode 100644
index 0000000..473f610
--- /dev/null
+++ b/recipes-devtools/clang/clang/0006-clang-Define-releative-gcc-installation-dir.patch
@@ -0,0 +1,27 @@
1From b56c57ef523bed20dc9e9beb271667a85cf56478 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 21 May 2017 15:38:25 -0700
4Subject: [PATCH 6/6] clang: Define / releative gcc installation dir
5
6This is required for OE gcc installation to work.
7Without this its not able to find the paths for libgcc
8and other standard headers and libraries from gcc
9installation in OE
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 lib/Driver/ToolChains/Gnu.cpp | 1 +
14 1 file changed, 1 insertion(+)
15
16Index: clang/lib/Driver/ToolChains/Gnu.cpp
17===================================================================
18--- clang.orig/lib/Driver/ToolChains/Gnu.cpp
19+++ clang/lib/Driver/ToolChains/Gnu.cpp
20@@ -2101,6 +2101,7 @@ void Generic_GCC::GCCInstallationDetecto
21
22 // Debian puts cross-compilers in gcc-cross.
23 {"gcc-cross/" + CandidateTriple.str(), "../..", true},
24+ {"/" + CandidateTriple.str(), "..", true},
25
26 // The Freescale PPC SDK has the gcc libraries in
27 // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb
index 2942dff..01ad644 100644
--- a/recipes-devtools/clang/clang_git.bb
+++ b/recipes-devtools/clang/clang_git.bb
@@ -7,32 +7,19 @@ LICENSE = "NCSA"
7SECTION = "devel" 7SECTION = "devel"
8 8
9require clang.inc 9require clang.inc
10require common.inc
10 11
11PV .= "+git${SRCPV}" 12PV .= "+git${SRCPV}"
12 13
13LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=${LLVMMD5SUM}; \ 14LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=${LLVMMD5SUM}; \
14 file://tools/clang/LICENSE.TXT;md5=${CLANGMD5SUM}; \ 15 file://tools/clang/LICENSE.TXT;md5=${CLANGMD5SUM}; \
15 " 16 "
16SRC_URI = "${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \ 17SRC_URI = "\
17 ${LLVM_GIT}/clang.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/clang;name=clang \ 18 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \
18 " 19 ${LLVM_GIT}/clang.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/clang;name=clang \
19 20 ${LLVMPATCHES} \
20# llvm patches 21 ${CLANGPATCHES} \
21SRC_URI += "\ 22 "
22 file://0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch \
23 file://0002-llvm-Do-not-assume-linux-glibc.patch \
24 file://0003-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \
25 file://0004-llvm-allow-env-override-of-exe-path.patch \
26 "
27
28# Clang patches
29SRC_URI += "\
30 file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \
31 file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \
32 file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \
33 file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \
34 file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=tools/clang \
35 "
36 23
37SRCREV_FORMAT = "llvm_clang" 24SRCREV_FORMAT = "llvm_clang"
38 25
@@ -76,6 +63,7 @@ LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;Mips;PowerPC;X86"
76LLVM_TARGETS_TO_BUILD_append = ";${@get_clang_host_arch(bb, d)};${@get_clang_target_arch(bb, d)}" 63LLVM_TARGETS_TO_BUILD_append = ";${@get_clang_host_arch(bb, d)};${@get_clang_target_arch(bb, d)}"
77 64
78EXTRA_OECMAKE="-DLLVM_ENABLE_RTTI=True \ 65EXTRA_OECMAKE="-DLLVM_ENABLE_RTTI=True \
66 -DLLVM_ENABLE_EH=True \
79 -DLLVM_ENABLE_FFI=False \ 67 -DLLVM_ENABLE_FFI=False \
80 -DCMAKE_SYSTEM_NAME=Linux \ 68 -DCMAKE_SYSTEM_NAME=Linux \
81 -DCMAKE_BUILD_TYPE=Release \ 69 -DCMAKE_BUILD_TYPE=Release \
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc
new file mode 100644
index 0000000..847c290
--- /dev/null
+++ b/recipes-devtools/clang/common.inc
@@ -0,0 +1,34 @@
1FILESEXTRAPATHS =. "${FILE_DIRNAME}/clang:"
2
3# llvm patches
4#file://0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch \
5#
6LLVMPATCHES = "\
7 file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \
8 file://0002-llvm-Differentiate-between-glibc-and-linux.patch \
9 file://0003-llvm-allow-env-override-of-exe-path.patch \
10"
11
12# Clang patches
13CLANGPATCHES = "\
14 file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \
15 file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \
16 file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \
17 file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \
18 file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=tools/clang \
19 file://0006-clang-Define-releative-gcc-installation-dir.patch;patchdir=tools/clang \
20"
21
22# libcxxabi patches
23LIBCXXABIPATCHES ="\
24 file://0001-libcxxabi-Fix-arm-EHABI-code-to-work.-armhf-had-exce.patch;patchdir=projects/libcxxabi \
25"
26
27# libc++ patches
28LIBCXXPATCHES = "\
29"
30
31LIBCXXPATCHES_append_libc-musl = "\
32 file://0001-libcxx-use-constexpr-when-using-glibc.patch;patchdir=projects/libcxx \
33"
34
diff --git a/recipes-devtools/clang/compiler-rt/0001-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/compiler-rt/0001-support-a-new-embedded-linux-target.patch
index 111c556..45bd645 100644
--- a/recipes-devtools/clang/compiler-rt/0001-support-a-new-embedded-linux-target.patch
+++ b/recipes-devtools/clang/compiler-rt/0001-support-a-new-embedded-linux-target.patch
@@ -1,7 +1,7 @@
1From 2d08c5752ce9d3170798d12d46827e85a6e8ef42 Mon Sep 17 00:00:00 2001 1From 489a11bdd48c04983e5d042808b91c9f9844d403 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 19 Apr 2015 15:16:23 -0700 3Date: Sun, 19 Apr 2015 15:16:23 -0700
4Subject: [PATCH 1/3] support a new embedded linux target 4Subject: [PATCH 1/4] support a new embedded linux target
5 5
6Signed-off-by: Khem Raj <raj.khem@gmail.com> 6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7--- 7---
@@ -13,7 +13,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 create mode 100644 make/platform/clang_linux_embedded_test_input.c 13 create mode 100644 make/platform/clang_linux_embedded_test_input.c
14 14
15diff --git a/lib/builtins/int_util.c b/lib/builtins/int_util.c 15diff --git a/lib/builtins/int_util.c b/lib/builtins/int_util.c
16index 420d1e2..0e46141 100644 16index 420d1e237..0e4614100 100644
17--- a/lib/builtins/int_util.c 17--- a/lib/builtins/int_util.c
18+++ b/lib/builtins/int_util.c 18+++ b/lib/builtins/int_util.c
19@@ -48,8 +48,7 @@ void compilerrt_abort_impl(const char *file, int line, const char *function) { 19@@ -48,8 +48,7 @@ void compilerrt_abort_impl(const char *file, int line, const char *function) {
@@ -28,7 +28,7 @@ index 420d1e2..0e46141 100644
28 __attribute__((visibility("hidden"))) 28 __attribute__((visibility("hidden")))
29diff --git a/make/platform/clang_linux_embedded.mk b/make/platform/clang_linux_embedded.mk 29diff --git a/make/platform/clang_linux_embedded.mk b/make/platform/clang_linux_embedded.mk
30new file mode 100644 30new file mode 100644
31index 0000000..d0a8900 31index 000000000..d0a890075
32--- /dev/null 32--- /dev/null
33+++ b/make/platform/clang_linux_embedded.mk 33+++ b/make/platform/clang_linux_embedded.mk
34@@ -0,0 +1,286 @@ 34@@ -0,0 +1,286 @@
@@ -320,7 +320,7 @@ index 0000000..d0a8900
320+FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64) 320+FUNCTIONS.hard_pic.x86_64 := $(FUNCTIONS_X86_64)
321diff --git a/make/platform/clang_linux_embedded_test_input.c b/make/platform/clang_linux_embedded_test_input.c 321diff --git a/make/platform/clang_linux_embedded_test_input.c b/make/platform/clang_linux_embedded_test_input.c
322new file mode 100644 322new file mode 100644
323index 0000000..e69de29 323index 000000000..e69de29bb
324-- 324--
3252.10.0 3252.13.0
326 326
diff --git a/recipes-devtools/clang/compiler-rt/0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch b/recipes-devtools/clang/compiler-rt/0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch
index dbf3ea5..1a63a9b 100644
--- a/recipes-devtools/clang/compiler-rt/0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch
+++ b/recipes-devtools/clang/compiler-rt/0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch
@@ -1,7 +1,7 @@
1From dc8fde5074321b80d23419127d28ce90ac984c96 Mon Sep 17 00:00:00 2001 1From 521311b98ffb4e912a6d863f134856d365eb9d36 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 19 May 2016 23:11:45 -0700 3Date: Thu, 19 May 2016 23:11:45 -0700
4Subject: [PATCH 2/3] Simplify cross-compilation. Don't use native-compiled 4Subject: [PATCH 2/4] Simplify cross-compilation. Don't use native-compiled
5 llvm-config. 5 llvm-config.
6 6
7 Note: AddLLVM.cmake does not expose the LLVM source directory. 7 Note: AddLLVM.cmake does not expose the LLVM source directory.
@@ -20,11 +20,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 1 file changed, 9 insertions(+), 1 deletion(-) 20 1 file changed, 9 insertions(+), 1 deletion(-)
21 21
22diff --git a/CMakeLists.txt b/CMakeLists.txt 22diff --git a/CMakeLists.txt b/CMakeLists.txt
23index 5b1591e..7c6c0f4 100644 23index b522c340d..7f2e49d17 100644
24--- a/CMakeLists.txt 24--- a/CMakeLists.txt
25+++ b/CMakeLists.txt 25+++ b/CMakeLists.txt
26@@ -42,7 +42,15 @@ option(COMPILER_RT_BUILD_XRAY "Build xray" ON) 26@@ -35,7 +35,15 @@ set(COMPILER_RT_BAREMETAL_BUILD OFF CACHE BOOLEAN
27 mark_as_advanced(COMPILER_RT_BUILD_XRAY) 27 "Build for a bare-metal target.")
28 28
29 if (COMPILER_RT_STANDALONE_BUILD) 29 if (COMPILER_RT_STANDALONE_BUILD)
30- load_llvm_config() 30- load_llvm_config()
@@ -41,5 +41,5 @@ index 5b1591e..7c6c0f4 100644
41 # Find Python interpreter. 41 # Find Python interpreter.
42 set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5) 42 set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5)
43-- 43--
442.10.0 442.13.0
45 45
diff --git a/recipes-devtools/clang/compiler-rt/0003-Disable-tsan-on-OE-glibc.patch b/recipes-devtools/clang/compiler-rt/0003-Disable-tsan-on-OE-glibc.patch
index 045f8ac..dc2a999 100644
--- a/recipes-devtools/clang/compiler-rt/0003-Disable-tsan-on-OE-glibc.patch
+++ b/recipes-devtools/clang/compiler-rt/0003-Disable-tsan-on-OE-glibc.patch
@@ -1,4 +1,4 @@
1From 00ac81c887f0f6eb31bed1e516374b6aa01b6389 Mon Sep 17 00:00:00 2001 1From 9390b3a6552d8f122e186797416904066df418be Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 18 Jul 2016 08:05:02 +0000 3Date: Mon, 18 Jul 2016 08:05:02 +0000
4Subject: [PATCH 3/4] Disable tsan on OE/glibc 4Subject: [PATCH 3/4] Disable tsan on OE/glibc
@@ -13,15 +13,15 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
13 2 files changed, 1 insertion(+), 2 deletions(-) 13 2 files changed, 1 insertion(+), 2 deletions(-)
14 14
15diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake 15diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
16index e0e43552e..bb3c77f6d 100644 16index ae2a262a1..edc6dc63e 100644
17--- a/cmake/config-ix.cmake 17--- a/cmake/config-ix.cmake
18+++ b/cmake/config-ix.cmake 18+++ b/cmake/config-ix.cmake
19@@ -491,7 +491,7 @@ else() 19@@ -497,7 +497,7 @@ else()
20 endif() 20 endif()
21 21
22 if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND 22 if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND
23- OS_NAME MATCHES "Darwin|Linux|FreeBSD") 23- OS_NAME MATCHES "Darwin|Linux|FreeBSD|Android")
24+ OS_NAME MATCHES "Darwin|FreeBSD") 24+ OS_NAME MATCHES "Darwin|FreeBSD|Android")
25 set(COMPILER_RT_HAS_TSAN TRUE) 25 set(COMPILER_RT_HAS_TSAN TRUE)
26 else() 26 else()
27 set(COMPILER_RT_HAS_TSAN FALSE) 27 set(COMPILER_RT_HAS_TSAN FALSE)
@@ -38,5 +38,5 @@ index 9b4070b0f..e76f2680c 100644
38 list(APPEND SUPPORTED_TOOLS lsan) 38 list(APPEND SUPPORTED_TOOLS lsan)
39 endif() 39 endif()
40-- 40--
412.12.0 412.13.0
42 42
diff --git a/recipes-devtools/clang/compiler-rt/0004-cmake-mips-Do-not-specify-target-with-OE.patch b/recipes-devtools/clang/compiler-rt/0004-cmake-mips-Do-not-specify-target-with-OE.patch
index 8e8852d..0b2e14d 100644
--- a/recipes-devtools/clang/compiler-rt/0004-cmake-mips-Do-not-specify-target-with-OE.patch
+++ b/recipes-devtools/clang/compiler-rt/0004-cmake-mips-Do-not-specify-target-with-OE.patch
@@ -1,7 +1,7 @@
1From 7a83bae70e155c499c9ed5b4719f8baf01da6cd9 Mon Sep 17 00:00:00 2001 1From 0be126894e872108eaa7eae3629a5564598ee25e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 11 Feb 2017 17:54:33 +0000 3Date: Sat, 11 Feb 2017 17:54:33 +0000
4Subject: [PATCH] cmake/mips: Do not specify --target with OE 4Subject: [PATCH 4/4] cmake/mips: Do not specify --target with OE
5 5
6OE already specifies cross compiler correctly, adding this additional 6OE already specifies cross compiler correctly, adding this additional
7--target confuses the clang driver and it resorts to invoke host assembler 7--target confuses the clang driver and it resorts to invoke host assembler
@@ -20,7 +20,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 1 file changed, 4 insertions(+), 4 deletions(-) 20 1 file changed, 4 insertions(+), 4 deletions(-)
21 21
22diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake 22diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
23index 71d1499..c5aeecb 100644 23index 6f9f15139..7002a60ac 100644
24--- a/cmake/base-config-ix.cmake 24--- a/cmake/base-config-ix.cmake
25+++ b/cmake/base-config-ix.cmake 25+++ b/cmake/base-config-ix.cmake
26@@ -161,11 +161,11 @@ macro(test_targets) 26@@ -161,11 +161,11 @@ macro(test_targets)
@@ -40,5 +40,5 @@ index 71d1499..c5aeecb 100644
40 if(WIN32) 40 if(WIN32)
41 test_target_arch(arm "" "" "") 41 test_target_arch(arm "" "" "")
42-- 42--
431.9.1 432.13.0
44 44
diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb
index 0b36bd3..7f9d5db 100644
--- a/recipes-devtools/clang/compiler-rt_git.bb
+++ b/recipes-devtools/clang/compiler-rt_git.bb
@@ -14,11 +14,12 @@ PV .= "+git${SRCPV}"
14 14
15LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=bf24bca27049b52e9738451aa55771d4; \ 15LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=bf24bca27049b52e9738451aa55771d4; \
16" 16"
17SRC_URI = "${LLVM_GIT}/compiler-rt.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=compiler-rt \ 17SRC_URI = "\
18 file://0001-support-a-new-embedded-linux-target.patch \ 18 ${LLVM_GIT}/compiler-rt.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=compiler-rt \
19 file://0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch \ 19 file://0001-support-a-new-embedded-linux-target.patch \
20 file://0003-Disable-tsan-on-OE-glibc.patch \ 20 file://0002-Simplify-cross-compilation.-Don-t-use-native-compile.patch \
21 file://0004-cmake-mips-Do-not-specify-target-with-OE.patch \ 21 file://0003-Disable-tsan-on-OE-glibc.patch \
22 file://0004-cmake-mips-Do-not-specify-target-with-OE.patch \
22" 23"
23 24
24SRCREV_FORMAT = "compiler-rt" 25SRCREV_FORMAT = "compiler-rt"
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb
index c6e2dd5..2cbcf62 100644
--- a/recipes-devtools/clang/libcxx_git.bb
+++ b/recipes-devtools/clang/libcxx_git.bb
@@ -7,6 +7,7 @@ LICENSE = "MIT | NCSA"
7SECTION = "base" 7SECTION = "base"
8 8
9require clang.inc 9require clang.inc
10require common.inc
10 11
11inherit cmake pythonnative 12inherit cmake pythonnative
12PV .= "+git${SRCPV}" 13PV .= "+git${SRCPV}"
@@ -17,27 +18,31 @@ BASEDEPENDS_remove_toolchain-clang_class-target = "llvm-libunwind"
17BASEDEPENDS_remove_toolchain-clang_class-target = "compiler-rt" 18BASEDEPENDS_remove_toolchain-clang_class-target = "compiler-rt"
18 19
19 20
20LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=7b3a0e1b99822669d630011defe9bfd9; \ 21LIC_FILES_CHKSUM = "file://projects/libcxx/LICENSE.TXT;md5=7b3a0e1b99822669d630011defe9bfd9; \
21 " 22"
22SRC_URI = "\ 23SRC_URI = "\
23 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \ 24 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \
24 ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \ 25 ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \
25 ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=cxxabi;destsuffix=git/projects/libcxxabi \ 26 ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=cxxabi;destsuffix=git/projects/libcxxabi \
26 " 27 ${LLVMPATCHES} \
27SRC_URI_append_libc-musl = " file://0001-use-constexpr-when-using-glibc.patch " 28 ${LIBCXXPATCHES} \
29 ${LIBCXXABIPATCHES} \
30"
28 31
29SRCREV_FORMAT = "llvm_libcxx_cxxabi" 32SRCREV_FORMAT = "llvm_libcxx_cxxabi"
30 33
31S = "${WORKDIR}/git/projects/libcxx" 34S = "${WORKDIR}/git"
32 35
33THUMB_TUNE_CCARGS = "" 36THUMB_TUNE_CCARGS = ""
34#TUNE_CCARGS += "-nostdlib" 37#TUNE_CCARGS += "-nostdlib"
35 38
36EXTRA_OECMAKE += "-DLIBCXX_CXX_ABI=libcxxabi \ 39EXTRA_OECMAKE += "-DLIBCXX_CXX_ABI=libcxxabi \
37 -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/../libcxxabi/include \ 40 -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/projects/libcxxabi/include \
38 -DLLVM_PATH=${S}/../../ \ 41 -DLLVM_PATH=${S} \
39 -DLIBCXX_ENABLE_SHARED=ON \ 42 -DLIBCXX_ENABLE_SHARED=ON \
40 " 43 -DLIBCXX_ENABLE_EXCEPTIONS=ON \
44 ${S}/projects/libcxx \
45"
41 46
42EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=True " 47EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=True "
43 48
diff --git a/recipes-devtools/clang/libcxxabi/0001-Do-not-use-LIBCXXABI_ARM_EHABI.patch b/recipes-devtools/clang/libcxxabi/0001-Do-not-use-LIBCXXABI_ARM_EHABI.patch
deleted file mode 100644
index 536354d..0000000
--- a/recipes-devtools/clang/libcxxabi/0001-Do-not-use-LIBCXXABI_ARM_EHABI.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From d072fa3f959a559e6913ebbc62bcdeb7f4a55143 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 24 Mar 2016 06:31:35 +0000
4Subject: [PATCH] Do not use LIBCXXABI_ARM_EHABI
5
6Fixes errors like
7libcxxabi/src/cxa_exception.cpp:258:21: error: unknown type name '_Unwind_Control_Block'
8 static_cast<_Unwind_Control_Block*>(unwind_exception)->barrier_cache.bitpattern[0]);
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 include/__cxxabi_config.h | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/include/__cxxabi_config.h b/include/__cxxabi_config.h
16index 61555f1..a979694 100644
17--- a/include/__cxxabi_config.h
18+++ b/include/__cxxabi_config.h
19@@ -12,7 +12,7 @@
20
21 #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
22 !defined(__ARM_DWARF_EH__)
23-#define LIBCXXABI_ARM_EHABI 1
24+#define LIBCXXABI_ARM_EHABI 0
25 #else
26 #define LIBCXXABI_ARM_EHABI 0
27 #endif
28--
292.9.0
30
diff --git a/recipes-devtools/clang/libcxxabi_git.bb b/recipes-devtools/clang/libcxxabi_git.bb
index 300e47f..7ca8ccb 100644
--- a/recipes-devtools/clang/libcxxabi_git.bb
+++ b/recipes-devtools/clang/libcxxabi_git.bb
@@ -7,6 +7,7 @@ LICENSE = "MIT | NCSA"
7SECTION = "base" 7SECTION = "base"
8 8
9require clang.inc 9require clang.inc
10require common.inc
10 11
11TOOLCHAIN = "clang" 12TOOLCHAIN = "clang"
12 13
@@ -17,28 +18,32 @@ DEPENDS += "compiler-rt"
17BASEDEPENDS_remove_toolchain-clang_class-target = "libcxx" 18BASEDEPENDS_remove_toolchain-clang_class-target = "libcxx"
18BASEDEPENDS_remove_toolchain-clang_class-target = "llvm-libunwind" 19BASEDEPENDS_remove_toolchain-clang_class-target = "llvm-libunwind"
19 20
20LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8ae94dd6195890583eee15a988b6ea79; \ 21LIC_FILES_CHKSUM = "file://projects/libcxxabi/LICENSE.TXT;md5=8ae94dd6195890583eee15a988b6ea79; \
21 " 22 "
22SRC_URI = "\ 23SRC_URI = "\
23 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \ 24 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \
24 ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \ 25 ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \
25 ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=cxxabi;destsuffix=git/projects/libcxxabi \ 26 ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=cxxabi;destsuffix=git/projects/libcxxabi \
26 file://0001-Do-not-use-LIBCXXABI_ARM_EHABI.patch \ 27 ${LLVMPATCHES} \
28 ${LIBCXXPATCHES} \
29 ${LIBCXXABIPATCHES} \
27" 30"
28 31
29SRCREV_FORMAT = "llvm_libcxx_cxxabi" 32SRCREV_FORMAT = "llvm_libcxx_cxxabi"
30 33
31S = "${WORKDIR}/git/projects/libcxxabi" 34S = "${WORKDIR}/git"
32 35
33THUMB_TUNE_CCARGS = "" 36THUMB_TUNE_CCARGS = ""
34#TUNE_CCARGS += "-nostdlib" 37#TUNE_CCARGS += "-nostdlib"
35EXTRA_OECMAKE += "-DLIBCXXABI_LIBCXX_PATH=${S}/../libcxx \ 38EXTRA_OECMAKE += "-DLIBCXXABI_LIBCXX_PATH=${S}/projects/libcxx \
36 -DLLVM_PATH=${S}/../../ \ 39 -DLLVM_PATH=${S} \
37 -DLLVM_ENABLE_LIBCXX=OFF \ 40 -DLLVM_ENABLE_LIBCXX=OFF \
38 -DLIBCXXABI_LIBCXX_INCLUDES=${S}/../libcxx/include \ 41 -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
42 -DLIBCXXABI_LIBCXX_INCLUDES=${S}/projects/libcxx/include \
39 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=True \ 43 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=True \
40 -DCXX_SUPPORTS_CXX11=ON \ 44 -DCXX_SUPPORTS_CXX11=ON \
41 -DLIBCXXABI_ENABLE_SHARED=ON \ 45 -DLIBCXXABI_ENABLE_SHARED=ON \
46 ${S}/projects/libcxxabi \
42" 47"
43CXXFLAGS_append_libc-musl = " -D_LIBCPP_HAS_MUSL_LIBC " 48CXXFLAGS_append_libc-musl = " -D_LIBCPP_HAS_MUSL_LIBC "
44 49
diff --git a/recipes-devtools/clang/lld_git.bb b/recipes-devtools/clang/lld_git.bb
index d3aaffa..5b31ff5 100644
--- a/recipes-devtools/clang/lld_git.bb
+++ b/recipes-devtools/clang/lld_git.bb
@@ -9,6 +9,7 @@ SECTION = "devel"
9DEPENDS += "clang-native libcxx" 9DEPENDS += "clang-native libcxx"
10 10
11require clang.inc 11require clang.inc
12require common.inc
12 13
13FILESPATH =. "${FILE_DIRNAME}/clang:" 14FILESPATH =. "${FILE_DIRNAME}/clang:"
14 15
@@ -20,12 +21,11 @@ LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=${LLVMMD5SUM}; \
20 " 21 "
21 22
22SRC_URI = "\ 23SRC_URI = "\
23 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \ 24 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \
24 ${LLVM_GIT}/lld.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/lld;name=lld \ 25 ${LLVM_GIT}/lld.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/lld;name=lld \
25 file://0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch \ 26 ${LLVMPATCHES} \
26 file://0002-llvm-Do-not-assume-linux-glibc.patch \ 27 "
27 file://0003-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ 28
28 "
29SRCREV_FORMAT = "llvm_lld" 29SRCREV_FORMAT = "llvm_lld"
30 30
31S = "${WORKDIR}/git" 31S = "${WORKDIR}/git"
diff --git a/recipes-devtools/clang/lldb/0001-Include-limits.h-for-PATH_MAX-definition.patch b/recipes-devtools/clang/lldb/0001-Include-limits.h-for-PATH_MAX-definition.patch
index d0a0800..4423061 100644
--- a/recipes-devtools/clang/lldb/0001-Include-limits.h-for-PATH_MAX-definition.patch
+++ b/recipes-devtools/clang/lldb/0001-Include-limits.h-for-PATH_MAX-definition.patch
@@ -1,27 +1,28 @@
1From 87a102f4a9a9143b589971a43e93e3b5f8638321 Mon Sep 17 00:00:00 2001 1From eba8b855017605c42368e509e599875f71440940 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 22 Mar 2017 22:25:18 -0700 3Date: Thu, 18 May 2017 23:12:34 -0700
4Subject: [PATCH] Include limits.h for PATH_MAX definition 4Subject: [PATCH] Include limits.h for PATH_MAX definition
5 5
6Helps compiling on musl targets 6Helps compiling on musl targets
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9--- 9---
10 source/Host/common/FileSpec.cpp | 1 + 10 source/Utility/FileSpec.cpp | 2 +-
11 1 file changed, 1 insertion(+) 11 1 file changed, 1 insertion(+), 1 deletion(-)
12 12
13diff --git a/source/Host/common/FileSpec.cpp b/source/Host/common/FileSpec.cpp 13diff --git a/source/Utility/FileSpec.cpp b/source/Utility/FileSpec.cpp
14index 7f46d303a..2be162d63 100644 14index 3c4e3407d..2d071fa36 100644
15--- a/source/Host/common/FileSpec.cpp 15--- a/source/Utility/FileSpec.cpp
16+++ b/source/Host/common/FileSpec.cpp 16+++ b/source/Utility/FileSpec.cpp
17@@ -19,6 +19,7 @@ 17@@ -31,7 +31,7 @@
18 #include <fstream> 18 #include <assert.h> // for assert
19 #include <set> 19 #include <stdio.h> // for size_t, NULL, snpr...
20 #include <string.h> 20 #include <string.h> // for strcmp
21+#include <limits.h> 21-
22+#include <limits.h> // for PATH_MAX
23 using namespace lldb;
24 using namespace lldb_private;
22 25
23 #include "lldb/Host/Config.h" // Have to include this before we test the define...
24 #ifdef LLDB_CONFIG_TILDE_RESOLVES_TO_USER
25-- 26--
262.12.1 272.13.0
27 28
diff --git a/recipes-devtools/clang/lldb/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/lldb/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
new file mode 100644
index 0000000..1a4d1d7
--- /dev/null
+++ b/recipes-devtools/clang/lldb/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch
@@ -0,0 +1,42 @@
1From 6a38064611f3506b67656e5de680a957ee95adb6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 22 May 2017 17:36:16 -0700
4Subject: [PATCH] lldb: Add -lxml2 to linker cmdline of xml is found
5
6When cross compiling for systems where static libs
7for libxml are not available cmake's detection mechanism
8resort to linking with libxml.so but doesnt use -lxml2
9liblldbHost.a however requires libxml on linker
10cmdline _after_ itself so its use of symbols from libxml2
11can be resolved. Here check for libxml2 being detected and
12add it if its found.
13
14Fixes
15
16| ../../../../lib/liblldbHost.a(XML.cpp.o): In function `lldb_private::XMLDocument::Clear()':
17| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc'
18| /usr/src/debug/lldb/5.0.0+gitAUTOINC+69edad7913_08d6b47db9_cf6c5b3386-r0/git/tools/lldb/source/Host/common/XML.cpp:29: undefined reference to `xmlFreeDoc'
19
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22 source/Host/CMakeLists.txt | 4 ++++
23 1 file changed, 4 insertions(+)
24
25diff --git a/source/Host/CMakeLists.txt b/source/Host/CMakeLists.txt
26index 2a73c30f8..f5e132fee 100644
27--- a/source/Host/CMakeLists.txt
28+++ b/source/Host/CMakeLists.txt
29@@ -163,6 +163,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
30 set(EXTRA_LIBS kvm)
31 endif ()
32
33+if (LIBXML2_FOUND)
34+ list(APPEND EXTRA_LIBS xml2)
35+endif ()
36+
37 add_lldb_library(lldbHost
38 ${HOST_SOURCES}
39
40--
412.13.0
42
diff --git a/recipes-devtools/clang/lldb_git.bb b/recipes-devtools/clang/lldb_git.bb
index 6717124..cf4ad59 100644
--- a/recipes-devtools/clang/lldb_git.bb
+++ b/recipes-devtools/clang/lldb_git.bb
@@ -10,6 +10,7 @@ DEPENDS += "clang-native zlib libxml2"
10 10
11FILESPATH =. "${FILE_DIRNAME}/clang:" 11FILESPATH =. "${FILE_DIRNAME}/clang:"
12require clang.inc 12require clang.inc
13require common.inc
13 14
14inherit cmake 15inherit cmake
15PV .= "+git${SRCPV}" 16PV .= "+git${SRCPV}"
@@ -20,30 +21,18 @@ LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=${LLVMMD5SUM}; \
20 " 21 "
21 22
22SRC_URI = "\ 23SRC_URI = "\
23 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \ 24 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \
24 ${LLVM_GIT}/clang.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/clang;name=clang \ 25 ${LLVM_GIT}/clang.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/clang;name=clang \
25 ${LLVM_GIT}/lldb.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/lldb;name=lldb \ 26 ${LLVM_GIT}/lldb.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};destsuffix=git/tools/lldb;name=lldb \
26 " 27 ${LLVMPATCHES} \
27# llvm patches 28 ${CLANGPATCHES} \
28SRC_URI += "\ 29 "
29 file://0001-llvm-Remove-CMAKE_CROSSCOMPILING-so-it-can-cross-com.patch \
30 file://0002-llvm-Do-not-assume-linux-glibc.patch \
31 file://0003-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \
32 file://0004-llvm-allow-env-override-of-exe-path.patch \
33 "
34 30
35# Clang patches
36SRC_URI += "\
37 file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \
38 file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \
39 file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \
40 file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \
41 file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=tools/clang \
42 "
43# lldb patches 31# lldb patches
44SRC_URI += "\ 32SRC_URI += "\
45 file://0001-Include-limits.h-for-PATH_MAX-definition.patch;patchdir=tools/lldb \ 33 file://0001-Include-limits.h-for-PATH_MAX-definition.patch;patchdir=tools/lldb \
46 " 34 file://0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch;patchdir=tools/lldb \
35 "
47SRCREV_FORMAT = "llvm_clang_lldb" 36SRCREV_FORMAT = "llvm_clang_lldb"
48 37
49S = "${WORKDIR}/git" 38S = "${WORKDIR}/git"
@@ -51,7 +40,11 @@ S = "${WORKDIR}/git"
51OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" 40OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"
52 41
53EXTRA_OECMAKE="\ 42EXTRA_OECMAKE="\
43 -DCMAKE_CROSSCOMPILING=1 \
44 -DLLVM_BUILD_LLVM_DYLIB=ON \
45 -DBUILD_SHARED_LIBS=OFF \
54 -DLLVM_BUILD_LLVM_DYLIB=ON \ 46 -DLLVM_BUILD_LLVM_DYLIB=ON \
47 -DLLVM_ENABLE_PIC=ON \
55 -DLLDB_DISABLE_LIBEDIT=1 \ 48 -DLLDB_DISABLE_LIBEDIT=1 \
56 -DLLDB_DISABLE_CURSES=1 \ 49 -DLLDB_DISABLE_CURSES=1 \
57 -DLLDB_DISABLE_PYTHON=1 \ 50 -DLLDB_DISABLE_PYTHON=1 \
@@ -60,12 +53,16 @@ EXTRA_OECMAKE="\
60 -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ 53 -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \
61 " 54 "
62 55
56EXTRA_OEMAKE = "VERBOSE=1"
57
58LDFLAGS += "-lxml2"
59
63do_compile() { 60do_compile() {
64 cd ${B}/tools/lldb 61 cd ${B}/tools/lldb
65 base_do_compile VERBOSE=1 62 oe_runmake VERBOSE=1
66} 63}
67 64
68do_install() { 65do_install() {
69 cd ${B}/tools/lldb 66 cd ${B}/tools/lldb
70 oe_runmake 'DESTDIR=${D}' install 67 oe_runmake 'DESTDIR=${D}' install
71} 68}
diff --git a/recipes-devtools/clang/llvm-libunwind_git.bb b/recipes-devtools/clang/llvm-libunwind_git.bb
index 8a9b2c5..04a4515 100644
--- a/recipes-devtools/clang/llvm-libunwind_git.bb
+++ b/recipes-devtools/clang/llvm-libunwind_git.bb
@@ -7,6 +7,7 @@ LICENSE = "MIT | NCSA"
7SECTION = "base" 7SECTION = "base"
8 8
9require clang.inc 9require clang.inc
10require common.inc
10 11
11inherit cmake 12inherit cmake
12PV .= "+git${SRCPV}" 13PV .= "+git${SRCPV}"
@@ -16,18 +17,21 @@ BASEDEPENDS_remove_toolchain-clang_class-target = "llvm-libunwind"
16BASEDEPENDS_remove_toolchain-clang_class-target = "compiler-rt" 17BASEDEPENDS_remove_toolchain-clang_class-target = "compiler-rt"
17PROVIDES += "libunwind" 18PROVIDES += "libunwind"
18 19
19LIC_FILES_CHKSUM = "file://../libcxx/LICENSE.TXT;md5=7b3a0e1b99822669d630011defe9bfd9; \ 20LIC_FILES_CHKSUM = "file://projects/libcxx/LICENSE.TXT;md5=7b3a0e1b99822669d630011defe9bfd9; \
20 " 21"
21SRC_URI = "\ 22SRC_URI = "\
22 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \ 23 ${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=llvm \
23 ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \ 24 ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \
24 ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=cxxabi;destsuffix=git/projects/libcxxabi \ 25 ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=cxxabi;destsuffix=git/projects/libcxxabi \
25 ${LLVM_GIT}/libunwind.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libunwind;destsuffix=git/projects/libunwind \ 26 ${LLVM_GIT}/libunwind.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libunwind;destsuffix=git/projects/libunwind \
26 " 27 ${LLVMPATCHES} \
28 ${LIBCXXPATCHES} \
29 ${LIBCXXABIPATCHES} \
30"
27 31
28SRCREV_FORMAT = "llvm_libcxx_cxxabi_libunwind" 32SRCREV_FORMAT = "llvm_libcxx_cxxabi_libunwind"
29 33
30S = "${WORKDIR}/git/projects/libunwind" 34S = "${WORKDIR}/git"
31 35
32COMPATIBLE_HOST_mips = "null" 36COMPATIBLE_HOST_mips = "null"
33COMPATIBLE_HOST_mipsel = "null" 37COMPATIBLE_HOST_mipsel = "null"
@@ -37,16 +41,17 @@ COMPATIBLE_HOST_mips64el = "null"
37THUMB_TUNE_CCARGS = "" 41THUMB_TUNE_CCARGS = ""
38#TUNE_CCARGS += "-nostdlib" 42#TUNE_CCARGS += "-nostdlib"
39 43
40EXTRA_OECMAKE += "-DLIBCXXABI_LIBCXX_PATH=${S}/../libcxxabi \ 44EXTRA_OECMAKE += "-DLIBCXXABI_LIBCXX_PATH=${S}/projects/libcxxabi \
41 -DLLVM_PATH=${S}/../../ \ 45 -DLLVM_PATH=${S} \
42 -DLLVM_ENABLE_LIBCXX=True \ 46 -DLLVM_ENABLE_LIBCXX=True \
43 -DLLVM_ENABLE_LIBCXXABI=True \ 47 -DLLVM_ENABLE_LIBCXXABI=True \
44 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=True \ 48 -DLLVM_BUILD_EXTERNAL_COMPILER_RT=True \
45 -DLIBUNWIND_ENABLE_SHARED=ON \ 49 -DLIBUNWIND_ENABLE_SHARED=ON \
46 -DUNIX=True \ 50 -DUNIX=True \
47 " 51 ${S}/projects/libunwind \
52"
48do_configure_prepend () { 53do_configure_prepend () {
49 (cd ${S}/include && ln -sf ../../libcxxabi/include/__cxxabi_config.h) 54 (cd ${S}/projects/libunwind/include && ln -sf ../../libcxxabi/include/__cxxabi_config.h)
50} 55}
51 56
52ALLOW_EMPTY_${PN} = "1" 57ALLOW_EMPTY_${PN} = "1"