[PATCH] D155290: [PGO] Use Unique Profile Files when New Processes are Forked

wael yehia via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 21 05:22:10 PDT 2023


w2yehia added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:440
+  if (NeedsProfileRT || needsGCovInstrumentation(Args))
+    CmdArgs.push_back("-lpthreads");
+
----------------
The change in `compiler-rt/lib/profile/InstrProfilingFile.c` affects non-AIX platforms too, so won't they need `-lpthreads` too?



================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:440
+  if (NeedsProfileRT || needsGCovInstrumentation(Args))
+    CmdArgs.push_back("-lpthreads");
+
----------------
w2yehia wrote:
> The change in `compiler-rt/lib/profile/InstrProfilingFile.c` affects non-AIX platforms too, so won't they need `-lpthreads` too?
> 
In order to avoid adding -lpthreads, we can leave it to the user to decide whether to add or not (i.e. they would add -lpthreads to their application's link command if they want to).
And so to avoid a link error due to undefined symbol, we can define `pthread_atfork` as a weak empty stub in the compiler-rt.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155290



More information about the cfe-commits mailing list