[PATCH] D146405: [mlir][Bazel] Avoid __attribute__((weak)) for MSVC.

Adrian Kuegel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 01:49:42 PDT 2023


akuegel added a comment.

In D146405#4205618 <https://reviews.llvm.org/D146405#4205618>, @csigg wrote:

> It seems this would result in duplicate definitions of `mlir::registerGpuSerializeToCubinPass()` on Windows.
>
> Maybe we could use /alternatename <https://devblogs.microsoft.com/oldnewthing/20200731-00/?p=104024>? 
> I'm not sure how to handle mangled names though.
>
> Alternatively, the above article also links to this approach <https://devblogs.microsoft.com/oldnewthing/20130109-00/?p=5613>, but getting bazel (and CMake) to link in a specific way might be tricky.

Yes, there would be duplicate definitions. MSVC would just pick one of them. But it least it would not result in a compilation error. Currently Tensorflow is broken because of this, although it does not even care about running the MLIR tests, so which definition is picked is not important in that use case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146405



More information about the llvm-commits mailing list