[Buildroot] [WIP][DO NOT MERGE][PATCH 1/1] package/iproute2: bump version to 5.19.0
Nicolas Cavallari
Nicolas.Cavallari at green-communications.fr
Thu Aug 25 07:36:39 UTC 2022
On 22/08/2022 21:35, Petr Vorel wrote:
> From: Petr Vorel <petr.vorel at gmail.com>
>
> Remove patch from this release, backport 3 patches fixing build from
> upstream.
>
> Signed-off-by: Petr Vorel <petr.vorel at gmail.com>
> ---
> Hi all,
>
> v5.19.0 does not compile on uclibc.
>
>
> In file included from ipstats.c:15:
> ../include/utils.h:270:23: error: expected declaration specifiers or ‘...’ before ‘(’ token
> 270 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> | ^
> ipstats.c:76:15: note: in expansion of macro ‘ARRAY_SIZE’
> 76 | static_assert(ARRAY_SIZE(ipstats_stat_ifla_max) == IFLA_STATS_MAX + 1,
> | ^~~~~~~~~~
> ipstats.c:77:8: error: expected declaration specifiers or ‘...’ before string constant
> 77 | "An IFLA_STATS attribute is missing from the ifla_max table");
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from ipstats.c:15:
> ../include/utils.h:270:23: error: expected declaration specifiers or ‘...’ before ‘(’ token
> 270 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> | ^
> ipstats.c:279:15: note: in expansion of macro ‘ARRAY_SIZE’
> 279 | static_assert(ARRAY_SIZE(ipstats_hw_s_info_name) ==
> | ^~~~~~~~~~
> ipstats.c:281:8: error: expected declaration specifiers or ‘...’ before string constant
> 281 | "mismatch: enum ipstats_hw_s_info_idx x ipstats_hw_s_info_name");
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[1]: *** [../config.mk:33: ipstats.o] Error 1
> make: *** [Makefile:77: all] Error 2
>
>
> I'm not sure what it is. All uclibc toolchains are quite old:
> LINUX_VERSION_CODE 264703 => 4.9.255
>
> I'm not sure if it's due missing IFLA_STATS_AF_SPEC member in
> IFLA_STATS_LINK_* enum which was added in v4.11-rc1 in aefb4d4ad83b
> ("net: AF-specific RTM_GETSTATS attributes"). Likely not.
> It's more likely some problem with static_assert(), because using
> correct or even any int value in static_assert() causes similar error.
> But commenting out static_assert() allows compilation.
>
> static_assert() was standardized in C11, which should be supported in
> gcc 4.7 [1]. bootlin-armv5-uclibc has gcc 10.3.0:
>
> br-test-pkg/bootlin-armv5-uclibc/host/bin/arm-linux-gcc --version
> arm-linux-gcc.br_real (Buildroot toolchains.bootlin.com-2021.11-1) 10.3.0
static_assert is supposed to be a macro defined in assert.h, but uclibc-ng has
it only since 1.0.42, which is two weeks old. The majority of pre-built
toolchains are more than two weeks old.
A workaround is to add a patch that does s/static_assert/_Static_assert/,
or to add some #define static_assert _Static_assert.
>
> compiling iproute2 with export CFLAGS="-std=c11" causes other errors:
>
> In file included from ll_map.c:24:
> ll_map.c: In function ‘ll_get_by_index’:
> ../include/list.h:9:16: error: expected declaration specifiers or ‘...’ before ‘(’ token
> 9 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \
> | ^
> ll_map.c:48:6: note: in expansion of macro ‘container_of’
> 48 | = container_of(n, struct ll_cache, idx_hash);
> | ^~~~~~~~~~~~
> ../include/list.h:10:20: error: ‘__mptr’ undeclared (first use in this function)
> 10 | (type *)( (char *)__mptr - offsetof(type,member) );})
> | ^~~~~~
> ll_map.c:48:6: note: in expansion of macro ‘container_of’
> 48 | = container_of(n, struct ll_cache, idx_hash);
> | ^~~~~~~~~~~~
> ../include/list.h:10:20: note: each undeclared identifier is reported only once for each function it appears in
> 10 | (type *)( (char *)__mptr - offsetof(type,member) );})
> | ^~~~~~
> ll_map.c:48:6: note: in expansion of macro ‘container_of’
> 48 | = container_of(n, struct ll_cache, idx_hash);
> | ^~~~~~~~~~~~
> ll_map.c: In function ‘ll_get_by_name’:
> ../include/list.h:9:16: error: expected declaration specifiers or ‘...’ before ‘(’ token
> 9 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>
> ...
>
> What could be wrong?
typeof is a gcc extension, so that should probably need -std=gnu11 instead of
-std=c11. But gcc 10 probably already defaults to gnu11.
More information about the buildroot
mailing list