Chandler Carruth
2011-Jul-28 04:11 UTC
[LLVMdev] Switching LLVM CMake build to use explicit dependencies, and completely removing implicit dependency re-generation
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. 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. 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: 1) It can express dependencies we can't auto-detect such as TableGen dependencies. 2) It isn't subject to optimization levels or toolchains. 3) It is *easier* to update for those not using CMake: the references of note are located locally to the code being changed. 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). 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. 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. 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. -Chandler On Wed, Jul 27, 2011 at 8:16 PM, Chandler Carruth <chandlerc at google.com>wrote:> On Wed, Jul 27, 2011 at 7:33 PM, Oscar Fuentes <ofv at wanadoo.es> wrote: > >> Explicitly declare a library dependency of LLVM*Desc to >> LLVM*AsmPrinter. >> >> GenLibDeps.pl fails to detect vtable references. As this is the only >> referenced symbol from LLVM*Desc to LLVM*AsmPrinter on optimized >> builds, the algorithm that creates the list of libraries to be linked >> into tools doesn't know about the dependency and sometimes places the >> libraries on the wrong order, yielding error messages like this: >> > > Ahh, I see, you handled like this. > > 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? > > (I have been for the past 2 hours, which is why I haven't committed a fix > yet...) >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110727/ddb20007/attachment.html>
Óscar Fuentes
2011-Jul-28 04:49 UTC
[LLVMdev] Switching LLVM CMake build to use explicit dependencies, and completely removing implicit dependency re-generation
Chandler Carruth <chandlerc at google.com> writes: [snip]> Any objections, shout out now! =DYes, I have objections. This was already discussed with Doug on the past and I won't waste my time rehashing the topic. Just one observation: it would be a big mistake to not make the same switch on the traditional build as well. Why? because the automatic library dependency detection system is the same and because people will not remember to update the library dependencies in cmake if they are not required to update them in the makefiles too.> 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.If this change fixes problems with the build (as much as I'll like to see the corresponding bug reports) the Right Thing is to apply it. I retire from the informal role of maintainer of the cmake build, not in disgust, but just due to differences of opinion about how the build must work to provide the best service to its users. As a LLVM user I will be happy as long as the build works. Otherwise I'll mail-bomb you with bug reports :-)