| OLD | NEW |
| 1 //===--- Tools.cpp - Tools Implementations --------------------------------===// | 1 //===--- Tools.cpp - Tools Implementations --------------------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 | 9 |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 // whole-archive. | 1664 // whole-archive. |
| 1665 SmallVector<const char *, 3> LibSanitizerArgs; | 1665 SmallVector<const char *, 3> LibSanitizerArgs; |
| 1666 LibSanitizerArgs.push_back("-whole-archive"); | 1666 LibSanitizerArgs.push_back("-whole-archive"); |
| 1667 LibSanitizerArgs.push_back(Args.MakeArgString(LibSanitizer)); | 1667 LibSanitizerArgs.push_back(Args.MakeArgString(LibSanitizer)); |
| 1668 LibSanitizerArgs.push_back("-no-whole-archive"); | 1668 LibSanitizerArgs.push_back("-no-whole-archive"); |
| 1669 | 1669 |
| 1670 CmdArgs.insert(BeforeLibStdCXX ? CmdArgs.begin() : CmdArgs.end(), | 1670 CmdArgs.insert(BeforeLibStdCXX ? CmdArgs.begin() : CmdArgs.end(), |
| 1671 LibSanitizerArgs.begin(), LibSanitizerArgs.end()); | 1671 LibSanitizerArgs.begin(), LibSanitizerArgs.end()); |
| 1672 | 1672 |
| 1673 CmdArgs.push_back("-lpthread"); | 1673 CmdArgs.push_back("-lpthread"); |
| 1674 CmdArgs.push_back("-lrt"); | |
| 1675 CmdArgs.push_back("-ldl"); | 1674 CmdArgs.push_back("-ldl"); |
| 1676 | 1675 |
| 1677 // If possible, use a dynamic symbols file to export the symbols from the | 1676 // If possible, use a dynamic symbols file to export the symbols from the |
| 1678 // runtime library. If we can't do so, use -export-dynamic instead to export | 1677 // runtime library. If we can't do so, use -export-dynamic instead to export |
| 1679 // all symbols from the binary. | 1678 // all symbols from the binary. |
| 1680 if (ExportSymbols) { | 1679 if (ExportSymbols) { |
| 1681 if (llvm::sys::fs::exists(LibSanitizer + ".syms")) | 1680 if (llvm::sys::fs::exists(LibSanitizer + ".syms")) |
| 1682 CmdArgs.push_back( | 1681 CmdArgs.push_back( |
| 1683 Args.MakeArgString("--dynamic-list=" + LibSanitizer + ".syms")); | 1682 Args.MakeArgString("--dynamic-list=" + LibSanitizer + ".syms")); |
| 1684 else | 1683 else |
| (...skipping 4765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6450 for (InputInfoList::const_iterator | 6449 for (InputInfoList::const_iterator |
| 6451 it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) { | 6450 it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) { |
| 6452 if (it->isFilename()) | 6451 if (it->isFilename()) |
| 6453 CmdArgs.push_back(it->getFilename()); | 6452 CmdArgs.push_back(it->getFilename()); |
| 6454 } | 6453 } |
| 6455 | 6454 |
| 6456 const char *Exec = | 6455 const char *Exec = |
| 6457 Args.MakeArgString(getToolChain().GetProgramPath("link.exe")); | 6456 Args.MakeArgString(getToolChain().GetProgramPath("link.exe")); |
| 6458 C.addCommand(new Command(JA, *this, Exec, CmdArgs)); | 6457 C.addCommand(new Command(JA, *this, Exec, CmdArgs)); |
| 6459 } | 6458 } |
| OLD | NEW |