[PATCH] D53038: [Hexagon] Use GetLinkerPath method instead of hard-coded linker name.

2018-10-09 Thread Sid Manning via Phabricator via cfe-commits
sidneym created this revision.
sidneym added reviewers: shankare, ruiu, kparzysz, bcain.
Herald added a subscriber: cfe-commits.

Use GetLinkerPath method instead of hard-coding linker name.

Change should allow -fuse-ld to work on the Hexagon target.


Repository:
  rC Clang

https://reviews.llvm.org/D53038

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


Index: lib/Driver/ToolChains/Hexagon.h
===
--- lib/Driver/ToolChains/Hexagon.h
+++ lib/Driver/ToolChains/Hexagon.h
@@ -81,6 +81,9 @@
   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; }
Index: lib/Driver/ToolChains/Hexagon.cpp
===
--- lib/Driver/ToolChains/Hexagon.cpp
+++ lib/Driver/ToolChains/Hexagon.cpp
@@ -369,9 +369,8 @@
   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.
 


Index: lib/Driver/ToolChains/Hexagon.h
===
--- lib/Driver/ToolChains/Hexagon.h
+++ lib/Driver/ToolChains/Hexagon.h
@@ -81,6 +81,9 @@
   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; }
Index: lib/Driver/ToolChains/Hexagon.cpp
===
--- lib/Driver/ToolChains/Hexagon.cpp
+++ lib/Driver/ToolChains/Hexagon.cpp
@@ -369,9 +369,8 @@
   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.
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53038: [Hexagon] Use GetLinkerPath method instead of hard-coded linker name.

2018-10-10 Thread Sid Manning via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC344147: [Hexagon] Use GetLinkerPath instead of hard-coded 
string. (authored by sidneym, committed by ).

Repository:
  rC Clang

https://reviews.llvm.org/D53038

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


Index: lib/Driver/ToolChains/Hexagon.cpp
===
--- lib/Driver/ToolChains/Hexagon.cpp
+++ lib/Driver/ToolChains/Hexagon.cpp
@@ -369,9 +369,8 @@
   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.
 
Index: lib/Driver/ToolChains/Hexagon.h
===
--- lib/Driver/ToolChains/Hexagon.h
+++ lib/Driver/ToolChains/Hexagon.h
@@ -81,6 +81,9 @@
   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; }


Index: lib/Driver/ToolChains/Hexagon.cpp
===
--- lib/Driver/ToolChains/Hexagon.cpp
+++ lib/Driver/ToolChains/Hexagon.cpp
@@ -369,9 +369,8 @@
   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.
 
Index: lib/Driver/ToolChains/Hexagon.h
===
--- lib/Driver/ToolChains/Hexagon.h
+++ lib/Driver/ToolChains/Hexagon.h
@@ -81,6 +81,9 @@
   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; }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53038: [Hexagon] Use GetLinkerPath method instead of hard-coded linker name.

2018-10-12 Thread David Zarzycki via Phabricator via cfe-commits
davezarzycki added a comment.

A bisect revealed this change as the source of test failures on my Red Hat 
Fedora 28 Linux box. How was/is this tested?

Command Output (stderr):


/home/dave/s/lc/tools/clang/test/Driver/linux-ld.c:882:19: error: 
CHECK-HEXAGON: expected string not found in input
// CHECK-HEXAGON: "{{.*}}hexagon-link{{(.exe)?}}"

  ^

:1:1: note: scanning from here
clang version 8.0.0 (https://git.llvm.org/git/clang.git 
efe41bf98e6011bb413a5056f0025a4509de860d) (https://git.llvm.org/git/llvm.git 
638941f488dd9d1b1b9d49913240fdc2beec56a0)
^
:2:3: note: possible intended match here
Target: hexagon-unknown-linux-gnu

  ^

-



Testing Time: 43.34s



Failing Tests (2):

Clang :: Driver/hexagon-toolchain-elf.c
Clang :: Driver/linux-ld.c
  
  Expected Passes: 34506
  Expected Failures  : 82
  Unsupported Tests  : 8838
  Unexpected Failures: 2

FAILED: CMakeFiles/check-all


Repository:
  rC Clang

https://reviews.llvm.org/D53038



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53038: [Hexagon] Use GetLinkerPath method instead of hard-coded linker name.

2018-10-12 Thread Sid Manning via Phabricator via cfe-commits
sidneym added a comment.

Seems like the test cases do not consider the possibility of 
CLANG_DEFAULT_LINKER being set.  If CLANG_DEFAULT_LINKER was set to 
"hexagon-link" these tests would probably pass.

I'm checking this out now.


Repository:
  rC Clang

https://reviews.llvm.org/D53038



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53038: [Hexagon] Use GetLinkerPath method instead of hard-coded linker name.

2018-10-12 Thread Sid Manning via Phabricator via cfe-commits
sidneym added a comment.

I updated the tests: https://reviews.llvm.org/D53219


Repository:
  rC Clang

https://reviews.llvm.org/D53038



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits