[toolchain] Support C standard selection override via flag or Kconfig
Allows selecting the C standard either via Kconfig (default)
or by overriding it using the `--@zephyr-bazel//toolchain/args/c:c_standard`
build setting (e.g. to "90", "99", "11", "17", "23").
This is implemented by:
1. Defining generic cXX and gnuXX features in `toolchain/args/c/BUILD.bazel`.
2. Defining the `c_standard` string flag and triggers in `toolchain/args/c/BUILD.bazel`.
3. Redefining the `std_cXX_gnu/pure` config settings in `toolchain/args/c/BUILD.bazel` to use the new trigger logic.
4. Using `select` on these config settings in all toolchains.
This matches the C++ standard selection override logic and cleans up
`toolchain/args/BUILD.bazel` by moving C-related stuff to `toolchain/args/c/BUILD.bazel`.
TAG=agy
CONV=66f377df-07e2-4b31-b652-bc93477153b4
Change-Id: Ic18e476e524a3f09a3aa884a8c5b8ab133f24814
Reviewed-on: https://pigweed-review.googlesource.com/c/zephyr/zephyr-bazel/+/437576
11 files changed