When building ipset with musl libc the following error appeared on the
autobuilder in 2025.02.x:
```
ipset.c: In function 'main':
ipset.c:35:21: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
35 | if (!strcmp(basename(argv[0]), "ipset-translate")) {
| ^~~~~~~~
ipset.c:35:21: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
35 | if (!strcmp(basename(argv[0]), "ipset-translate")) {
| ^~~~~~~~~~~~~~~~~
| |
| int
In file included from ipset.c:13:
```
This error can be reproduced with:
```
cat >.config <<EOF
BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_MUSL_BLEEDING_EDGE=y
BR2_PACKAGE_IPSET=y
EOF
make olddefconfig
make ipset
```
This patch adds the upstream commit [1], that fixes this issue by
including explicitly `libgen.h`. This patch is part of the master
branch since commit [2].
[1] https://git.netfilter.org/ipset/commit/?id=316f592ddc547c28388da4e7cb7c5c8f89cd3591
[2] 8fdbbefa08 package/ipset: bump to version 7.23
Fixes: https://autobuild.buildroot.org/results/930/930802ecc324c4cfc697191aa6a68642a4188e7b
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
32 lines
968 B
Diff
32 lines
968 B
Diff
From 316f592ddc547c28388da4e7cb7c5c8f89cd3591 Mon Sep 17 00:00:00 2001
|
|
From: Mike Pagano <mpagano@gentoo.org>
|
|
Date: Fri, 30 Aug 2024 11:31:19 -0400
|
|
Subject: ipset: Fix implicit declaration of function basename
|
|
|
|
basename(3) is defined in libgen.h in MUSL.
|
|
Include libgen.h where basename(3) is used.
|
|
|
|
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
|
|
Acked-by: Phil Sutter <phil@nwl.cc>
|
|
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
|
|
Upstream: https://git.netfilter.org/ipset/commit/?id=316f592ddc547c28388da4e7cb7c5c8f89cd3591
|
|
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
|
---
|
|
src/ipset.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/src/ipset.c b/src/ipset.c
|
|
index 162f477..d7733bf 100644
|
|
--- a/src/ipset.c
|
|
+++ b/src/ipset.c
|
|
@@ -15,6 +15,7 @@
|
|
#include <config.h>
|
|
#include <libipset/ipset.h> /* ipset library */
|
|
#include <libipset/xlate.h> /* translate to nftables */
|
|
+#include <libgen.h>
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
--
|
|
cgit v1.2.3
|