[PATCH] D10716: Fix `llvm-config` to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components.

JF Bastien jfb at chromium.org
Tue Jul 7 14:25:29 PDT 2015


lgtm after this change.


================
Comment at: tools/llvm-config/llvm-config.cpp:402
@@ -366,1 +401,3 @@
+            } while(false);
+            if (FromEnd != 0) { continue; }
           }
----------------
Taking a second look at this, could you restructure to:


```
          if (Lib.startswith("lib")) {
            size_t FromEnd = 0;
            if (Lib.endswith(".a")) {
              FromEnd = 2;
            } else if (Lib.endswith(".so")) {
              FromEnd = 3;
            } else if (Lib.endswith(".dylib")) {
              FromEnd = 6;
            } else {
              FromEnd = 0;
              break;
            }
            OS << "-l" << Lib.slice(3, Lib.size() - FromEnd);
            continue;
```


Repository:
  rL LLVM

http://reviews.llvm.org/D10716







More information about the llvm-commits mailing list