This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Improve LLVM shlib support
ClosedPublic

Authored by serge-sans-paille on Oct 5 2020, 12:46 PM.

Details

Summary

mlir-tblgen was incompatible with libLLVM, due to explicit linkage with libLLVMSupport etc.
As it cannot link with libLLVM, make sure all lib it uses are not using libLLVM either.

As a side effect, also remove some explicit references to LLVM libs and use components instead.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2020, 12:46 PM
serge-sans-paille requested review of this revision.Oct 5 2020, 12:46 PM

Thanks for this!

mlir/lib/Support/CMakeLists.txt
34–41

Good catch!

This revision is now accepted and ready to land.Oct 8 2020, 10:54 AM
vchuravy accepted this revision.Oct 8 2020, 11:52 AM
This revision was automatically updated to reflect the committed changes.
awarzynski added a subscriber: awarzynski.EditedOct 9 2020, 3:01 AM

Hi @serge-sans-paille, thanks for working on this!

Sadly, our Flang buildbots that set BUILD_SHARED_LIBS to ON are currently failing, e.g. http://lab.llvm.org:8014/#/builders/26. These buildbots are still in the staging area so no notifications are sent. Also, there have been other breaking changes submitted and subsequently reverted recently, so it's not obvious that _this_ is the problematic change. I wish that we had better and more robust pre-commit testing :)

Anyway, I reverted the changes in mlir/tools/mlir-tblgen/CMakeLists.txt locally and that fixed the build for me: https://reviews.llvm.org/D89111. Please, could you take a look? I'm not that familiar with the CMake magic happening here (though to me this patch looks good!). Thank you!