On 03/02/2012 09:35 AM, Heinz-Ado Arnolds wrote:
> I have a minor problem with the *static* building of coreutils. Building
> "timeout" requires libpthread in addition to librt.
> A simple patch is enclosed.
> Thanks a lot for your great work and kind regards,
I'm not sure if this is the right approach for the above issue.
From c18ffcdae1d7ffc012a2cd5dee1e2d0411dcfad8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@...>
Date: Tue, 6 Mar 2012 15:02:40 +0000
Subject: [PATCH] timer-time: link explicitly with pthreads on glibc
To support static linking we need to explicitly
specify the pthreads library which is referenced
(but not used on modern Linux kernels at least).
* m4/timer_time.m4 (LIB_TIMER_TIME): Add -lpthread
when newer GLIBC is detected as that contains
the pthread emulation.
* modules/timer-time: Depend on threadlib to
pull in the appropriate library to link
m4/timer_time.m4 | 16 ++++++++++++++++
modules/timer-time | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/m4/timer_time.m4 b/m4/timer_time.m4
index 6276759..d6e0efe 100644
@@ -11,6 +11,7 @@ AC_DEFUN([gl_TIMER_TIME],
dnl Based on clock_time.m4. See details there.