This is an archive of the discontinued LLVM Phabricator instance.

Don't link any LLVM/MLIR library to the C API unit-test
ClosedPublic

Authored by mehdi_amini on Nov 6 2020, 5:39 PM.

Details

Summary

The tests are intended to exercise the public C API and will link to a
specific shared library exposing only the C API, this library itself may
link to libMLIR.so.
If we link some LLVM library statically in the test themselves, we end
up with duplicated cl::opt registrations in LLVM. A possible setup if
these libraries were needed could be to link libMLIR.so directly when
available and link statically when it isn't available (in which case the
libary exposing the C API would be statically link and isolated from the
cl::opt registry, hopefully).

Diff Detail

Event Timeline

mehdi_amini created this revision.Nov 6 2020, 5:39 PM
mehdi_amini requested review of this revision.Nov 6 2020, 5:39 PM
stellaraccident accepted this revision.Nov 6 2020, 5:53 PM

Thanks, Mehdi! This helps unblock the dynamic linking work, and gives us some time to ponder a more holistic design.

This revision is now accepted and ready to land.Nov 6 2020, 5:53 PM
This revision was landed with ongoing or failed builds.Nov 6 2020, 5:55 PM
This revision was automatically updated to reflect the committed changes.