]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
src/Makefile: Link clock_gettime(2) with -lrt
authorXiao Yang <yangx.jy@cn.fujitsu.com>
Thu, 21 Feb 2019 07:39:01 +0000 (15:39 +0800)
committerEryu Guan <guaneryu@gmail.com>
Fri, 22 Feb 2019 01:03:44 +0000 (09:03 +0800)
Compiling t_open_tmpfiles.c failed on older glibc(before glibc v2.17)
because clock_gettime(2) was not linked with -lrt, as below:
--------------------------------------------------------------------
/home/yangxiao/xfstests/src/t_open_tmpfiles.c:36: undefined reference to `clock_gettime'
--------------------------------------------------------------------

According to clock_gettime(2) manpage, we should link clock_gettime(2)
with -lrt on older glibc.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/Makefile

index dbba7c78d18d6abad254d2490d28ed89c904131d..4057d7b3ffed3dcf8d1846ba94de2f3662f56810 100644 (file)
@@ -31,7 +31,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
 
 SUBDIRS = log-writes perf
 
-LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL) -lpthread
+LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL) -lpthread -lrt
 
 ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
 LINUX_TARGETS += loggen