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

Michael Francis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 9 17:22:19 PST 2022


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

Update the recently-added test cases


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
  clang/test/Driver/aix-ld.c


Index: clang/test/Driver/aix-ld.c
===================================================================
--- clang/test/Driver/aix-ld.c
+++ clang/test/Driver/aix-ld.c
@@ -135,6 +135,8 @@
 // CHECK-LD32-PROF-NOT: "--no-as-needed"
 // CHECK-LD32-PROF-NOT: "-lm"
 // CHECK-LD32-PROF:     "-lc"
+// CHECK-LD32-PROF:     "-L/lib/profiled"
+// CHECK-LD32-PROF:     "-L/usr/lib/profiled"
 
 // Check powerpc64-ibm-aix7.1.0.0, 64-bit. Enable profiling.
 // RUN: %clang %s -### 2>&1 \
@@ -162,6 +164,8 @@
 // CHECK-LD64-PROF-NOT: "--no-as-needed"
 // CHECK-LD64-PROF-NOT: "-lm"
 // CHECK-LD64-PROF:     "-lc"
+// CHECK-LD64-PROF:     "-L/lib/profiled"
+// CHECK-LD64-PROF:     "-L/usr/lib/profiled"
 
 // Check powerpc-ibm-aix7.1.0.0, 32-bit. Enable g-profiling.
 // RUN: %clang %s -### 2>&1 \
@@ -189,6 +193,8 @@
 // CHECK-LD32-GPROF-NOT: "--no-as-needed"
 // CHECK-LD32-GPROF-NOT: "-lm"
 // CHECK-LD32-GPROF:     "-lc"
+// CHECK-LD32-GPROF:     "-L/lib/profiled"
+// CHECK-LD32-GPROF:     "-L/usr/lib/profiled"
 
 // Check powerpc64-ibm-aix7.1.0.0, 64-bit. Enable g-profiling.
 // RUN: %clang %s -### 2>&1 \
@@ -216,6 +222,8 @@
 // CHECK-LD64-GPROF-NOT: "--no-as-needed"
 // CHECK-LD64-GPROF-NOT: "-lm"
 // CHECK-LD64-GPROF:     "-lc"
+// CHECK-LD64-GPROF:     "-L/lib/profiled"
+// CHECK-LD64-GPROF:     "-L/usr/lib/profiled"
 
 // Check powerpc-ibm-aix7.1.0.0, 32-bit. Static linking.
 // RUN: %clang %s -### 2>&1 \
Index: clang/lib/Driver/ToolChains/AIX.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AIX.cpp
+++ clang/lib/Driver/ToolChains/AIX.cpp
@@ -250,6 +250,11 @@
       CmdArgs.push_back("-lm");
 
     CmdArgs.push_back("-lc");
+
+    if (Args.hasArg(options::OPT_pg)) {
+      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.474396.patch
Type: text/x-patch
Size: 1906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221110/c2e82f09/attachment-0001.bin>


More information about the cfe-commits mailing list