You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds (pytorch#19071)
Summary:
The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.
The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).
Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`
Differential Revision: D100626340
0 commit comments