[PATCH] D137375: [AIX][pg] Add Correct Search Paths for Profiled Libraries

Michael Francis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 13 10:55:49 PST 2022


francii updated this revision to Diff 475007.
francii added a comment.

Soft reset


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137375/new/

https://reviews.llvm.org/D137375

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


Index: clang/lib/Driver/ToolChains/AIX.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AIX.cpp
+++ clang/lib/Driver/ToolChains/AIX.cpp
@@ -243,6 +243,18 @@
       CmdArgs.push_back("-lm");
 
     CmdArgs.push_back("-lc");
+
+    if (Args.hasArg(options::OPT_pg)) {
+      if (!D.SysRoot.empty()) {
+        CmdArgs.push_back(Args.MakeArgString((llvm::Twine("-L") + D.SysRoot) +
+                                             "/lib/profiled"));
+        CmdArgs.push_back(Args.MakeArgString((llvm::Twine("-L") + D.SysRoot) +
+                                             "/usr/lib/profiled"));
+      } else {
+        CmdArgs.push_back("-L/lib/profiled");
+        CmdArgs.push_back("-L/usr/lib/profiled");
+      }
+    }
   }
 
   const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137375.475007.patch
Type: text/x-patch
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221113/195214b8/attachment.bin>


More information about the cfe-commits mailing list