Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2018 10:34:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        office@FreeBSD.org
Subject:   [Bug 227939] devel/boost-python-libs vs ctypes.util.find_library
Message-ID:  <bug-227939-25061-9KWyYQ4cIl@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-227939-25061@https.bugs.freebsd.org/bugzilla/>
References:  <bug-227939-25061@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227939

--- Comment #11 from Jan Beich <jbeich@FreeBSD.org> ---
(In reply to Wiktor Niesiobedzki from comment #9)
> another strategy available on Linux - invoking gcc in trace mode and extr=
acting 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 =3D dlopen("libpython3.6m.so", RTLD_LAZY | RTLD_GLOBAL))) {
    printf("dlopen(python) failed\n");
    return 1;
  }

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

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

  return 0;
}

$ cc -ldl a.c
$ ./a.out
/usr/local/lib/libboost_python36.so

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227939-25061-9KWyYQ4cIl>