testing/olsrd: fix build with gcc 14

This commit is contained in:
mio 2024-09-26 22:24:59 +00:00 committed by Celeste
parent dd17f7446d
commit bbcafdc341
2 changed files with 59 additions and 3 deletions
testing/olsrd

View file

@ -2,7 +2,7 @@
# Maintainer: Mathew Meins <mm@blackhelicopters.net>
pkgname=olsrd
pkgver=0.9.8
pkgrel=2
pkgrel=3
pkgdesc="An implementation of the IETF RFC 3626: Optimized Link State Routing Protocol"
url="http://www.olsr.org/mediawiki/index.php/Olsr_Daemon"
arch="all"
@ -12,6 +12,7 @@ subpackages="$pkgname-openrc $pkgname-doc $pkgname-plugins"
source="https://github.com/OLSR/olsrd/archive/v$pkgver/olsrd-$pkgver.tar.gz
bison.patch
musl.patch
gcc14.patch
olsrd.initd
olsrd.confd
"
@ -73,8 +74,11 @@ plugins() {
' sh {} \;
}
sha512sums="cf3066310c4ea644ba1f482e847aa073ad006000308bfa993cecda4ccf4e9919a9005680b3c1d98e34f0c13818213f208e8dc93c8b060eeaaac160fc3df4ce8c olsrd-0.9.8.tar.gz
sha512sums="
cf3066310c4ea644ba1f482e847aa073ad006000308bfa993cecda4ccf4e9919a9005680b3c1d98e34f0c13818213f208e8dc93c8b060eeaaac160fc3df4ce8c olsrd-0.9.8.tar.gz
b8c44fce64fd946459c67ea130b7230fbb88a761d5b64221303adea2a6ddf074c39521f22aade27820bff8748ba50851d9cbf7602c10d6bd9615992284cb2046 bison.patch
1d2f74d017e50d17c4eabbf52412e2f5aeec7bb2ca0bb1738ae8c0527b9abd13299cbebb3428db1cc95d574b86eea50cec8c4cf388f18d6723577800fd6678fb musl.patch
a049ec4ed8074441ebdd403a2517d91e190d2346cc52ee03d1ba8e6b286102f2f3adcfaa6bcb6e11573ab406ad7f3d23bfeb63fc510d4bd09f3fc1aa67e63589 gcc14.patch
9051d65c0f3fdc82ceccc622062a5ffa7accc6584030c0e5ba855e7a7f478233476bc44ca12fa68b5c391000f0e9d4c3198bcdd879d549ae83c37d0301bec785 olsrd.initd
4f84d8738ff00d12ca36a1b00f4c0b7b71128be60aa895a8d337d31732ed8b5bd7f9a6f0892b0218584d25630c110e8763a1605065a1ef8111b9f13299fffedb olsrd.confd"
4f84d8738ff00d12ca36a1b00f4c0b7b71128be60aa895a8d337d31732ed8b5bd7f9a6f0892b0218584d25630c110e8763a1605065a1ef8111b9f13299fffedb olsrd.confd
"

52
testing/olsrd/gcc14.patch Normal file
View file

@ -0,0 +1,52 @@
Source: https://github.com/OLSR/olsrd/pull/129/commits/46e14c71f957c5e577ea90ec9917b51103230225.patch
This patch applies the second of two hunks.
The first part is for a component that does not yet exist in version 0.9.8.
```
src/linux/kernel_routes_nl.c: In function 'rtnetlink_read':
src/linux/kernel_routes_nl.c:164:5: error: initialization of 'int' from 'void
*' makes integer from pointer without a cast [-Wint-conversion]
164 | NULL,
| ^~~~
src/linux/kernel_routes_nl.c:164:5: note: (near initialization for 'msg.__pad1')
```
--
From 46e14c71f957c5e577ea90ec9917b51103230225 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sun, 9 Jun 2024 16:18:18 -0700
Subject: [PATCH] fix compilation with GCC14
the msghdr has padding in both glibc and musl. Initialize with names to
avoid dealing with the padding.
There's also a wrong struct type that's an error now.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
diff --git a/src/linux/kernel_routes_nl.c b/src/linux/kernel_routes_nl.c
index 1a2810da2..f21d6bbe1 100644
--- a/src/linux/kernel_routes_nl.c
+++ b/src/linux/kernel_routes_nl.c
@@ -157,13 +157,13 @@ static void rtnetlink_read(int sock, void *data __attribute__ ((unused)), unsign
struct iovec iov;
struct sockaddr_nl nladdr;
struct msghdr msg = {
- &nladdr,
- sizeof(nladdr),
- &iov,
- 1,
- NULL,
- 0,
- 0
+ .msg_name = &nladdr,
+ .msg_namelen = sizeof(nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = NULL,
+ .msg_controllen = 0,
+ .msg_flags = 0,
};
char buffer[4096];