Pārlūkot izejas kodu

package/iproute2: fix musl compile errors

Add two patches to fix musl compile errors.

Fixes:

  http://autobuild.buildroot.net/results/8d713bd911f8d6b97272a7bb5dc2c188aeb99b05

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Waldemar Brodkorb 11 mēneši atpakaļ
vecāks
revīzija
9a57fab586

+ 43 - 0
package/iproute2/0001-Fix-implicit-declaration-of-function-htobe64-in-gcc-.patch

@@ -0,0 +1,43 @@
+From ea78477cba25b50e7f63f02635e6870d72dcf68e Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 14 Aug 2024 19:10:09 +0200
+Subject: [PATCH] Fix implicit declaration of function 'htobe64' in gcc 14 on
+ musl systems
+
+On musl systems with GCC 14 and above, the htobe64 function cannot be
+found by default. From the man page[0], the function is from endian.h
+header file. If the file is not included in, then we get the following
+error message. The issue however cannot be reproduced on glibc systems.
+
+In file included from ../include/libgenl.h:5,
+                 from libgenl.c:12:
+../include/libnetlink.h: In function 'rta_getattr_be64':
+../include/libnetlink.h:281:16: error: implicit declaration of function 'htobe64' [-Wimplicit-function-declaration]
+  281 |         return htobe64(rta_getattr_u64(rta));
+      |                ^~~~~~~
+make[1]: *** [../config.include:24: libgenl.o] Error 1
+
+[0]: https://linux.die.net/man/3/htobe64
+
+Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Upstream: https://lore.kernel.org/netdev/20240514084335.19f5b280@hermes.local/T/
+---
+ include/libnetlink.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/libnetlink.h b/include/libnetlink.h
+index 30f0c2d2..77e81815 100644
+--- a/include/libnetlink.h
++++ b/include/libnetlink.h
+@@ -12,6 +12,7 @@
+ #include <linux/neighbour.h>
+ #include <linux/netconf.h>
+ #include <arpa/inet.h>
++#include <endian.h>
+ 
+ struct rtnl_handle {
+ 	int			fd;
+-- 
+2.39.2
+

+ 30 - 0
package/iproute2/0002-Fix-implicit-declaration-of-function-basename-in-gcc.patch

@@ -0,0 +1,30 @@
+From 482b7362dedc57d0c9783bd83084919ccaa79e77 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Wed, 14 Aug 2024 19:43:44 +0200
+Subject: [PATCH] Fix implicit declaration of function basename in gcc-14.x
+
+From Alpine Linux.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Upstream: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/iproute2/basename.patch?ref_type=heads
+---
+ rdma/rdma.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rdma/rdma.c b/rdma/rdma.c
+index 131c6b2a..1e7db382 100644
+--- a/rdma/rdma.c
++++ b/rdma/rdma.c
+@@ -8,6 +8,9 @@
+ #include "version.h"
+ #include "color.h"
+ 
++/* For basename(3) prototype */
++#include <libgen.h>
++
+ /* Global utils flags */
+ int json;
+ 
+-- 
+2.39.2
+