<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 4:35 PM, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">silvas added a subscriber: silvas.<br>
<br>
================<br>
Comment at: lib/profile/InstrProfilingFile.c:86<br>
@@ -74,2 +85,3 @@<br>
   const char *Filename;<br>
+#ifdef _MSC_VER<br>
   FILE *File;<br>
----------------<br>
Let's split this change into a separate patch for a focused discussion on the requirements and possible solutions.<br>
<br>
================<br>
Comment at: lib/profile/InstrProfilingReduce.c:1<br>
@@ +1,2 @@<br>
+/*===- InstrProfilingReduce.c - Support library for applications using MPI ===*\<br>
+|*<br>
----------------<br>
Let's call this InstrProfilingMPI.c consistent with the comment.<br>
<span class=""><br>
================<br>
Comment at: lib/profile/InstrProfilingStub.c:14<br>
@@ +13,2 @@<br>
+void MPI_Reduce() { abort(); }<br>
+void PMPI_Finalize() { abort(); }<br>
----------------<br>
</span><span class="">davidxl wrote:<br>
> Is the MPI library defining thse functions  static or a DSO? If the former, then perhaps declare those stubs weak so that we don't rely on the link order of the runtime library<br>
</span>Why do we need these stubs?<br>
<br></blockquote><div><br></div><div>I thought it is needed when the binary is not linked with mpi library, but InstrProfilingReduce.o is linked in. Now that you asked, it seems that for that case, InstrProfilingReduce.o should not be linked in at all.</div><div><br></div><div>I think the culprit is that __llvm_write_profile_data flag is defined in that file. With my suggestion to move it to InstrProfiling.c,  I think there is no need for the stub file. Good catch.</div><div><br></div><div>David</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<a href="http://reviews.llvm.org/D18013" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18013</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>