[PATCH] D64651: [Driver] Support file paths with -ccc-gcc-name

Alex James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 12 11:20:54 PDT 2019


al3xtjames created this revision.
al3xtjames added a reviewer: llvm-commits.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When a file path is specified for gcc-name, don't prepend the target
triple. This allows -target and -ccc-gcc-name to be used together when
a file path is used.


Repository:
  rC Clang

https://reviews.llvm.org/D64651

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp


Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -188,7 +188,12 @@
   } else
     GCCName = "gcc";
 
-  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
+  const char *Exec;
+  if (llvm::sys::fs::exists(GCCName))
+    Exec = GCCName;
+  else
+    Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
+
   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64651.209540.patch
Type: text/x-patch
Size: 575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190712/b3b353ef/attachment.bin>


More information about the cfe-commits mailing list