Skip to content

Commit

Permalink
[mlir][Bazel] Avoid __attribute__((weak)) for MSVC.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D146405
  • Loading branch information
akuegel committed Mar 20, 2023
1 parent 499e1a5 commit a348ba2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
Expand Up @@ -4101,7 +4101,13 @@ write_file(
// Provide a weak registration stub in case the real SerializeToCubin is not
// linked in.
#if defined(_MSC_VER)
// This might not work correctly, but it avoids a compilation error because
// MSVC does not support __attribute__((weak)).
void mlir::registerGpuSerializeToCubinPass() {}
#else
__attribute__((weak)) void mlir::registerGpuSerializeToCubinPass() {}
#endif
""",
],
)
Expand Down

0 comments on commit a348ba2

Please sign in to comment.