[Bug 227939] devel/boost-python-libs vs ctypes.util.find_library

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Bug 227939] devel/boost-python-libs vs ctypes.util.find_library


--- Comment #11 from Jan Beich <[hidden email]> ---
(In reply to Wiktor Niesiobedzki from comment #9)
> another strategy available on Linux - invoking gcc in trace mode and extracting library path from there.

Why Python cannot use dlinfo()?

$ cat a.c
#define _GNU_SOURCE
#include <dlfcn.h>
#include <link.h>
#include <stdio.h>

int main()
  void *boost, *python;
  struct link_map *map;

  /* libboost_python assumes libpython is preloaded by Python interpreter */
  if (!(python = dlopen("libpython3.6m.so", RTLD_LAZY | RTLD_GLOBAL))) {
    printf("dlopen(python) failed\n");
    return 1;

  if (!(boost = dlopen("libboost_python36.so", RTLD_LAZY))) {
    printf("dlopen(boost) failed\n");
    return 1;
  dlinfo(boost, RTLD_DI_LINKMAP, &map);

  printf("%s\n", map->l_name);

  return 0;

$ cc -ldl a.c
$ ./a.out

You are receiving this mail because:
You are on the CC list for the bug.
[hidden email] mailing list
To unsubscribe, send any mail to "[hidden email]"