<commit_before>From ee4557fd25d6d752eeb25d28b197ad8364c554d5 Mon Sep 17 00:00:00 2001
From: <NAME> <<EMAIL>>
Date: Fri, 25 Jan 2019 14:39:04 -0800
Subject: [PATCH] clang: Append libunwind to compiler-rt for linking

Some packages which use libgcc tend to use low level unwind functions
too, and they are missing in compiler-rt but provided by llvm libunwind

Signed-off-by: <NAME> <<EMAIL>>
---
 clang/lib/Driver/ToolChains/CommonArgs.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index d7e316befa6..d2dd45eeb9a 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1191,6 +1191,7 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D,
   switch (RLT) {
   case ToolChain::RLT_CompilerRT:
     CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins"));
+    CmdArgs.push_back(Args.MakeArgString("-l:libunwind.a"));
     break;
   case ToolChain::RLT_Libgcc:
     // Make sure libgcc is not used under MSVC environment by default
-- <commit_msg>clang: link with libgcc_eh.a when using compiler-rt<commit_after>From 53ff7e84ddaf2a82733c4fcb321afa1d54e2516b Mon Sep 17 00:00:00 2001
From: <NAME> <<EMAIL>>
Date: Fri, 25 Jan 2019 14:39:04 -0800
Subject: [PATCH] clang: Append libunwind to compiler-rt for linking

Some packages which use libgcc tend to use low level unwind functions
too, and they are missing in compiler-rt but provided by llvm libunwind

Signed-off-by: <NAME> <<EMAIL>>
---
 clang/lib/Driver/ToolChains/CommonArgs.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 1161e8158d5..d4c346e7960 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1190,6 +1190,9 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D,
   switch (RLT) {
   case ToolChain::RLT_CompilerRT:
     CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins"));
+    CmdArgs.push_back("--as-needed");
+    CmdArgs.push_back(Args.MakeArgString("-l:libgcc_eh.a"));
+    CmdArgs.push_back("--no-as-needed");
     break;
   case ToolChain::RLT_Libgcc:
     // Make sure libgcc is not used under MSVC environment by default
-- 
{'fraction_non_alphanumeric': 0.12414965986394558, 'fraction_numerical': 0.07100340136054421, 'mean_word_length': 4.575829383886256, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4674510', 'n_tokens_mistral': 982, 'n_tokens_neox': 856, 'n_words': 206}