From a348ba21f8d88f7cb8a218b9ef2eec3f5602ec6f Mon Sep 17 00:00:00 2001 From: Adrian Kuegel Date: Mon, 20 Mar 2023 08:28:48 +0100 Subject: [PATCH] [mlir][Bazel] Avoid __attribute__((weak)) for MSVC. Differential Revision: https://reviews.llvm.org/D146405 --- utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index 869d7a9..c9a68e1 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -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 """, ], ) -- 2.7.4