All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/iproute2: fix musl compile errors
@ 2024-08-14 18:57 Waldemar Brodkorb
  2024-08-14 20:19 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Waldemar Brodkorb @ 2024-08-14 18:57 UTC (permalink / raw)
  To: buildroot

Add two patches to fix musl compile errors.

Fixes:
 - http://autobuild.buildroot.net/results/8d7/8d713bd911f8d6b97272a7bb5dc2c188aeb99b05
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 ...laration-of-function-htobe64-in-gcc-.patch | 43 +++++++++++++++++++
 ...laration-of-function-basename-in-gcc.patch | 30 +++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 package/iproute2/0001-Fix-implicit-declaration-of-function-htobe64-in-gcc-.patch
 create mode 100644 package/iproute2/0002-Fix-implicit-declaration-of-function-basename-in-gcc.patch

diff --git a/package/iproute2/0001-Fix-implicit-declaration-of-function-htobe64-in-gcc-.patch b/package/iproute2/0001-Fix-implicit-declaration-of-function-htobe64-in-gcc-.patch
new file mode 100644
index 0000000000..318701e725
--- /dev/null
+++ b/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
+
diff --git a/package/iproute2/0002-Fix-implicit-declaration-of-function-basename-in-gcc.patch b/package/iproute2/0002-Fix-implicit-declaration-of-function-basename-in-gcc.patch
new file mode 100644
index 0000000000..e898ee3a79
--- /dev/null
+++ b/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
+
-- 
2.39.2

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

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

end of thread, other threads:[~2024-08-15  8:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 18:57 [Buildroot] [PATCH] package/iproute2: fix musl compile errors Waldemar Brodkorb
2024-08-14 20:19 ` Thomas Petazzoni via buildroot
2024-08-15  7:22   ` Waldemar Brodkorb
2024-08-15  8:07     ` Thomas Petazzoni via buildroot

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.