All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [WIP][DO NOT MERGE][PATCH 1/1] package/iproute2: bump version to 5.19.0
@ 2022-08-22 19:35 Petr Vorel
  2022-08-25  7:36 ` Nicolas Cavallari
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2022-08-22 19:35 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni, Yann E . MORIN, Fabrice Fontaine

From: Petr Vorel <petr.vorel@gmail.com>

Remove patch from this release, backport 3 patches fixing build from
upstream.

Signed-off-by: Petr Vorel <petr.vorel@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

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?

Thanks for any tips.

Kind regards,
Petr

[1] https://gcc.gnu.org/wiki/C11Status

                    bootlin-armv5-uclibc [1/6]: FAILED
                     bootlin-armv7-glibc [2/6]: OK
                   bootlin-armv7m-uclibc [3/6]: SKIPPED
                     bootlin-x86-64-musl [4/6]: OK
                      br-arm-full-static [5/6]: FAILED
                            sourcery-arm [6/6]: OK
6 builds, 1 skipped, 2 build failed, 0 legal-info failed, 0 show-info failed

                             arm-aarch64 [ 1/44]: OK
                   bootlin-aarch64-glibc [ 2/44]: OK
               bootlin-arcle-hs38-uclibc [ 3/44]: FAILED
                    bootlin-armv5-uclibc [ 4/44]: FAILED
                     bootlin-armv7-glibc [ 5/44]: OK
                   bootlin-armv7m-uclibc [ 6/44]: SKIPPED
                      bootlin-armv7-musl [ 7/44]: OK
             bootlin-microblazeel-uclibc [ 8/44]: FAILED
                   bootlin-mipsel-uclibc [ 9/44]: FAILED
                bootlin-mipsel32r6-glibc [10/44]: OK
                bootlin-m68k-5208-uclibc [11/44]: SKIPPED
               bootlin-m68k-68040-uclibc [12/44]: FAILED
                     bootlin-nios2-glibc [13/44]: OK
                 bootlin-openrisc-uclibc [14/44]: FAILED
           bootlin-powerpc-e500mc-uclibc [15/44]: FAILED
        bootlin-powerpc64le-power8-glibc [16/44]: OK
                   bootlin-riscv32-glibc [17/44]: OK
                   bootlin-riscv64-glibc [18/44]: OK
                    bootlin-riscv64-musl [19/44]: OK
                      bootlin-sh4-uclibc [20/44]: FAILED

 .../0001-bpf_glue-include-errno.h.patch       | 32 ------------------
 .../0001-ipstats-Add-param.h-for-musl.patch   | 29 ++++++++++++++++
 .../0002-ipstats-add-missing-headers.patch    | 33 +++++++++++++++++++
 ...-_GNU_SOURCE-when-checking-for-setns.patch | 29 ++++++++++++++++
 package/iproute2/iproute2.hash                |  2 +-
 package/iproute2/iproute2.mk                  |  2 +-
 6 files changed, 93 insertions(+), 34 deletions(-)
 delete mode 100644 package/iproute2/0001-bpf_glue-include-errno.h.patch
 create mode 100644 package/iproute2/0001-ipstats-Add-param.h-for-musl.patch
 create mode 100644 package/iproute2/0002-ipstats-add-missing-headers.patch
 create mode 100644 package/iproute2/0003-configure-Define-_GNU_SOURCE-when-checking-for-setns.patch

diff --git a/package/iproute2/0001-bpf_glue-include-errno.h.patch b/package/iproute2/0001-bpf_glue-include-errno.h.patch
deleted file mode 100644
index 9371344d00..0000000000
--- a/package/iproute2/0001-bpf_glue-include-errno.h.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f8decf82af07591833f89004e9b72cc39c1b5c52 Mon Sep 17 00:00:00 2001
-From: Juhee Kang <claudiajkang@gmail.com>
-Date: Tue, 19 Jul 2022 00:58:27 +0900
-Subject: [PATCH] bpf_glue: include errno.h
-
-If __NR_bpf is not enabled, bpf() function set errno and return -1. Thus,
-this patch includes the header.
-
-Fixes: ac4e0913beb1 ("bpf: Export bpf syscall wrapper")
-Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
-Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-[ upstream status: f8decf82af07591833f89004e9b72cc39c1b5c52 ]
-Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
----
- lib/bpf_glue.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/lib/bpf_glue.c b/lib/bpf_glue.c
-index c1cf351b..88a24751 100644
---- a/lib/bpf_glue.c
-+++ b/lib/bpf_glue.c
-@@ -7,6 +7,7 @@
- #include <sys/syscall.h>
- #include <limits.h>
- #include <unistd.h>
-+#include <errno.h>
- 
- #include "bpf_util.h"
- #ifdef HAVE_LIBBPF
--- 
-2.37.1
-
diff --git a/package/iproute2/0001-ipstats-Add-param.h-for-musl.patch b/package/iproute2/0001-ipstats-Add-param.h-for-musl.patch
new file mode 100644
index 0000000000..db6982ab8b
--- /dev/null
+++ b/package/iproute2/0001-ipstats-Add-param.h-for-musl.patch
@@ -0,0 +1,29 @@
+From cf6b60c504d4be5e1df2b2745e55d677967831d0 Mon Sep 17 00:00:00 2001
+From: Changhyeok Bae <changhyeok.bae@gmail.com>
+Date: Tue, 9 Aug 2022 04:01:05 +0000
+Subject: [PATCH] ipstats: Add param.h for musl
+
+Fix build error for musl
+| /usr/src/debug/iproute2/5.19.0-r0/iproute2-5.19.0/ip/ipstats.c:231: undefined reference to `MIN'
+
+Signed-off-by: Changhyeok Bae <changhyeok.bae@gmail.com>
+[ upstream status: cf6b60c504d4be5e1df2b2745e55d677967831d0 ]
+---
+ ip/ipstats.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ip/ipstats.c b/ip/ipstats.c
+index 5cdd15ae..1ac275bd 100644
+--- a/ip/ipstats.c
++++ b/ip/ipstats.c
+@@ -1,6 +1,7 @@
+ // SPDX-License-Identifier: GPL-2.0+
+ #include <assert.h>
+ #include <errno.h>
++#include <sys/param.h>
+
+ #include "list.h"
+ #include "utils.h"
+--
+2.37.2
+
diff --git a/package/iproute2/0002-ipstats-add-missing-headers.patch b/package/iproute2/0002-ipstats-add-missing-headers.patch
new file mode 100644
index 0000000000..d4b9a5d10d
--- /dev/null
+++ b/package/iproute2/0002-ipstats-add-missing-headers.patch
@@ -0,0 +1,33 @@
+From 28c740473510cd911b97cc5d7d23bd809a0f200b Mon Sep 17 00:00:00 2001
+From: Stephen Hemminger <stephen@networkplumber.org>
+Date: Tue, 9 Aug 2022 13:27:33 -0700
+Subject: [PATCH] ipstats: add missing headers
+
+IWYU reports several headers are not explicitly
+included by ipstats.
+
+Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
+[ upstream status: 28c740473510cd911b97cc5d7d23bd809a0f200b]
+---
+ ip/ipstats.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ip/ipstats.c b/ip/ipstats.c
+index 1ac275bd..dadded14 100644
+--- a/ip/ipstats.c
++++ b/ip/ipstats.c
+@@ -1,7 +1,11 @@
+ // SPDX-License-Identifier: GPL-2.0+
++#include <alloca.h>
+ #include <assert.h>
+ #include <errno.h>
++#include <stdio.h>
++#include <string.h>
+ #include <sys/param.h>
++#include <sys/socket.h>
+
+ #include "list.h"
+ #include "utils.h"
+--
+2.37.2
+
diff --git a/package/iproute2/0003-configure-Define-_GNU_SOURCE-when-checking-for-setns.patch b/package/iproute2/0003-configure-Define-_GNU_SOURCE-when-checking-for-setns.patch
new file mode 100644
index 0000000000..a5076d7711
--- /dev/null
+++ b/package/iproute2/0003-configure-Define-_GNU_SOURCE-when-checking-for-setns.patch
@@ -0,0 +1,29 @@
+From d5fe96ab70928508f072a47449e9b641e46de323 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 10 Aug 2022 22:34:40 -0700
+Subject: [PATCH] configure: Define _GNU_SOURCE when checking for setns
+
+glibc defines this function only as gnu extention
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
+[ upstream status: d5fe96ab70928508f072a47449e9b641e46de323 ]
+---
+ configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure b/configure
+index 440facb7..c02753bb 100755
+--- a/configure
++++ b/configure
+@@ -191,6 +191,7 @@ check_ipt_lib_dir()
+ check_setns()
+ {
+     cat >$TMPDIR/setnstest.c <<EOF
++#define _GNU_SOURCE
+ #include <sched.h>
+ int main(int argc, char **argv)
+ {
+-- 
+2.37.2
+
diff --git a/package/iproute2/iproute2.hash b/package/iproute2/iproute2.hash
index 2bb1ddbc72..a4b0e62c02 100644
--- a/package/iproute2/iproute2.hash
+++ b/package/iproute2/iproute2.hash
@@ -1,3 +1,3 @@
 # From https://kernel.org/pub/linux/utils/net/iproute2/sha256sums.asc
-sha256  5ba3d464d51c8c283550d507ffac3d10f7aec587b7c66b0ccb6950643646389e  iproute2-5.18.0.tar.xz
+sha256  26b7a34d6a7fd2f7a42e2b39c5a90cb61bac522d1096067ffeb195e5693d7791  iproute2-5.19.0.tar.xz
 sha256  e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4  COPYING
diff --git a/package/iproute2/iproute2.mk b/package/iproute2/iproute2.mk
index b9347ed367..425a213859 100644
--- a/package/iproute2/iproute2.mk
+++ b/package/iproute2/iproute2.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-IPROUTE2_VERSION = 5.18.0
+IPROUTE2_VERSION = 5.19.0
 IPROUTE2_SOURCE = iproute2-$(IPROUTE2_VERSION).tar.xz
 IPROUTE2_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/net/iproute2
 IPROUTE2_DEPENDENCIES = host-bison host-flex host-pkgconf \
-- 
2.37.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [WIP][DO NOT MERGE][PATCH 1/1] package/iproute2: bump version to 5.19.0
  2022-08-22 19:35 [Buildroot] [WIP][DO NOT MERGE][PATCH 1/1] package/iproute2: bump version to 5.19.0 Petr Vorel
@ 2022-08-25  7:36 ` Nicolas Cavallari
  2022-08-25 14:13   ` Arnout Vandecappelle
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Cavallari @ 2022-08-25  7:36 UTC (permalink / raw)
  To: Petr Vorel, buildroot; +Cc: Thomas Petazzoni, Yann E . MORIN, Fabrice Fontaine

On 22/08/2022 21:35, Petr Vorel wrote:
> From: Petr Vorel <petr.vorel@gmail.com>
> 
> Remove patch from this release, backport 3 patches fixing build from
> upstream.
> 
> Signed-off-by: Petr Vorel <petr.vorel@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.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [WIP][DO NOT MERGE][PATCH 1/1] package/iproute2: bump version to 5.19.0
  2022-08-25  7:36 ` Nicolas Cavallari
@ 2022-08-25 14:13   ` Arnout Vandecappelle
  0 siblings, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-08-25 14:13 UTC (permalink / raw)
  To: Nicolas Cavallari, Petr Vorel, buildroot
  Cc: Thomas Petazzoni, Yann E . MORIN, Fabrice Fontaine



On 25/08/2022 09:36, Nicolas Cavallari wrote:
> On 22/08/2022 21:35, Petr Vorel wrote:
>> From: Petr Vorel <petr.vorel@gmail.com>
>>
>> Remove patch from this release, backport 3 patches fixing build from
>> upstream.
>>
>> Signed-off-by: Petr Vorel <petr.vorel@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.

  This can be done through CFLAGS with -Dstatic_assert=_Static_assert

  Regards,
  Arnout

> 
>>
>> 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.
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-25 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 19:35 [Buildroot] [WIP][DO NOT MERGE][PATCH 1/1] package/iproute2: bump version to 5.19.0 Petr Vorel
2022-08-25  7:36 ` Nicolas Cavallari
2022-08-25 14:13   ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.