From patchwork Fri Aug 19 13:50:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 660882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sG49Z2WPfz9t1G for ; Fri, 19 Aug 2016 23:50:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C0EBF8C36B; Fri, 19 Aug 2016 13:50:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ob6NmE8136bc; Fri, 19 Aug 2016 13:50:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 915C18BADB; Fri, 19 Aug 2016 13:50:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id C61251C0FFC for ; Fri, 19 Aug 2016 13:50:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BA439275D5 for ; Fri, 19 Aug 2016 13:50:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iq2AeYY1evHi for ; Fri, 19 Aug 2016 13:50:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by silver.osuosl.org (Postfix) with ESMTP id 0B74E2618C for ; Fri, 19 Aug 2016 13:50:32 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 104A921F5; Fri, 19 Aug 2016 15:50:31 +0200 (CEST) Received: from localhost (132.230.147.77.rev.sfr.net [77.147.230.132]) by mail.free-electrons.com (Postfix) with ESMTPSA id 9E9A8372; Fri, 19 Aug 2016 15:50:30 +0200 (CEST) From: Thomas Petazzoni To: buildroot@buildroot.org Date: Fri, 19 Aug 2016 15:50:29 +0200 Message-Id: <1471614629-30038-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.7.4 Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH] lirc-tools: fix build issue related to clock_gettime() X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In some older versions of glibc, clock_gettime() is in librt, so we need to link with librt when clock_gettime() is used. This commit adds a lirc-tools patch to make sure we link with librt when needed. Fixes: http://autobuild.buildroot.net/results/2770360880c9b265c8e019141925e56c35ba22dc/ Signed-off-by: Thomas Petazzoni --- ...onfigure-check-for-clock_gettime-in-librt.patch | 54 ++++++++++++++++++++++ package/lirc-tools/lirc-tools.mk | 1 + 2 files changed, 55 insertions(+) create mode 100644 package/lirc-tools/0004-configure-check-for-clock_gettime-in-librt.patch diff --git a/package/lirc-tools/0004-configure-check-for-clock_gettime-in-librt.patch b/package/lirc-tools/0004-configure-check-for-clock_gettime-in-librt.patch new file mode 100644 index 0000000..710dfd3 --- /dev/null +++ b/package/lirc-tools/0004-configure-check-for-clock_gettime-in-librt.patch @@ -0,0 +1,54 @@ +From e654ae139cec42a6f1b5684261787d0c241cfd3b Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Fri, 19 Aug 2016 15:25:48 +0200 +Subject: [PATCH] configure: check for clock_gettime in librt + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 3 +++ + daemons/Makefile.am | 2 +- + plugins/Makefile.am | 1 + + 3 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 73340c7..466e638 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -67,6 +67,9 @@ AC_CHECK_FUNCS(gethostname gettimeofday mkfifo select socket strdup \ + AC_SEARCH_LIBS([dlopen], [dl dld], [], [ + AC_MSG_ERROR([unable to find the dlopen() function]) + ]) ++# glibc < 2.17 needs librt for clock_gettime() ++AC_CHECK_LIB(rt, clock_gettime, LIBCLOCK_GETTIME="-lrt") ++AC_SUBST(LIBCLOCK_GETTIME) + AC_CHECK_FUNCS(daemon) + if test "$ac_cv_func_daemon" != yes; then + daemon="" +diff --git a/daemons/Makefile.am b/daemons/Makefile.am +index 5625627..85a28f3 100644 +--- a/daemons/Makefile.am ++++ b/daemons/Makefile.am +@@ -21,7 +21,7 @@ sbin_PROGRAMS += lircd-uinput + endif + + lircd_SOURCES = lircd.cpp +-lircd_LDADD = ../lib/liblirc.la ++lircd_LDADD = ../lib/liblirc.la @LIBCLOCK_GETTIME@ + + lircd_uinput_SOURCES = lircd-uinput.cpp + lircd_uinput_LDADD = ../lib/liblirc.la +diff --git a/plugins/Makefile.am b/plugins/Makefile.am +index ddff01d..45c012a 100644 +--- a/plugins/Makefile.am ++++ b/plugins/Makefile.am +@@ -127,6 +127,7 @@ zotac_la_SOURCES = zotac.c + + plugin_LTLIBRARIES += mplay.la + mplay_la_SOURCES = mplay.c ++mplay_la_LIBADD = @LIBCLOCK_GETTIME@ + endif + + $(srcdir)/pluginlist.am: +-- +2.7.4 + diff --git a/package/lirc-tools/lirc-tools.mk b/package/lirc-tools/lirc-tools.mk index ca775f7..547df46 100644 --- a/package/lirc-tools/lirc-tools.mk +++ b/package/lirc-tools/lirc-tools.mk @@ -13,6 +13,7 @@ LIRC_TOOLS_DEPENDENCIES = host-libxslt host-pkgconf host-python3 LIRC_TOOLS_INSTALL_STAGING = YES # 0001-lib-use-proper-linking-method-to-avoid-parallel-buil.patch # 0003-Don-t-build-commandir-unless-we-have-usb.h-191.patch +# 0004-configure-check-for-clock_gettime-in-librt.patch LIRC_TOOLS_AUTORECONF = YES LIRC_TOOLS_CONF_ENV = XSLTPROC=yes