[PATCH] D25256: [Driver] Print path to correct rtlib for -print_libgcc_file_name

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 15:02:29 PDT 2016


phosek created this revision.
phosek added a subscriber: cfe-commits.
phosek set the repository for this revision to rL LLVM.

When compiler-rt is being used as a runtime library, Clang would print an invalid path when -print_libgcc_file_name option is used. We should print a path to compiler-rt builtin library instead.


Repository:
  rL LLVM

https://reviews.llvm.org/D25256

Files:
  lib/Driver/Driver.cpp


Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -994,7 +994,17 @@
   }
 
   if (C.getArgs().hasArg(options::OPT_print_libgcc_file_name)) {
-    llvm::outs() << GetFilePath("libgcc.a", TC) << "\n";
+    ToolChain::RuntimeLibType RLT = TC.GetRuntimeLibType(C.getArgs());
+    std::string Path;
+    switch (RLT) {
+    case ToolChain::RLT_CompilerRT:
+      Path = TC.getCompilerRT(C.getArgs(), "builtins");
+      break;
+    case ToolChain::RLT_Libgcc:
+      Path = GetFilePath("libgcc.a", TC);
+      break;
+    }
+    llvm::outs() << Path << "\n";
     return false;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25256.73559.patch
Type: text/x-patch
Size: 682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161004/4ed7c8c6/attachment-0001.bin>


More information about the cfe-commits mailing list