From 349d1153cfe005cbdee6e5d0a78f529ea1a82394 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Mon, 13 Jul 2026 15:43:27 -0700 Subject: [PATCH] Update [ghstack-poisoned] --- backends/vulkan/targets.bzl | 4 +++- kernels/optimized/cpu/targets.bzl | 5 +++++ kernels/optimized/lib_defs.bzl | 5 +++++ .../executorch/kernels/optimized/op_registration_util.bzl | 7 +++++++ .../executorch/kernels/portable/op_registration_util.bzl | 7 +++++-- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/backends/vulkan/targets.bzl b/backends/vulkan/targets.bzl index b1105a08c51..fdcbc3e97dd 100644 --- a/backends/vulkan/targets.bzl +++ b/backends/vulkan/targets.bzl @@ -10,7 +10,9 @@ def get_vulkan_compiler_flags(): "-Wno-global-constructors", "-Wno-missing-prototypes", ], - "ovr_config//os:windows": [], + "ovr_config//os:windows": [ + "-Wno-error", + ], }) def get_vulkan_preprocessor_flags(no_volk, is_fbcode): diff --git a/kernels/optimized/cpu/targets.bzl b/kernels/optimized/cpu/targets.bzl index 9d54a5038bc..ef07c90e08c 100644 --- a/kernels/optimized/cpu/targets.bzl +++ b/kernels/optimized/cpu/targets.bzl @@ -48,6 +48,11 @@ def define_common_targets(): srcs = ["binary_ops.cpp"], exported_headers = ["binary_ops.h"], visibility = ["PUBLIC"], + # ATen vec headers trip -Werror warnings on the Windows (clang) host. + compiler_flags = select({ + "DEFAULT": [], + "ovr_config//os:windows": ["-Wno-error"], + }), exported_deps = [ "//executorch/runtime/core/exec_aten:lib", "//executorch/runtime/kernel:kernel_includes", diff --git a/kernels/optimized/lib_defs.bzl b/kernels/optimized/lib_defs.bzl index 928fc44635d..a3482c6b16f 100644 --- a/kernels/optimized/lib_defs.bzl +++ b/kernels/optimized/lib_defs.bzl @@ -214,6 +214,11 @@ def define_libs(is_fbcode=False): # TODO: replace with get_compiler_optimization_flags from op_registration_util.bzl when that # is re-enabled. "DEFAULT": ["-Os"], + }) + select({ + "DEFAULT": [], + # ATen vec headers trip -Werror warnings on the Windows (clang) + # host. + "ovr_config//os:windows": ["-Wno-error"], }), header_namespace = "executorch/kernels/optimized", visibility = ["PUBLIC"], diff --git a/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl b/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl index 4da5db56310..105000e4dfe 100644 --- a/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl +++ b/shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl @@ -109,6 +109,13 @@ def define_op_library(name, compiler_flags, deps): "ovr_config//os:zephyr": [ "-Wno-pass-failed", ], + # The vendored ATen vec headers trip several -Werror warnings on + # the Windows (clang) host, so disable warnings-as-errors there. + "ovr_config//os:windows": [ + "-Wno-missing-prototypes", + "-Wno-pass-failed", + "-Wno-error", + ], }) if not runtime.is_oss else [ "-Wno-missing-prototypes", "-Wno-pass-failed", diff --git a/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl b/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl index 479f3913f8f..9387d2d5d3b 100644 --- a/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl +++ b/shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl @@ -124,13 +124,16 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_ # Zephyr and Windows builds. OSS bypasses the zephyr branch via # runtime.is_oss since ovr_config//os:zephyr is not in the OSS # buck2 prelude. + # The vendored ATen vec headers pulled in on the Windows host trip + # several -Werror warnings (e.g. -Wundef on __GNUC__), so disable + # warnings-as-errors for the Windows (clang) kernel compiles. compiler_flags = (select({ "DEFAULT": ["-Wno-missing-prototypes"], - "ovr_config//os:windows": [], + "ovr_config//os:windows": ["-Wno-error"], "ovr_config//os:zephyr": [], }) if not runtime.is_oss else select({ "DEFAULT": ["-Wno-missing-prototypes"], - "ovr_config//os:windows": [], + "ovr_config//os:windows": ["-Wno-error"], })) + ( # For shared library build, we don't want to expose symbols of # kernel implementation (ex torch::executor::native::tanh_out)