From: Sid Manning Date: Wed, 10 Oct 2018 15:37:03 +0000 (+0000) Subject: [Hexagon] Use GetLinkerPath instead of hard-coded string. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=994f2e635a14a92dbf4f8496da6c735f6b3f46ab;p=clang [Hexagon] Use GetLinkerPath instead of hard-coded string. Add GetLinkerPath and set the default to "hexagon-link". Use GetLinkerPath instead of the hard-coded string. This change will allow -fuse-ld to function correctly. Differential revision: https://reviews.llvm.org/D53038 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344147 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Hexagon.cpp b/lib/Driver/ToolChains/Hexagon.cpp index b4f299ab10..8778a1a30f 100644 --- a/lib/Driver/ToolChains/Hexagon.cpp +++ b/lib/Driver/ToolChains/Hexagon.cpp @@ -369,9 +369,8 @@ void hexagon::Linker::ConstructJob(Compilation &C, const JobAction &JA, constructHexagonLinkArgs(C, JA, HTC, Output, Inputs, Args, CmdArgs, LinkingOutput); - std::string Linker = HTC.GetProgramPath("hexagon-link"); - C.addCommand(llvm::make_unique(JA, *this, Args.MakeArgString(Linker), - CmdArgs, Inputs)); + const char *Exec = Args.MakeArgString(HTC.GetLinkerPath()); + C.addCommand(llvm::make_unique(JA, *this, Exec, CmdArgs, Inputs)); } // Hexagon tools end. diff --git a/lib/Driver/ToolChains/Hexagon.h b/lib/Driver/ToolChains/Hexagon.h index e43b8a5b88..a9e599de7a 100644 --- a/lib/Driver/ToolChains/Hexagon.h +++ b/lib/Driver/ToolChains/Hexagon.h @@ -81,6 +81,9 @@ public: void addLibStdCxxIncludePaths( const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; + + const char *getDefaultLinker() const override { return "hexagon-link"; } + CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override; StringRef GetGCCLibAndIncVersion() const { return GCCLibAndIncVersion.Text; }