MaskRay added a comment. A probably better approach is to use something like `TC.getCompilerRT(Args, "profile")`. The function returns a full path which can avoid `-L` problems.
std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component, FileType Type) const { const llvm::Triple &TT = getTriple(); bool IsITANMSVCWindows = TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment(); const char *Prefix = IsITANMSVCWindows || Type == ToolChain::FT_Object ? "" : "lib"; const char *Suffix; switch (Type) { case ToolChain::FT_Object: Suffix = IsITANMSVCWindows ? ".obj" : ".o"; break; case ToolChain::FT_Static: Suffix = IsITANMSVCWindows ? ".lib" : ".a"; break; case ToolChain::FT_Shared: Suffix = Triple.isOSWindows() ? (Triple.isWindowsGNUEnvironment() ? ".dll.a" : ".lib") : ".so"; break; } for (const auto &LibPath : getLibraryPaths()) { SmallString<128> P(LibPath); llvm::sys::path::append(P, Prefix + Twine("clang_rt.") + Component + Suffix); if (getVFS().exists(P)) return std::string(P.str()); } StringRef Arch = getArchNameForCompilerRTLib(*this, Args); const char *Env = TT.isAndroid() ? "-android" : ""; SmallString<128> Path(getCompilerRTPath()); llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" + Arch + Env + Suffix); return std::string(Path.str()); } CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73904/new/ https://reviews.llvm.org/D73904 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits