| 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 "Tools.h" | 10 #include "Tools.h" |
| (...skipping 8205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8216 // handled somewhere else. | 8216 // handled somewhere else. |
| 8217 Args.ClaimAllArgs(options::OPT_w); | 8217 Args.ClaimAllArgs(options::OPT_w); |
| 8218 // Silence warning for libgcc since we only support compiler-rt. | 8218 // Silence warning for libgcc since we only support compiler-rt. |
| 8219 Args.ClaimAllArgs(options::OPT_shared_libgcc); | 8219 Args.ClaimAllArgs(options::OPT_shared_libgcc); |
| 8220 Args.ClaimAllArgs(options::OPT_static_libgcc); | 8220 Args.ClaimAllArgs(options::OPT_static_libgcc); |
| 8221 | 8221 |
| 8222 if (!D.SysRoot.empty()) | 8222 if (!D.SysRoot.empty()) |
| 8223 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); | 8223 CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); |
| 8224 | 8224 |
| 8225 if (Arg *A = Args.getLastArg(options::OPT_shared, | 8225 if (Arg *A = Args.getLastArg(options::OPT_shared, |
| 8226 options::OPT_dynamic, | 8226 options::OPT_dynamic)) |
| 8227 options::OPT_rdynamic)) | |
| 8228 D.Diag(diag::err_drv_unsupported_opt) << A->getOption().getName(); | 8227 D.Diag(diag::err_drv_unsupported_opt) << A->getOption().getName(); |
| 8229 | 8228 |
| 8229 // This option does not currently have any effect for bitcode linking, |
| 8230 // but we support it for backwards compatibility with the legacy driver |
| 8231 // and existing software packages. |
| 8232 if (Args.hasArg(options::OPT_rdynamic)) |
| 8233 CmdArgs.push_back("-export-dynamic"); |
| 8234 |
| 8230 std::string TripleStr = ToolChain.ComputeEffectiveClangTriple(Args); | 8235 std::string TripleStr = ToolChain.ComputeEffectiveClangTriple(Args); |
| 8231 if (ToolChain.getArch() != llvm::Triple::le32) | 8236 if (ToolChain.getArch() != llvm::Triple::le32) |
| 8232 D.Diag(diag::err_target_unsupported_arch) << ToolChain.getArchName() | 8237 D.Diag(diag::err_target_unsupported_arch) << ToolChain.getArchName() |
| 8233 << TripleStr; | 8238 << TripleStr; |
| 8234 | 8239 |
| 8235 Args.AddAllArgs(CmdArgs, options::OPT_static); | 8240 Args.AddAllArgs(CmdArgs, options::OPT_static); |
| 8236 if (!Args.hasArg(options::OPT_static)) | 8241 if (!Args.hasArg(options::OPT_static)) |
| 8237 CmdArgs.push_back("-static"); | 8242 CmdArgs.push_back("-static"); |
| 8238 | 8243 |
| 8239 bool EH = exceptionSettings(Args, ToolChain.getTriple()); | 8244 bool EH = exceptionSettings(Args, ToolChain.getTriple()); |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9122 CmdArgs.push_back("-lmsvcrt"); | 9127 CmdArgs.push_back("-lmsvcrt"); |
| 9123 AddRunTimeLibs(TC, D, CmdArgs, Args); | 9128 AddRunTimeLibs(TC, D, CmdArgs, Args); |
| 9124 } | 9129 } |
| 9125 } | 9130 } |
| 9126 | 9131 |
| 9127 const std::string Linker = TC.GetProgramPath("ld"); | 9132 const std::string Linker = TC.GetProgramPath("ld"); |
| 9128 Exec = Args.MakeArgString(Linker); | 9133 Exec = Args.MakeArgString(Linker); |
| 9129 | 9134 |
| 9130 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs)); | 9135 C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs)); |
| 9131 } | 9136 } |
| OLD | NEW |