diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-01-26 13:45:15 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-01-26 19:56:44 -0500 |
commit | 5aea44941f146f61ef2ab422ade7f52d5d793320 (patch) | |
tree | 65b5e3c39862b380af3c63a984dae742364a51ef | |
parent | 9fd4604241d39e019eb969ec2e61b159623c56d1 (diff) | |
download | meta-clang-5aea44941f146f61ef2ab422ade7f52d5d793320.tar.gz |
clang: Add libunwind automatically to link cmdline when using compiler-rt
This makes compile-rt equal to libgcc which has both builtins+unwind as
well
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch | 23 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
2 files changed, 24 insertions, 0 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 new file mode 100644 index 0000000..d5c67d1 --- /dev/null +++ b/recipes-devtools/clang/clang/0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | From 4b5386fe67b03923b7ce25c066e6f6220a32eb44 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 25 Jan 2019 14:39:04 -0800 | ||
4 | Subject: [PATCH] clang: Append libunwind to compiler-rt for linking | ||
5 | |||
6 | Some packages which use libgcc tend to use low level unwind functions | ||
7 | too, and they are missing in compiler-rt but provided by llvm libunwind | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | clang/lib/Driver/ToolChains/CommonArgs.cpp | 4 ++++ | ||
12 | 1 file changed, 4 insertions(+) | ||
13 | |||
14 | --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
15 | +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
16 | @@ -1191,6 +1191,7 @@ void tools::AddRunTimeLibs(const ToolCha | ||
17 | switch (RLT) { | ||
18 | case ToolChain::RLT_CompilerRT: | ||
19 | CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins")); | ||
20 | + CmdArgs.push_back(Args.MakeArgString(D.SysRoot + "/usr/lib" "/libunwind.a")); | ||
21 | break; | ||
22 | case ToolChain::RLT_Libgcc: | ||
23 | // Make sure libgcc is not used under MSVC environment by default | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index ad1f435..0d9445a 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -24,6 +24,7 @@ SRC_URI = "\ | |||
24 | file://0013-compiler-rt-support-a-new-embedded-linux-target.patch \ | 24 | file://0013-compiler-rt-support-a-new-embedded-linux-target.patch \ |
25 | file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ | 25 | file://0014-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ |
26 | file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \ | 26 | file://0015-compiler-rt-Disable-tsan-on-OE-glibc.patch \ |
27 | file://0016-clang-Append-libunwind-to-compiler-rt-for-linking.patch \ | ||
27 | " | 28 | " |
28 | 29 | ||
29 | # Fallback to no-PIE if not set | 30 | # Fallback to no-PIE if not set |