]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
netshaper: fix build failure main
authorAndrea Claudi <aclaudi@redhat.com>
Tue, 28 Oct 2025 22:17:56 +0000 (23:17 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 30 Oct 2025 00:02:54 +0000 (17:02 -0700)
netshaper fails to build from sources with this error:

$ make
netshaper
    CC       netshaper.o
    LINK     netshaper
/usr/bin/ld: ../lib/libutil.a(utils_math.o): in function `get_rate':
utils_math.c:(.text+0x97): undefined reference to `floor'
/usr/bin/ld: ../lib/libutil.a(utils_math.o): in function `get_size64':
utils_math.c:(.text+0x2a8): undefined reference to `floor'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:10: netshaper] Error 1
make: *** [Makefile:81: all] Error 2

Fix this simply linking against the math C library, similarly to what we
already did with commit 1a22ad2721fb ("build: Fix link errors on some
systems").

Fixes: 6f7779ad4ef6 ("netshaper: Add netshaper command")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
netshaper/Makefile

index 3b293604165ef9ee1d878b3b43e39afdeea12ab4..54a6a691b00e39e32829e69385f7325e9bcd97f9 100644 (file)
@@ -3,6 +3,7 @@ include ../config.mk
 
 NSOBJ = netshaper.o
 TARGETS += netshaper
+LDLIBS += -lm
 
 all: $(TARGETS) $(LIBS)