summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-01-27 12:59:39 -0800
committerKhem Raj <raj.khem@gmail.com>2019-01-27 16:51:07 -0800
commitc2a5d0daf40cb52fc322c8b8780da8f350890ada (patch)
tree0f6de0736de6e9235841eb3cdea32900cc6feda7 /recipes-devtools/clang
parentb061699a53c0dd13101375db2c5f34290dcdc709 (diff)
downloadmeta-clang-c2a5d0daf40cb52fc322c8b8780da8f350890ada.tar.gz
clang: link with libgcc_eh.a when using compiler-rt
compiler-rt is not a full replacement for libgcc, it provides the built-ins so we are left with EH and unwinding support to be had from elsewhere, we could use LLVM linunwind but that depends on libpthread so it will end up pulling too many libraries for meantime link with libgcc_eh.a when --rtlib=compiler-rt Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools/clang')
-rw-r--r--recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch14
1 files changed, 8 insertions, 6 deletions
diff --git a/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch b/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch
index 9db055c..4f008f6 100644
--- a/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch
+++ b/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch
@@ -1,4 +1,4 @@
1From ee4557fd25d6d752eeb25d28b197ad8364c554d5 Mon Sep 17 00:00:00 2001 1From 53ff7e84ddaf2a82733c4fcb321afa1d54e2516b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 25 Jan 2019 14:39:04 -0800 3Date: Fri, 25 Jan 2019 14:39:04 -0800
4Subject: [PATCH] clang: Append libunwind to compiler-rt for linking 4Subject: [PATCH] clang: Append libunwind to compiler-rt for linking
@@ -8,18 +8,20 @@ too, and they are missing in compiler-rt but provided by llvm libunwind
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10--- 10---
11 clang/lib/Driver/ToolChains/CommonArgs.cpp | 1 + 11 clang/lib/Driver/ToolChains/CommonArgs.cpp | 3 +++
12 1 file changed, 1 insertion(+) 12 1 file changed, 3 insertions(+)
13 13
14diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp 14diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
15index d7e316befa6..d2dd45eeb9a 100644 15index 1161e8158d5..d4c346e7960 100644
16--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp 16--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
17+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp 17+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
18@@ -1191,6 +1191,7 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D, 18@@ -1190,6 +1190,9 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D,
19 switch (RLT) { 19 switch (RLT) {
20 case ToolChain::RLT_CompilerRT: 20 case ToolChain::RLT_CompilerRT:
21 CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins")); 21 CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins"));
22+ CmdArgs.push_back(Args.MakeArgString("-l:libunwind.a")); 22+ CmdArgs.push_back("--as-needed");
23+ CmdArgs.push_back(Args.MakeArgString("-l:libgcc_eh.a"));
24+ CmdArgs.push_back("--no-as-needed");
23 break; 25 break;
24 case ToolChain::RLT_Libgcc: 26 case ToolChain::RLT_Libgcc:
25 // Make sure libgcc is not used under MSVC environment by default 27 // Make sure libgcc is not used under MSVC environment by default