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

Romain Naour romain.naour at openwide.fr
Tue Apr 8 19:20:15 EDT 2014


Hi Simon, Yann,

Le 08/04/2014 19:24, Yann E. MORIN a écrit :
> Simon, All,
>
> On 2014-04-08 13:03 -0400, Simon Marchi spake thusly:
>> 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.
>
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





More information about the lttng-dev mailing list