Oscar, after working for several hours to fix two intertwined bugs in the dependencies generated for LLVM, I can't fix it fully. I can teach the scripts to detect vtable dependencies, but there are other dependencies being missed as well.<div>
<br></div><div>Fundamentally, the fact that we've had to hack around one implicit dep failure in the CMakeFiles themselves is indicative that this system isn't working.</div><div><br></div><div>I'm now working on completely removing this aspect of LLVM's CMake build, and replacing it with explicit dependencies, spelled out locally to each CMake target. I think this is the best strategy going forward for the following reasons:</div>
<div>1) It can express dependencies we can't auto-detect such as TableGen dependencies.</div><div>2) It isn't subject to optimization levels or toolchains.</div><div>3) It is *easier* to update for those not using CMake: the references of note are located locally to the code being changed.</div>
<div>4) Fundamentally, there aren't enough libraries for these to change rapidly or often. Therefore, it seems very unlikely this will be a major maintenance burden (especially compared with the burden of maintaining explicit source file lists).</div>
<div><br></div><div>After several discussions on IRC, almost every user of CMake there agreed with this move. Doug and I both have advocated for this for a long time.</div><div><br></div><div>My plan is to check this in somewhat as an experiment, and explicitly tell non-CMake users to not worry about updating them. Myself and a few others who are constantly using CMake can maintain them and make sure they don't become a huge burden to update.</div>
<div><br></div><div>Any objections, shout out now! =D I'm hoping to do this really really soon as my builds and several others are completely broken due to failures not fixed by the patch you committed.</div><div><br>
</div><div>-Chandler</div><div><br><div class="gmail_quote">On Wed, Jul 27, 2011 at 8:16 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote">On Wed, Jul 27, 2011 at 7:33 PM, Oscar Fuentes <span dir="ltr"><<a href="mailto:ofv@wanadoo.es" target="_blank">ofv@wanadoo.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>Explicitly declare a library dependency of LLVM*Desc to<br>
LLVM*AsmPrinter.<br>
<br>
GenLibDeps.pl fails to detect vtable references. As this is the only<br>
referenced symbol from LLVM*Desc to LLVM*AsmPrinter on optimized<br>
builds, the algorithm that creates the list of libraries to be linked<br>
into tools doesn't know about the dependency and sometimes places the<br>
libraries on the wrong order, yielding error messages like this:<br></div></blockquote></div><br><div>Ahh, I see, you handled like this.</div><div><br></div><div>This really doesn't work. Clearly our automated process is deeply flawed if it can't handle this. Have you been looking at *why* it can't handle it? Are you trying to figure out the root cause?</div>

<div><br></div><div>(I have been for the past 2 hours, which is why I haven't committed a fix yet...)</div>
</blockquote></div><br></div>