libxl: fix build with older glibc
authorPaul Durrant <pdurrant@amazon.com>
Tue, 25 Feb 2020 12:33:43 +0000 (12:33 +0000)
committerWei Liu <wl@xen.org>
Tue, 25 Feb 2020 14:28:59 +0000 (14:28 +0000)
Commit 2b02882ebbbc "libxl: add infrastructure to track and query
'recent' domids" added a call to clock_gettime() into libxl. The man-
page for this states:

"Link with -lrt (only for glibc versions before 2.17)."

Unfortunately Centos 6 does have an glibc prior to that version, and the
libxl Makefile was not updated to add '-lrt' so the build will fail in
that environment.

This patch simply adds '-lrt' to LIBXL_LIBS unconditionally, as it does
no harm in newer environments.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Fixes: 2b02882ebbbc ("libxl: add infrastructure to track and query 'recent' domids")
Acked-by: Wei Liu <wl@xen.org>
tools/libxl/Makefile

index ed41e4ee3e8bd83f31c4e1a44c8440917bfd378a..69fcf2157721fb5ec11287cbafce27245cda06e7 100644 (file)
@@ -24,6 +24,9 @@ LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl)
 ifeq ($(CONFIG_LIBNL),y)
 LIBXL_LIBS += $(LIBNL3_LIBS)
 endif
+ifeq ($(CONFIG_Linux),y)
+LIBXL_LIBS += -lrt
+endif
 
 CFLAGS_LIBXL += $(CFLAGS_libxentoollog)
 CFLAGS_LIBXL += $(CFLAGS_libxentoolcore)