Fix: disable liblttng-ust-dl if dlinfo is not available in C library
authorRomain Naour <romain.naour@openwide.fr>
Wed, 9 Apr 2014 21:55:07 +0000 (23:55 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 17 Apr 2014 11:55:31 +0000 (07:55 -0400)
According to uClibc commit [1], dlinfo is not available in recent uClibc
(>0.9.33), but available in older version of uClibc (<=0.9.33) whith a
different prototype than glibc.

dlinfo used by liblttng-ust-dl require RTLD_DI_LINKMAP that is not
available in uClibc.

To be able to use LTTng UST with uClibc, we need to disable the Dynamic
Linker Tracing functionality [2] if RTLD_DI_LINKMAP is not detected.

[1] http://git.uclibc.org/uClibc/commit/?id=f3c9dc499c5c787ddd8c4320f2d44d2ae6e40c22
[2] http://lists.lttng.org/pipermail/lttng-dev/2014-February/022423.html

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile.am
configure.ac

index b79d2dd9086fde3e3a524286d129e4f45cdc5e17..c907ff1b64ad306fab50e18b1495c49e905f1f54 100644 (file)
@@ -4,11 +4,14 @@ SUBDIRS = . include snprintf libringbuffer liblttng-ust-comm \
                liblttng-ust \
                liblttng-ust-ctl \
                liblttng-ust-fork \
-               liblttng-ust-dl \
                liblttng-ust-libc-wrapper \
                liblttng-ust-cyg-profile \
                tools
 
+if HAVE_DLINFO
+SUBDIRS += liblttng-ust-dl
+endif
+
 if BUILD_JNI_INTERFACE
 SUBDIRS += liblttng-ust-java liblttng-ust-jul
 endif
index 6e90e72c6d3e762b39702bc8350be3d637cdc971..1b3796579404afc3b54037ef30d8a07b0f029feb 100644 (file)
@@ -123,6 +123,16 @@ AM_CONDITIONAL([LTTNG_UST_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes"])
 
 AC_CHECK_LIB([pthread], [pthread_create])
 
+# Check for dlfcn.h
+AC_CHECK_HEADER([dlfcn.h])
+AS_IF([test "x${ac_cv_header_dlfcn_h}" = "xyes"],
+       [AC_CHECK_DECLS([RTLD_DI_LINKMAP],,,
+               [#define _GNU_SOURCE /* Required on Linux to get GNU extensions */
+               #include <dlfcn.h>])
+       ],
+       [ac_cv_have_decl_RTLD_DI_LINKMAP="no"])
+AM_CONDITIONAL([HAVE_DLINFO], [test "x${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "xyes"])
+
 # Checks for header files.
 #AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
 
This page took 0.030783 seconds and 4 git commands to generate.