From: Jan Beulich Date: Fri, 3 Sep 2021 13:10:43 +0000 (+0200) Subject: tests/xenstore: link in librt if necessary X-Git-Tag: 4.16.0-rc1~194 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2d4978ead4b98452bc45ebe47952e524b12e2b41;p=xen.git tests/xenstore: link in librt if necessary 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 Reviewed-by: Juergen Gross Acked-by: Ian Jackson --- diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile index b9969dd090..239e1dce47 100644 --- a/tools/tests/xenstore/Makefile +++ b/tools/tests/xenstore/Makefile @@ -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