diff options
author | Roi Dayan <roid@nvidia.com> | 2021-01-12 12:33:17 +0200 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2021-01-18 12:28:47 -0800 |
commit | 1a22ad2721fbd970e3d9a97af98427567c65d05d (patch) | |
tree | 050a3eade454b464a17f6c3ef604ce7fed17dc91 /dcb | |
parent | 676a1a708f8e99d6a4faa3de8a093f8f8c14b9da (diff) |
build: Fix link errors on some systems
Since moving get_rate() and get_size() from tc to lib, on some
systems we fail to link because of missing math lib.
Move the functions that require math lib to their own c file
and add -lm to dcb that now use those functions.
../lib/libutil.a(utils.o): In function `get_rate':
utils.c:(.text+0x10dc): undefined reference to `floor'
../lib/libutil.a(utils.o): In function `get_size':
utils.c:(.text+0x1394): undefined reference to `floor'
../lib/libutil.a(json_print.o): In function `sprint_size':
json_print.c:(.text+0x14c0): undefined reference to `rint'
json_print.c:(.text+0x14f4): undefined reference to `rint'
json_print.c:(.text+0x157c): undefined reference to `rint'
Fixes: f3be0e6366ac ("lib: Move get_rate(), get_rate64() from tc here")
Fixes: 44396bdfcc0a ("lib: Move get_size() from tc here")
Fixes: adbe5de96662 ("lib: Move sprint_size() from tc here, add print_size()")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'dcb')
-rw-r--r-- | dcb/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/dcb/Makefile b/dcb/Makefile index 4add954b..7c09bb4f 100644 --- a/dcb/Makefile +++ b/dcb/Makefile @@ -7,6 +7,7 @@ ifeq ($(HAVE_MNL),y) DCBOBJ = dcb.o dcb_buffer.o dcb_ets.o dcb_maxrate.o dcb_pfc.o TARGETS += dcb +LDLIBS += -lm endif |