From 4b28239d13b17e42eb5aa4b405342f46347f3de4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 23 Sep 2019 16:10:35 +0200 Subject: [PATCH] pthreadpool: Only link pthreadpool against librt if we have to MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This calls clock_gettime() which is available in glibc on Linux. If the wscript in libreplace detected that librt is needed for clock_gettime() we have to link against it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14140 Signed-off-by: Andreas Schneider Signed-off-by: Isaac Boukris Pair-Programmed-With: Isaac Boukris Reviewed-by: Matthias Dieter Wallnöfer Reviewed-by: Alexander Bokovoy --- lib/pthreadpool/wscript_build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pthreadpool/wscript_build b/lib/pthreadpool/wscript_build index 57df25548b1..70aa7cbf041 100644 --- a/lib/pthreadpool/wscript_build +++ b/lib/pthreadpool/wscript_build @@ -1,12 +1,17 @@ #!/usr/bin/env python if bld.env.WITH_PTHREADPOOL: + extra_libs='' + + # Link to librt if needed for clock_gettime() + if bld.CONFIG_SET('HAVE_LIBRT'): extra_libs += ' rt' + bld.SAMBA_SUBSYSTEM('PTHREADPOOL', source='''pthreadpool.c pthreadpool_pipe.c pthreadpool_tevent.c ''', - deps='pthread rt replace tevent-util') + deps='pthread replace tevent-util' + extra_libs) else: bld.SAMBA_SUBSYSTEM('PTHREADPOOL', source='''pthreadpool_sync.c -- 2.11.4.GIT