]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: Fix link errors on some systems
authorRoi Dayan <roid@nvidia.com>
Tue, 22 Jun 2021 05:42:50 +0000 (08:42 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Sat, 26 Jun 2021 21:57:27 +0000 (14:57 -0700)
On some systems we fail to link because of missing math lib.
add -lm to devlink.

    LINK     devlink
../lib/libutil.a(utils_math.o): In function `get_rate':
utils_math.c:(.text+0xcc): undefined reference to `floor'
../lib/libutil.a(utils_math.o): In function `get_size':
utils_math.c:(.text+0x384): undefined reference to `floor'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:16: devlink] Error 1
make: *** [Makefile:64: all] Error 2

Fixes: 6c70aca76ef2 ("devlink: Add port func rate support")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/Makefile

index d540feb3c0121c50573705e902ba3bacc5e758ff..d37a4b4d024103f5dfd5a488e6066307696f2c96 100644 (file)
@@ -7,6 +7,7 @@ ifeq ($(HAVE_MNL),y)
 
 DEVLINKOBJ = devlink.o mnlg.o
 TARGETS += devlink
+LDLIBS += -lm
 
 endif