[PATCH] D77515: [mlir] Remove need for static global ctors from mlir-translate

Jonathan Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 14:10:37 PDT 2020


jroelofs added a comment.

I tried this out with `BUILD_SHARED_LIBS=ON`, and unfortunately ran into a problem with the way this custom rtti behaves across dso's:

https://github.com/llvm/llvm-project/blob/549e87f3d04bbae91bc7bc38609ce7073e2c8a6d/mlir/include/mlir/Support/STLExtras.h#L101

That variable gets marked `dso_local` even if the function is `inline`, meaning that different instances of it in each shared lib have different addresses, breaking the traits implementation.

Discussion on Discord pointed at this thread, which has more info: https://llvm.discourse.group/t/shared-library-support/381/5

Should fixing that be a blocker to landing this patch?

If not, should we have a top-level message indicating that it doesn't work (yet)?

  if(BUILD_SHARED_LIBS)
    message(WARNING "This isn't going to behave well at runtime")
  endif()


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77515/new/

https://reviews.llvm.org/D77515





More information about the llvm-commits mailing list