devlink: Fix link errors on some systems

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: 6c70aca76e ("devlink: Add port func rate support")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Roi Dayan 2021-06-22 08:42:50 +03:00 committed by Stephen Hemminger
parent 8316825a52
commit 6f15c21719
1 changed files with 1 additions and 0 deletions

View File

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