Skip to contentSkip to conversation

package/iproute2: fix musl/uclibc build failure with libtirpc

PATCH Applied Yegor Yefremov via buildroot 1 participant 6 messages Sep 22 – Oct 16

lore
Share & tools
lore
#0 lore raw

cover package/iproute2: fix musl/uclibc build failure with libtirpc

From: Yegor Yefremov <[email protected]>

iproute2's configure script enables HAVE_RPC as soon as pkg-config finds libtirpc, without link-testing anything. misc/ss.c then calls getrpcbynumber(), which since the libtirpc 1.3.7 bump (commit 3f3d6e43de9b4aac7df8545fd811171256f878d3) is only exported when libtirpc is configured with --enable-rpcdb. On non-glibc toolchains there is no libc fallback, so linking ss fails:

ld: ss.o: in function `init_service_resolver':
ss.c:(.text+0x2558): undefined reference to `getrpcbynumber'

This is the same problem lsof hit in commit e4d075975f, fixed the same way here.

While looking at this, it turned out libtirpc was never listed in IPROUTE2_DEPENDENCIES at all, even though configure probes for it, so patch 1 adds that missing optional dependency first.

Tested with an aarch64 musl toolchain and BR2_PACKAGE_LIBTIRPC=y: before the series ss fails to link, after it builds and ss correctly resolves getrpcbynumber@TIRPC_0.3.0 from libtirpc.

Fixes:
https://autobuild.buildroot.org/results/390b7ed00da20c2349fe069ade4a65404834a484/

Yegor Yefremov (2):
package/iproute2: add optional dependency on libtirpc package/iproute2: fix build failure due to missing
BR2_PACKAGE_LIBTIRPC_RPCDB

 package/iproute2/Config.in   | 1 +
 package/iproute2/iproute2.mk | 4 ++++
 2 files changed, 5 insertions(+)
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/2 package/iproute2: add optional dependency on libtirpc

From: Yegor Yefremov <[email protected]>

iproute2's configure script probes for libtirpc through pkg-config and, when found, enables HAVE_RPC and links ss against it. libtirpc was never listed in IPROUTE2_DEPENDENCIES though, so whether the feature ends up enabled depended on whether libtirpc happened to be built before iproute2.

Add the missing optional dependency to make the build reproducible.

Assisted-by Claude:claude-opus-5
---
 package/iproute2/iproute2.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/iproute2/iproute2.mk +4 -0
index fe7a6fc304..344a6fa8e4 100644
@@ -25,6 +25,10 @@ ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 IPROUTE2_DEPENDENCIES += libselinux
 endif
 
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+IPROUTE2_DEPENDENCIES += libtirpc
+endif
+
 ifeq ($(BR2_PACKAGE_IPTABLES)x$(BR2_STATIC_LIBS),yx)
 IPROUTE2_DEPENDENCIES += iptables
 else
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 1/2] package/iproute2: add optional dependency on libtirpc

In reply of:

Quoted 10 lines

iproute2's configure script probes for libtirpc through pkg-config and, when found, enables HAVE_RPC and links ss against it. libtirpc was never listed in IPROUTE2_DEPENDENCIES though, so whether the feature ends up enabled depended on whether libtirpc happened to be built before iproute2.

Add the missing optional dependency to make the build reproducible.

Assisted-by Claude:claude-opus-5

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 9 lines
---
 package/iproute2/iproute2.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/iproute2/iproute2.mk +0 -0
index fe7a6fc304..344a6fa8e4 100644

package/iproute2/iproute2.mk ifeq ($(BR2_PACKAGE_LIBSELINUX),y) · line 34

Quoted 10 lines
package/iproute2/iproute2.mk +4 -0
@@ -25,6 +25,10 @@ ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
 IPROUTE2_DEPENDENCIES += libselinux
 endif
 
+ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
+IPROUTE2_DEPENDENCIES += libtirpc
+endif
+
 ifeq ($(BR2_PACKAGE_IPTABLES)x$(BR2_STATIC_LIBS),yx)
 IPROUTE2_DEPENDENCIES += iptables
 else

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

PATCH 2/2 package/iproute2: fix build failure due to missing BR2_PACKAGE_LIBTIRPC_RPCDB

In reply to Yegor Yefremov via buildroot

From: Yegor Yefremov <[email protected]>

iproute2's configure script enables HAVE_RPC as soon as libtirpc is found, and misc/ss.c then calls getrpcbynumber() from its RPC service resolver. Since the bump of libtirpc to version 1.3.7 in Buildroot commit 3f3d6e43de9b4aac7df8545fd811171256f878d3, which includes upstream commit:
https://git.linux-nfs.org/?p=steved/libtirpc.git;a=commit;h=7cea8ad66aecc21e6caae330b5d31075af399193
that symbol is only exported when libtirpc is configured with --enable-rpcdb. On non-glibc toolchains there is no libc fallback either, so linking ss fails:

ld: ss.o: in function `init_service_resolver':
ss.c:(.text+0x2558): undefined reference to `getrpcbynumber'

Select BR2_PACKAGE_LIBTIRPC_RPCDB when libtirpc is enabled, like lsof and other users of these functions already do.

Fixes:
https://autobuild.buildroot.org/results/390b7ed00da20c2349fe069ade4a65404834a484/

Assisted-by Claude:claude-opus-5
---
 package/iproute2/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/iproute2/Config.in +1 -0
index ab9e515eca..106a0aaf2c 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_IPROUTE2
 	bool "iproute2"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # __kernel_{u,}long_t
+	select BR2_PACKAGE_LIBTIRPC_RPCDB if BR2_PACKAGE_LIBTIRPC
 	help
 	  Kernel routing and traffic control utilities. Provides things
 	  like ip and tc.
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH 2/2] package/iproute2: fix build failure due to missing BR2_PACKAGE_LIBTIRPC_RPCDB

In reply of:

Quoted 13 lines

iproute2's configure script enables HAVE_RPC as soon as libtirpc is found, and misc/ss.c then calls getrpcbynumber() from its RPC service resolver. Since the bump of libtirpc to version 1.3.7 in Buildroot commit 3f3d6e43de9b4aac7df8545fd811171256f878d3, which includes upstream commit:
https://git.linux-nfs.org/?p=steved/libtirpc.git;a=commit;h=7cea8ad66aecc21e6caae330b5d31075af399193
that symbol is only exported when libtirpc is configured with --enable-rpcdb. On non-glibc toolchains there is no libc fallback either, so linking ss fails:

ld: ss.o: in function `init_service_resolver':
ss.c:(.text+0x2558): undefined reference to `getrpcbynumber'

Quoted 8 lines

Select BR2_PACKAGE_LIBTIRPC_RPCDB when libtirpc is enabled, like lsof and other users of these functions already do.

Fixes:
https://autobuild.buildroot.org/results/390b7ed00da20c2349fe069ade4a65404834a484/

Assisted-by Claude:claude-opus-5

Applied to 2026.08.x. Thanks

Quoted 9 lines
---
 package/iproute2/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/iproute2/Config.in +0 -0
index ab9e515eca..106a0aaf2c 100644

package/iproute2/Config.in config BR2_PACKAGE_IPROUTE2 · line 8

Quoted 7 lines
package/iproute2/Config.in +1 -0
@@ -2,6 +2,7 @@ config BR2_PACKAGE_IPROUTE2
 	bool "iproute2"
 	depends on BR2_USE_MMU # fork()
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4 # __kernel_{u,}long_t
+	select BR2_PACKAGE_LIBTIRPC_RPCDB if BR2_PACKAGE_LIBTIRPC
 	help
 	  Kernel routing and traffic control utilities. Provides things
 	  like ip and tc.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
In reply to Yegor Yefremov via buildroot
Quoted 4 lines · Yegor Yefremov via buildroot

Yegor Yefremov (2):
package/iproute2: add optional dependency on libtirpc package/iproute2: fix build failure due to missing
BR2_PACKAGE_LIBTIRPC_RPCDB

Series applied, thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot