Index: llvm/tools/llvm-config/llvm-config.cpp =================================================================== --- llvm/tools/llvm-config/llvm-config.cpp +++ llvm/tools/llvm-config/llvm-config.cpp @@ -278,8 +278,7 @@ } else if (Arg == "--cxxflags") { OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n'; } else if (Arg == "--ldflags") { - OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS - << ' ' << LLVM_SYSTEM_LIBS << '\n'; + OS << "-L" << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n'; } else if (Arg == "--libs") { PrintLibs = true; } else if (Arg == "--libnames") { @@ -358,6 +357,12 @@ OS << ActiveLibDir << '/' << Lib; } } + + // Assume LLVMSupport depends on system_libs. + // FIXME: LLVMBuild may take care of dependencies to system_libs. + if (PrintLibs) + OS << ' ' << LLVM_SYSTEM_LIBS << '\n'; + OS << '\n'; } else if (!Components.empty()) { errs() << "llvm-config: error: components given, but unused\n\n";