summaryrefslogtreecommitdiff
path: root/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-config/llvm-config.cpp')
-rw-r--r--tools/llvm-config/llvm-config.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
index 58571cc59b797..e8afcbaaf4852 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -698,8 +698,12 @@ int main(int argc, char **argv) {
// Print SYSTEM_LIBS after --libs.
// FIXME: Each LLVM component may have its dependent system libs.
- if (PrintSystemLibs)
- OS << LLVM_SYSTEM_LIBS << '\n';
+ if (PrintSystemLibs) {
+ // Output system libraries only if linking against a static
+ // library (since the shared library links to all system libs
+ // already)
+ OS << (LinkMode == LinkModeStatic ? LLVM_SYSTEM_LIBS : "") << '\n';
+ }
} else if (!Components.empty()) {
errs() << "llvm-config: error: components given, but unused\n\n";
usage();