[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] tests/xenstore: link in librt if necessary

commit 2d4978ead4b98452bc45ebe47952e524b12e2b41
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Sep 3 15:10:43 2021 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Sep 3 15:10:43 2021 +0200

    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 <jbeulich@xxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
 tools/tests/xenstore/Makefile | 3 +++
 1 file changed, 3 insertions(+)

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)
+ifeq ($(CONFIG_Linux),y)
+LDFLAGS += -Wl,--as-needed -lc -lrt
 %.o: Makefile
generated by git-patchbot for /home/xen/git/xen.git#staging



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.