X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=package%2Fnetwork%2Futils%2Fiproute2%2Fpatches%2F001-devlink-fix-libc-and-kernel-headers-collision.patch;fp=package%2Fnetwork%2Futils%2Fiproute2%2Fpatches%2F001-devlink-fix-libc-and-kernel-headers-collision.patch;h=e2ddaa25b15c946533a7280cf3e6166dce750c4d;hp=0000000000000000000000000000000000000000;hb=917eeaf26bca5342817419d0c360301896932476;hpb=92f83abc5e0f7bacd0392ce0c1cddcfb358f0d03 diff --git a/package/network/utils/iproute2/patches/001-devlink-fix-libc-and-kernel-headers-collision.patch b/package/network/utils/iproute2/patches/001-devlink-fix-libc-and-kernel-headers-collision.patch new file mode 100644 index 0000000000..e2ddaa25b1 --- /dev/null +++ b/package/network/utils/iproute2/patches/001-devlink-fix-libc-and-kernel-headers-collision.patch @@ -0,0 +1,52 @@ +From d0272f5404773a60cbc17c2277affdbbf8d99c67 Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Thu, 27 Jun 2019 21:37:19 +0300 +Subject: devlink: fix libc and kernel headers collision + +Since commit 2f1242efe9d ("devlink: Add devlink health show command") we +use the sys/sysinfo.h header for the sysinfo(2) system call. But since +iproute2 carries a local version of the kernel struct sysinfo, this +causes a collision with libc that do not rely on kernel defined sysinfo +like musl libc: + +In file included from devlink.c:25:0: +.../sysroot/usr/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo' + struct sysinfo { + ^~~~~~~ +In file included from ../include/uapi/linux/kernel.h:5:0, + from ../include/uapi/linux/netlink.h:5, + from ../include/uapi/linux/genetlink.h:6, + from devlink.c:21: +../include/uapi/linux/sysinfo.h:8:8: note: originally defined here + struct sysinfo { + ^~~~~~~ + +Move the sys/sysinfo.h userspace header before kernel headers, and +suppress the indirect include of linux/sysinfo.h. + +Cc: Aya Levin +Cc: Moshe Shemesh +Signed-off-by: Baruch Siach +Signed-off-by: Stephen Hemminger +--- + devlink/devlink.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/devlink/devlink.c b/devlink/devlink.c +index 97b9373..5618ba2 100644 +--- a/devlink/devlink.c ++++ b/devlink/devlink.c +@@ -18,11 +18,12 @@ + #include + #include + #include ++#include ++#define _LINUX_SYSINFO_H /* avoid collision with musl header */ + #include + #include + #include + #include +-#include + #include + + #include "SNAPSHOT.h"