linux-gbmc(stable): Annotate stmmac stat_string with __nonstring

When building linux-gbmc-stable (6.14.1) with CONFIG_WERROR enabled,
GCC 15 produces the following compiler error:

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:117:53: error:
initializer-string for array of 'char' truncates NUL terminator but
destination lacks 'nonstring' attribute (33 chars into 32 available)
[-Werror=unterminated-string-initialization]
  117 |         STMMAC_STAT(ptp_rx_msg_type_pdelay_follow_up),
      |                                                     ^

In struct stmmac_stats, stat_string is a fixed-size character array of
ETH_GSTRING_LEN (32) bytes. The statistic identifier
ptp_rx_msg_type_pdelay_follow_up stringifies to exactly 32 characters.
Initializing stat_string with this 32-character string literal leaves
no space for a terminating NUL byte, causing GCC 15 to flag it with
-Wunterminated-string-initialization.

Add a kernel patch that annotates stat_string with the __nonstring
attribute in struct stmmac_stats to declare that the character array
is not required to be NUL-terminated. Add this patch to SRC_URI in
linux-gbmc_stable.bb to resolve the build failure.

Fixes: 80892bc818ea ("linux-gbmc(stable): 6.13 -> 6.14")
Tested: Built
Fusion-Link: fusion2 N/A
Google-Bug-Id: 558753346
Change-Id: Ib0d912cc945393c444ba354ef328fb1c380d9107
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2 files changed
tree: 5e93c453abf1dd1e02581bb620514d969e26ef24
  1. classes/
  2. conf/
  3. dynamic-layers/
  4. recipes-benchmark/
  5. recipes-bsp/
  6. recipes-connectivity/
  7. recipes-core/
  8. recipes-devtools/
  9. recipes-extended/
  10. recipes-google/
  11. recipes-kernel/
  12. recipes-phosphor/
  13. recipes-support/
  14. recipes-tpm1/
  15. recipes-tpm2/
  16. recipes-x86/
  17. LICENSE
  18. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.