Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is great. I also just sent out https://reviews.llvm.org/D77514 to clean up the internal registration facilities.
Thanks for doing this, it will definitely simplify many things about the way linkage is done.
mlir/include/mlir/InitAllTranslations.h | ||
---|---|---|
31 | nit: "init_once" is a little misleading, since this doesn't actually ensure that. | |
mlir/test/EDSC/CMakeLists.txt | ||
24–30 | Please verify these changes with BUILD_SHARED_LIBS=on. It should have been the case that the whole_archive_link an link_libraries were mutually exclusive, so I'd expect that all of these need to go in a target_link_libraries instead. |
mlir/include/mlir/InitAllTranslations.h | ||
---|---|---|
31 | Thought that was guaranteed with this pattern C++. What case am I missing?
https://en.cppreference.com/w/cpp/language/storage_duration#Static_local_variables | |
mlir/test/EDSC/CMakeLists.txt | ||
24–30 |
Currently building that config again. That that fell over is what led me down this rabbit hole in the first place :)
Unless I misunderstood, they're there already. |
mlir/test/EDSC/CMakeLists.txt | ||
---|---|---|
24–30 |
Good call. This broke a bunch of test runners. Investigating. |
mlir/include/mlir/InitAllTranslations.h | ||
---|---|---|
31 | You're right.. I misparsed the code when I scanned it. |
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:
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()
mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp | ||
---|---|---|
72 | Please remove the extra semicolon here. |
I patched this locally and tried to build with BUILD_SHARED_LIBS=ON but the tests are passing for me? Anything specific to configure?
snip
Should fixing that be a blocker to landing this patch?
Per discussion on Discord, I'll land this patch without solving that, since it's an incremental improvement and doesn't regress the behavior here.
nit: "init_once" is a little misleading, since this doesn't actually ensure that.