Skip to contentSkip to conversation

libxl: fix build with older glibc

PATCH In review Paul Durrant 2 participants 2 messages Feb 25, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: fix build with older glibc

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.

Fixes 2b02882ebbbc ("libxl: add infrastructure to track and query 'recent' domids")

---
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Anthony PERARD <[email protected]>

---
 tools/libxl/Makefile | 3 +++
 1 file changed, 3 insertions(+)
tools/libxl/Makefile +3 -0
index ed41e4ee3e..69fcf21577 100644
@@ -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)
Signature · 7 lines
2.20.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Paul Durrant

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.

Quoted 5 lines

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

Fixes 2b02882ebbbc ("libxl: add infrastructure to track and query 'recent' domids")

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel