]> xenbits.xensource.com Git - xen.git/commitdiff
tests/xenstore: link in librt if necessary
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Sep 2021 13:10:43 +0000 (15:10 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Sep 2021 13:10:43 +0000 (15:10 +0200)
Old enough glibc has clock_gettime() in librt.so, hence the library
needs to be specified to the linker. Newer glibc has the symbol
available in both libraries, so make sure that libc.so is preferred (to
avoid an unnecessary dependency on librt.so).

Fixes: 93c9edbef51b ("tests/xenstore: Rework Makefile")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
tools/tests/xenstore/Makefile

index b9969dd090055ab7b68d089f80fb2711b43094de..239e1dce47f8b92199ff3a79a8baf482a6353386 100644 (file)
@@ -33,6 +33,9 @@ CFLAGS += $(APPEND_CFLAGS)
 
 LDFLAGS += $(LDLIBS_libxenstore)
 LDFLAGS += $(APPEND_LDFLAGS)
+ifeq ($(CONFIG_Linux),y)
+LDFLAGS += -Wl,--as-needed -lc -lrt
+endif
 
 %.o: Makefile