DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: fix link with glibc < 2.17
@ 2016-07-25 10:57 Thomas Monjalon
  2016-07-25 15:59 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2016-07-25 10:57 UTC (permalink / raw)
  To: dev

There is a dependency on librt with old glibc.
The -lrt option was added everywhere it is needed but was also
added in some applications makefiles as the first link option.
The problem is this option is really useful only if added after
the objects or libraries using it (except if using --whole-archive).
And the -lrt options put after were removed to avoid duplicates.

It was resulting in errors linking test application:
eal_timer.c:(.text+0x128): undefined reference to `clock_gettime'
eal_timer.c:(.text+0x166): undefined reference to `clock_gettime'
eal_alarm.c:(.text+0xda): undefined reference to `clock_gettime'
eal_alarm.c:(.text+0x211): undefined reference to `clock_gettime'

It is fixed by removing superflous -lrt in app makefiles.

Fixes: 281948b4753e ("mk: fix missing librt dependencies")
Fixes: 2f6414f4baf1 ("mk: fix static link with glibc < 2.17")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 app/test/Makefile           | 1 -
 examples/ptpclient/Makefile | 1 -
 2 files changed, 2 deletions(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index 6015b19..49ea195 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -158,7 +158,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_string.c
 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c
 
 ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
-LDLIBS += -lrt
 SRCS-y += test_red.c
 SRCS-y += test_sched.c
 endif
diff --git a/examples/ptpclient/Makefile b/examples/ptpclient/Makefile
index d241730..b77cf71 100644
--- a/examples/ptpclient/Makefile
+++ b/examples/ptpclient/Makefile
@@ -46,7 +46,6 @@ SRCS-y := ptpclient.c
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
-LDLIBS += -lrt
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
-- 
2.7.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-25 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-25 10:57 [dpdk-dev] [PATCH] mk: fix link with glibc < 2.17 Thomas Monjalon
2016-07-25 15:59 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).