Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds (#19071)#19071
Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds (#19071)#19071karan1508 wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19071
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New FailuresAs of commit 56c6a34 with merge base 803e47d ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@karan1508 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100626340. |
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This PR needs a
|
dd0e32a to
59f1fc0
Compare
…torch#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` Reviewed By: digantdesai Differential Revision: D100626340
…torch#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` Reviewed By: digantdesai Differential Revision: D100626340
6d73fef to
ea671db
Compare
…torch#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` Reviewed By: digantdesai Differential Revision: D100626340
…torch#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` Reviewed By: digantdesai Differential Revision: D100626340
ea671db to
eab05c9
Compare
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
eab05c9 to
aade9f4
Compare
…torch#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
…torch#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
aade9f4 to
ce9fddf
Compare
…torch#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
a62ca4e to
c085e78
Compare
…torch#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
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
c085e78 to
a57a401
Compare
…torch#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` Reviewed By: digantdesai Differential Revision: D100626340
…torch#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` Reviewed By: digantdesai Differential Revision: D100626340
a57a401 to
56c6a34
Compare
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-prototypesto 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-Werroris enabled.The fix wraps
-Wno-missing-prototypesin aselect()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 inelementwise_utilandmath_util).Changes across executorch build files:
kernels/portable/op_registration_util.bzl: Addedos:zephyrto existing OS selectkernels/optimized/op_registration_util.bzl: Wrapped flags in selectkernels/portable/cpu/util/targets.bzl: Wrapped 8 hardcoded flags in selectskernels/portable/cpu/pattern/targets.bzl: Wrapped flag in selectkernels/aten/cpu/util/targets.bzl: Addedos:zephyrto existing OS selectcodegen/codegen.bzl: Wrapped flags inbuild_portable_libandbuild_optimized_libReviewed By: digantdesai
Differential Revision: D100626340