kumquat-buildroot/package/util-linux/0006-buildsys-fix-static-configuration-and-building.patch
Lada Trimasova c823c6ee6a util-linux: fix static builds with uClibc
In case of uClibc librt depends on libpthread. In particular
timer_create() function uses pthread_XXX(). That means in case
of static builds it's required to link not librt alone but
together with libpthread. So if checking timer_create function
in librt fails, it is necessary to check if timer_create function
successfully links with "-lpthread".

That issues was spotted in Buldroot autobuilder failures:
http://autobuild.buildroot.net/results/759/75960db671807091fe9155aee9e46a6245e32590/
http://autobuild.buildroot.org/results/112/112e8b85783f5aaba42a937a6eb064317615a21b/

0005-build-sys-use-REALTIME_LIBS.patch is a back-port of upstream
b97edfe731
that won't apply cleanly on v2.27.1

0006-buildsys-fix-static-configuration-and-building.patch was just
applied upstream, see 71a77ca1dd

Both patches must be removed on util-linux version bump.

Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-02-02 09:23:37 +01:00

55 lines
1.6 KiB
Diff

From f69e18629d1c91d83ab91314baf5e34088b57f6e Mon Sep 17 00:00:00 2001
From: Lada Trimasova <ltrimas@synopsys.com>
Date: Wed, 27 Jan 2016 16:26:41 +0300
Subject: [PATCH] buildsys: fix static configuration and building
In case of uClibc librt depends on libpthread. In particular
timer_create() function uses pthread_XXX(). That means in case
of static builds it's required to link not librt alone but
together with libpthread. So if checking timer_create function
in librt fails, it is necessary to check if timer_create function
successfully links with "-lpthread".
That issues was spotted in Buldroot autobuilder failures:
http://autobuild.buildroot.net/results/759/75960db671807091fe9155aee9e46a6245e32590/
http://autobuild.buildroot.org/results/112/112e8b85783f5aaba42a937a6eb064317615a21b/
Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
---
configure.ac | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 56512c0..9392bf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,14 +382,23 @@ AC_CHECK_FUNCS([clock_gettime], [],
AC_SUBST([REALTIME_LIBS])
have_timer="no"
-AC_CHECK_FUNCS([timer_createx],
+AC_CHECK_FUNCS([timer_create],
[have_time="yes"],
[AC_CHECK_LIB([rt], [timer_create], [
have_timer="yes"
REALTIME_LIBS="-lrt"
- ])]
+ ],[
+ AC_SEARCH_LIBS([timer_create], [rt], [
+ AC_MSG_RESULT(yes)
+ have_timer="yes"
+ REALTIME_LIBS="-lrt -lpthread"
+ ],[], [-lpthread]
+ )
+ ])]
)
+AC_SUBST([REALTIME_LIBS])
+
AC_CHECK_MEMBER([struct sockaddr.sa_len],
AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
--
2.5.0