1From 78e15cfed8228b7abf819271154133afaa9520a3 Mon Sep 17 00:00:00 2001
2From: Matthew Maurer <[email protected]>
3Date: Thu, 13 Jun 2019 11:30:54 -0700
4Subject: [PATCH 1/2] Add clang specific flags
5
6* Use compiler-rt to provide __muloti4
7* Tell it to still pull in gcc_s for unwinding
8---
9 src/trans/codegen_c.cpp | 6 ++++++
10 1 file changed, 6 insertions(+)
11
12diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
13index 2ab4ff35..8c2e1ce6 100644
14--- a/src/trans/codegen_c.cpp
15+++ b/src/trans/codegen_c.cpp
16@@ -638,6 +638,12 @@ namespace {
17                 args.push_back(m_outfile_path_c.c_str());
18                 if( is_executable )
19                 {
20+                    // TODO Only pass this to clang
21+                    // Needed with clang for __muloti4
22+                    args.push_back("--rtlib=compiler-rt");
23+                    // Still link in unwind runtime &c
24+                    args.push_back("-lgcc_s");
25+
26                     for( const auto& crate : m_crate.m_ext_crates )
27                     {
28                         args.push_back(crate.second.m_path + ".o");
29--
302.22.0.410.gd8fdbe21b5-goog
31
32