Summary: | sys-apps/iproute2-6.8.0-r2 - rdma.c:110:13: error: call to undeclared function 'basename' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | ernsteiswuerfel <erhard_f> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | erhard_f, holger, I |
Priority: | Normal | Keywords: | PATCH, PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/37658 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 926147 | ||
Attachments: |
build.log
emerge --info emerge --info build.log (amd64, 6.8.0-r2) Patch to build iproute2-6.10.0 successfully |
Created attachment 886892 [details]
emerge --info
>>> Emerging (1 of 1) sys-apps/iproute2-6.8.0-r2::gentoo
>>> Installing (1 of 1) sys-apps/iproute2-6.8.0-r2::gentoo
>>> Completed (1 of 1) sys-apps/iproute2-6.8.0-r2::gentoo
works fine with musl-1.2.5 and iproute2-6.8.0-r2
Sorry I can't confirm this. Still fails for me on iproute2-6.8.0-r2. [...] make[1]: Entering directory '/var/tmp/portage/sys-apps/iproute2-6.8.0-r2/work/iproute2-6.8.0/rdma' clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -Os -march=x86-64-v2 -pipe -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONF_USR_DIR=\"/usr/share/iproute2\" -DCONF_ETC_DIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -DCONF_COLOR=COLOR_OPT_AUTO -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Os -march=x86-64-v2 -pipe -DHAVE_HANDLE_AT -DHAVE_HANDLE_AT -DHAVE_SETNS -DHAVE_SETNS -DHAVE_LIBMNL -DHAVE_LIBMNL -I./include/uapi/ -c -o rdma.o rdma.c rdma.c:110:13: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 110 | filename = basename(argv[0]); | ^ rdma.c:110:11: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion] 110 | filename = basename(argv[0]); | ^ ~~~~~~~~~~~~~~~~~ 2 errors generated. make[1]: *** [../config.include:24: rdma.o] Error 1 make[1]: Leaving directory '/var/tmp/portage/sys-apps/iproute2-6.8.0-r2/work/iproute2-6.8.0/rdma' make: *** [Makefile:79: all] Error 2 * ERROR: sys-apps/iproute2-6.8.0-r2::gentoo failed (compile phase): * emake failed Created attachment 896735 [details]
emerge --info
Created attachment 896736 [details]
build.log (amd64, 6.8.0-r2)
(In reply to ernsteiswuerfel from comment #3) This is technically a different error than the one originally reported. The issue in bpf_legacy.c was fixed upstream. https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=69e3b2fadcd32683db2942f31fe41f0fbb2185f8 This new issue is in rdma/rdma.c. Err, bpf_legacy.c was "fixed" by this commit actually. https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=64ed1886e719f40acb554ac895305acb43f27bea The other commit (69e3b2fadcd32683db2942f31fe41f0fbb2185f8) resolved a warning and introduced a memory leak. Thanks for pointing out! Seems I have not looked closely enough... The new rdma/rdma.c issue is not fixed upstream yet it seems. I am having this error, and while an upstream fix would be ideal, if like me you just need to get it to build so you can continue with your install, you can edit the affected `rdma.c` file and add a `#include <libgen.h>` near the beginning. It's quick-n-dirty hackery at its worst. Don't be like me and quickly edit the file between the time emerge unpacks the integrity-checked source and the time the affected file builds; no, obviously the proper way to apply this dirty hack is to make a local repository and add a patch in the ebuild. Normally I'd try to submit a patch upstream, but looking at `rdma.c` and its general lack of header inclusions, they probably have a better way of doing this and my clumsy patch would just be noise... but today it gets my system building! :-) Created attachment 897936 [details, diff]
Patch to build iproute2-6.10.0 successfully
Version 6.10.0 has another one:
../include/libnetlink.h:280:9: error: call to undeclared function 'htobe64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
If you want to build today, you can use this patch in a custom ebuild to get it building.
See also: https://bugs.gentoo.org/936234 Please send patches upstream. We can backport once they land there. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0564906652c69469deab2b7814bb4736d7be5881 commit 0564906652c69469deab2b7814bb4736d7be5881 Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2024-08-04 16:16:13 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2024-08-04 16:17:21 +0000 sys-apps/iproute2: fix build on musl Closes: https://bugs.gentoo.org/936234 Closes: https://bugs.gentoo.org/926341 Closes: https://github.com/gentoo/gentoo/pull/37658 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> .../iproute2/files/iproute2-6.10.0-musl-1.patch | 41 +++++++++++++++++++++ .../iproute2/files/iproute2-6.10.0-musl-2.patch | 43 ++++++++++++++++++++++ sys-apps/iproute2/iproute2-6.10.0.ebuild | 2 + 3 files changed, 86 insertions(+) |
Created attachment 886891 [details] build.log [...] clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -Os -march=x86-64-v2 -pipe -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONF_USR_DIR=\"/usr/share/iproute2\" -DCONF_ETC_DIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Os -march=x86-64-v2 -pipe -DHAVE_HANDLE_AT -DHAVE_HANDLE_AT -DHAVE_SETNS -DHAVE_SETNS -DHAVE_LIBMNL -DHAVE_LIBMNL -fPIC -c -o color.o color.c clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -Os -march=x86-64-v2 -pipe -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONF_USR_DIR=\"/usr/share/iproute2\" -DCONF_ETC_DIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Os -march=x86-64-v2 -pipe -DHAVE_HANDLE_AT -DHAVE_HANDLE_AT -DHAVE_SETNS -DHAVE_SETNS -DHAVE_LIBMNL -DHAVE_LIBMNL -fPIC -c -o bpf_legacy.o bpf_legacy.c bpf_legacy.c:974:5: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 974 | basename(cfg->object), cfg->mode == EBPF_PINNED ? | ^ bpf_legacy.c:974:5: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat] 973 | snprintf(annotation, sizeof(annotation), "%s:[%s]", | ~~ | %d 974 | basename(cfg->object), cfg->mode == EBPF_PINNED ? | ^~~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. make[1]: *** [../config.include:24: bpf_legacy.o] Error 1 make[1]: Leaving directory '/var/tmp/portage/sys-apps/iproute2-6.6.0-r3/work/iproute2-6.6.0/lib' make: *** [Makefile:78: all] Error 2