]> granicus.if.org Git - clang/commitdiff
[Hexagon] Use GetLinkerPath instead of hard-coded string.
authorSid Manning <sidneym@codeaurora.org>
Wed, 10 Oct 2018 15:37:03 +0000 (15:37 +0000)
committerSid Manning <sidneym@codeaurora.org>
Wed, 10 Oct 2018 15:37:03 +0000 (15:37 +0000)
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

lib/Driver/ToolChains/Hexagon.cpp
lib/Driver/ToolChains/Hexagon.h

index b4f299ab10e27ad48363273e2114b84bcd6903d9..8778a1a30fd20ffe9bc5f10c6b1b586e4b716187 100644 (file)
@@ -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<Command>(JA, *this, Args.MakeArgString(Linker),
-                                          CmdArgs, Inputs));
+  const char *Exec = Args.MakeArgString(HTC.GetLinkerPath());
+  C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
 }
 // Hexagon tools end.
 
index e43b8a5b8800039efdcaefd3832905ab7b115dc4..a9e599de7ae53dadd3ced86292758809d8f33216 100644 (file)
@@ -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; }