[Buildroot] [PATCH 1/1] package/ethtool: fix build failure

Dario Binacchi dario.binacchi at amarulasolutions.com
Sat May 20 21:12:46 UTC 2023


When I was fixing a build failure for the libmnl package ([1]), I got
this error for the ethtool compilation:

netlink/rss.c: In function 'rss_reply_cb':
netlink/rss.c:166:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < get_count(hash_funcs); i++) {
   ^
netlink/rss.c:166:3: note: use option -std=c99 or -std=gnu99 to compile your code

[1] http://autobuild.buildroot.net/results/15f6dc103eec7bdeb5020acbc0ae99dc97c00e4e
Signed-off-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>
---
 package/ethtool/ethtool.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/ethtool/ethtool.mk b/package/ethtool/ethtool.mk
index a35e274bc442..c72d59be3767 100644
--- a/package/ethtool/ethtool.mk
+++ b/package/ethtool/ethtool.mk
@@ -20,4 +20,6 @@ else
 ETHTOOL_CONF_OPTS += --disable-netlink
 endif
 
+ETHTOOL_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
+
 $(eval $(autotools-package))
-- 
2.32.0




More information about the buildroot mailing list