[PATCH] D27393: [llvm-config] Fix bug where `--libfiles` and `--names` would produce incorrect output

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 15:17:48 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL289488: [llvm-config] Fix bug where `--libfiles` and `--names` would produce (authored by delcypher).

Changed prior to commit:
  https://reviews.llvm.org/D27393?vs=80203&id=81150#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27393

Files:
  llvm/trunk/tools/llvm-config/llvm-config.cpp


Index: llvm/trunk/tools/llvm-config/llvm-config.cpp
===================================================================
--- llvm/trunk/tools/llvm-config/llvm-config.cpp
+++ llvm/trunk/tools/llvm-config/llvm-config.cpp
@@ -432,7 +432,15 @@
                                          const bool Shared) {
     std::string LibFileName;
     if (Shared) {
-      LibFileName = (SharedPrefix + Lib + "." + SharedExt).str();
+      if (Lib == DyLibName) {
+        // Treat the DyLibName specially. It is not a component library and
+        // already has the necessary prefix and suffix (e.g. `.so`) added so
+        // just return it unmodified.
+        assert(Lib.endswith(SharedExt) && "DyLib is missing suffix");
+        LibFileName = Lib;
+      } else {
+        LibFileName = (SharedPrefix + Lib + "." + SharedExt).str();
+      }
     } else {
       // default to static
       LibFileName = (StaticPrefix + Lib + "." + StaticExt).str();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27393.81150.patch
Type: text/x-patch
Size: 945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161212/0e20c026/attachment.bin>


More information about the llvm-commits mailing list