On 12.08.2021 13:24, Ian Jackson wrote: > Jan Beulich writes ("[PATCH] tests/xenstore: link in librt"): >> Old enough glibc has clock_gettime() in librt.so, hence the library >> needs to be specified to the linker. >> >> Fixes: 93c9edbef51b ("tests/xenstore: Rework Makefile") >> Signed-off-by: Jan Beulich <jbeul...@suse.com> >> --- >> Cc list based on the assumption that the XENSTORE section of >> ./MAINTAINERS probably ought to list the containing directory. >> >> --- a/tools/tests/xenstore/Makefile >> +++ b/tools/tests/xenstore/Makefile >> @@ -31,6 +31,7 @@ CFLAGS += -Werror >> CFLAGS += $(CFLAGS_libxenstore) >> CFLAGS += $(APPEND_CFLAGS) >> >> +LDFLAGS += -lrt > > Don't this unconditionally is definitely not right.
Assuming you meant "Doing this ..." - why? If the concern is that librt.so may needlessly get recorded in a DT_NEEDED entry, then I can replace the early addition with a late LDFLAGS += -Wl,--as-needed -lc -lrt one. > How old a glibc are we talking about ? (I looked at the minimum > versions listed in README and there's notthing about glibc; perhaps > should be.) I've hit this with 2.11.3. I guess it has been made available by libc.so from 2.17 onwards, considering the symbol version is GLIBC_2.17. Jan