[PATCH] D67385: Pass -mcmodel to gold-pulgin

陳冠旭 via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 10 00:01:30 PDT 2019


khchen created this revision.
Herald added subscribers: dexonsmith, mehdi_amini.
Herald added a project: clang.

If user gives the -mcmodel with -flto, we need to pass -mcmodel to gold-pulgin.


Repository:
  rC Clang

https://reviews.llvm.org/D67385

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


Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -396,6 +396,12 @@
       CmdArgs.push_back(Args.MakeArgString(Twine("-plugin-opt=O") + OOpt));
   }
 
+  if (const Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) {
+    StringRef ModelArg = A->getValue();
+    CmdArgs.push_back(
+        Args.MakeArgString(Twine("-plugin-opt=--code-model=") + ModelArg));
+  }
+
   if (Args.hasArg(options::OPT_gsplit_dwarf)) {
     CmdArgs.push_back(
         Args.MakeArgString(Twine("-plugin-opt=dwo_dir=") +


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67385.219479.patch
Type: text/x-patch
Size: 665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190910/a595a0ca/attachment-0001.bin>


More information about the cfe-commits mailing list