The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / bluez5_utils / 0001-Link-mcaptest-with-lrt-when-needed.patch
1 From 54b8977c2f854d04f9c6383e2cac76ea4cde3eaa Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Mon, 29 Dec 2014 12:23:41 +0100
4 Subject: [PATCH] Link mcaptest with -lrt when needed
5
6 The mcaptest tool uses the profiles/health/mcap.c source file, which
7 calls clock_getres(). This function is defined in librt in some C
8 libraries, so mcaptest should be linked against librt when needed,
9 otherwise one gets link failures such as:
10
11 ld: profiles/health/mcap.o: undefined reference to symbol 'clock_getres@@GLIBC_2.2.5'
12 ld: note: 'clock_getres@@GLIBC_2.2.5' is defined in DSO [...]/sysroot/lib64/librt.so.1 so try adding it to the linker command line
13 [...]/sysroot/lib64/librt.so.1: could not read symbols: Invalid operation
14 collect2: error: ld returned 1 exit status
15 Makefile:4184: recipe for target 'tools/mcaptest' failed
16
17 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
18 ---
19  Makefile.tools | 2 +-
20  configure.ac   | 5 +++++
21  2 files changed, 6 insertions(+), 1 deletion(-)
22
23 diff --git a/Makefile.tools b/Makefile.tools
24 index bc827fe..fef3db5 100644
25 --- a/Makefile.tools
26 +++ b/Makefile.tools
27 @@ -195,7 +195,7 @@ tools_mcaptest_SOURCES = tools/mcaptest.c \
28                                 btio/btio.h btio/btio.c \
29                                 src/log.c src/log.h \
30                                 profiles/health/mcap.h profiles/health/mcap.c
31 -tools_mcaptest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
32 +tools_mcaptest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ @RT_LIBS@
33  
34  dist_man_MANS += tools/hciattach.1 tools/hciconfig.1 \
35                         tools/hcitool.1 tools/hcidump.1 \
36 diff --git a/configure.ac b/configure.ac
37 index 4739c10..b0afba6 100644
38 --- a/configure.ac
39 +++ b/configure.ac
40 @@ -54,6 +54,11 @@ AC_CHECK_LIB(pthread, pthread_create, dummy=yes,
41  AC_CHECK_LIB(dl, dlopen, dummy=yes,
42                         AC_MSG_ERROR(dynamic linking loader is required))
43  
44 +AC_SEARCH_LIBS([clock_getres], [rt],
45 +                       [test "$ac_cv_search_clock_getres" = "none required" ||
46 +                       RT_LIBS=$ac_cv_search_clock_getres])
47 +AC_SUBST([RT_LIBS])
48 +
49  PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
50                                 AC_MSG_ERROR(GLib >= 2.28 is required))
51  AC_SUBST(GLIB_CFLAGS)
52 -- 
53 2.1.0
54