Netdev List
 help / color / mirror / Atom feed
From: Roi Dayan <roid@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: Roi Dayan <roid@nvidia.com>, David Ahern <dsahern@gmail.com>,
	"Dmytro Linkin" <dlinkin@nvidia.com>
Subject: [PATCH iproute2-next] devlink: Fix link errors on some systems
Date: Tue, 22 Jun 2021 08:42:50 +0300	[thread overview]
Message-ID: <20210622054250.2710106-1-roid@nvidia.com> (raw)

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>
---
 devlink/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/devlink/Makefile b/devlink/Makefile
index d540feb3c012..d37a4b4d0241 100644
--- a/devlink/Makefile
+++ b/devlink/Makefile
@@ -7,6 +7,7 @@ ifeq ($(HAVE_MNL),y)
 
 DEVLINKOBJ = devlink.o mnlg.o
 TARGETS += devlink
+LDLIBS += -lm
 
 endif
 
-- 
2.8.0


             reply	other threads:[~2021-06-22  5:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  5:42 Roi Dayan [this message]
2021-06-22  5:43 ` [PATCH iproute2-next] devlink: Fix link errors on some systems Roi Dayan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210622054250.2710106-1-roid@nvidia.com \
    --to=roid@nvidia.com \
    --cc=dlinkin@nvidia.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox