Skip to contentSkip to conversation

Disable liblttng-ust-dl if dlinfo is not available in C library.

PATCH In review Mathieu Desnoyers 4 participants 5 messages Apr 7, 2014 – Apr 8, 2014 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw

Merged into master and stable-2.4, thanks!

Mathieu

----- Original Message -----

Quoted 65 lines

From: "Romain Naour" <[email protected]>
To: [email protected]
Cc: "Romain Naour" <[email protected]>
Sent: Sunday, April 6, 2014 5:02:41 PM
Subject: [lttng-dev] [PATCH 1/1] Disable liblttng-ust-dl if dlinfo is not available in C library.

According to uClibc commit [1], dlinfo is not available. To be able to use LTTng UST with uClibc, we need to disable the Dynamic Linker Tracing functionality [2].

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

---
 Makefile.am  | 5 ++++-
 configure.ac | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
Makefile.am +4 -1
index b79d2dd..c907ff1 100644
@@ -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

configure.ac +3 -0
index b04d4e3..de6300e 100644
@@ -146,6 +146,9 @@ AC_C_INLINE
 AC_FUNC_MALLOC
 AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpu
 sysconf])
 
+AC_CHECK_FUNCS([dlinfo])
+AM_CONDITIONAL([HAVE_DLINFO], [test "${ac_cv_func_dlinfo}" = "yes"])
+
 CFLAGS="-Wall $CFLAGS"
 

# URCU
--
1.9.0

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 Disable liblttng-ust-dl if dlinfo is not available in C library.

Hi Mathieu,

Le 07/04/2014 22:42, Mathieu Desnoyers a ?crit :

Quoted 3 lines

Merged into master and stable-2.4, thanks!

Mathieu

You're welcome.

Best regards,
Romain Naour

Quoted 67 lines

----- Original Message -----

Quoted 65 lines

From: "Romain Naour" <[email protected]>
To: lttng-dev at lists.lttng.org
Cc: "Romain Naour" <[email protected]>
Sent: Sunday, April 6, 2014 5:02:41 PM
Subject: [lttng-dev] [PATCH 1/1] Disable liblttng-ust-dl if dlinfo is not available in C library.

According to uClibc commit [1], dlinfo is not available. To be able to use LTTng UST with uClibc, we need to disable the Dynamic Linker Tracing functionality [2].

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

---
  Makefile.am  | 5 ++++-
  configure.ac | 3 +++
  2 files changed, 7 insertions(+), 1 deletion(-)
Makefile.am +4 -1
index b79d2dd..c907ff1 100644
@@ -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

configure.ac +3 -0
index b04d4e3..de6300e 100644
@@ -146,6 +146,9 @@ AC_C_INLINE
  AC_FUNC_MALLOC
  AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpu
  sysconf])
 
+AC_CHECK_FUNCS([dlinfo])
+AM_CONDITIONAL([HAVE_DLINFO], [test "${ac_cv_func_dlinfo}" = "yes"])
+
  CFLAGS="-Wall $CFLAGS"
 

# URCU
--
1.9.0

_______________________________________________
lttng-dev mailing list
lttng-dev at lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

#4 lore raw

Hi Romain,

It seems like with that commit, dlinfo is not found even on a glibc based system, where it is present.

See https://bugs.lttng.org/issues/778

Do you have a suggestion to fix that ?

Simon

Quoted 87 lines · Romain Naour

Hi Mathieu,

Quoted 3 lines · Mathieu Desnoyers

Merged into master and stable-2.4, thanks!

Mathieu

You're welcome.

Best regards,
Romain Naour

Quoted 62 lines

----- Original Message -----

Quoted 60 lines

From: "Romain Naour" <[email protected]>
To: [email protected]
Cc: "Romain Naour" <[email protected]>
Sent: Sunday, April 6, 2014 5:02:41 PM
Subject: [lttng-dev] [PATCH 1/1] Disable liblttng-ust-dl if dlinfo is not available in C library.

According to uClibc commit [1], dlinfo is not available. To be able to use LTTng UST with uClibc, we need to disable the Dynamic Linker Tracing functionality [2].

[1]

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

---
  Makefile.am  | 5 ++++-
  configure.ac | 3 +++
  2 files changed, 7 insertions(+), 1 deletion(-)
Makefile.am +3 -1
index b79d2dd..c907ff1 100644
@@ -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
configure.ac +2 -1
index b04d4e3..de6300e 100644
@@ -146,6 +146,9 @@ AC_C_INLINE
  AC_FUNC_MALLOC
  AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol sched_getcpu
  sysconf])
  +AC_CHECK_FUNCS([dlinfo])
+AM_CONDITIONAL([HAVE_DLINFO], [test "${ac_cv_func_dlinfo}" = "yes"])
+
  CFLAGS="-Wall $CFLAGS"
    # URCU
--

1.9.0

Quoted 5 lines
Quoted 5 lines

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CAFXXi0kAZJDD7ygqs493ZPvJHMpkeuMTDvxHqMg9B722pJHHxQ@mail.gmail.com

#6 lore raw

PATCH 1/1 Disable liblttng-ust-dl if dlinfo is not available in C library.

Simon, All,

On 2014-04-08 13:03 -0400, Simon Marchi spake thusly:

Quoted 8 lines

Hi Romain,

It seems like with that commit, dlinfo is not found even on a glibc based system, where it is present.

See https://bugs.lttng.org/issues/778

Do you have a suggestion to fix that ?

I think we should use AC_CHECK_DECL instead of AC_CHECK_FUNCS.

dlinfo is in dlfcn.h so we need a check that allows us to include that header, and we must check for that header first, of course. So, maybe something like (completely untested, directly written in the mail):

    AC_CHECK_HEADER([dlfcn.h])
    AS_IF([test "${ac_cv_header_dlfcn_h}" = "yes"],
          [AC_CHECK_DECL([dlinfo],,,[dlfcn.h])],
          [ac_cv_have_decl_dlinfo="no"])
    AM_CONDITIONAL([HAVE_DLINFO], [test "${ac_cv_have_decl_dlinfo}" = "yes"])

But I'm no expert in autoconf, so the actual solution may be slightly different.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 1/1 Disable liblttng-ust-dl if dlinfo is not available in C library.

Hi Simon, Yann,

Le 08/04/2014 19:24, Yann E. MORIN a ?crit :

Quoted 23 lines

Simon, All,

On 2014-04-08 13:03 -0400, Simon Marchi spake thusly:

Quoted 8 lines

Hi Romain,

It seems like with that commit, dlinfo is not found even on a glibc based system, where it is present.

See https://bugs.lttng.org/issues/778

Do you have a suggestion to fix that ?

I think we should use AC_CHECK_DECL instead of AC_CHECK_FUNCS.

dlinfo is in dlfcn.h so we need a check that allows us to include that header, and we must check for that header first, of course. So, maybe something like (completely untested, directly written in the mail):

     AC_CHECK_HEADER([dlfcn.h])
     AS_IF([test "${ac_cv_header_dlfcn_h}" = "yes"],
           [AC_CHECK_DECL([dlinfo],,,[dlfcn.h])],
           [ac_cv_have_decl_dlinfo="no"])
     AM_CONDITIONAL([HAVE_DLINFO], [test "${ac_cv_have_decl_dlinfo}" = "yes"])
Quoted 6 lines

But I'm no expert in autoconf, so the actual solution may be slightly different.

Regards,
Yann E. MORIN.

Sorry for the mistake, here is a new try:

AC_CHECK_HEADER([dlfcn.h])
AS_IF([test "${ac_cv_header_dlfcn_h}" = "yes"],

     [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 "${ac_cv_have_decl_RTLD_DI_LINKMAP}" = "yes"])

I can't use dlinfo directly here because it isdetected even if it is not available in uClibc. (detected fromust-dlfcn.h ?) So, I use RTLD_DI_LINKMAP which is not defined in uClibc.

I'll send the patch later (after doing some test)

Best regards,
Romain Naour