Re: [DynInst_API:] Cannot link to dyninst 8.0 on Ubuntu


Date: Sat, 23 Feb 2013 16:01:38 -0500
From: mkfs <semper.non.sequitur@xxxxxxxxx>
Subject: Re: [DynInst_API:] Cannot link to dyninst 8.0 on Ubuntu
Thanks for the quick response.

> Try reordering the compilation line to put your source file first and the
> libraries second. The Ubuntu linker is a single-pass system and so things
> need to be specified in dependence order.

OK, that worked (or at least introduced a new set of errors). I feel a
bit silly not having tried that -- it's how I generally need to
resolve other GNU linker issues.

I had to add all of the other dyninst libraries, as well as -ldl, so
(for the record) the new compile command is now:

bash$ g++ -I/usr/include/dyninst dyninst_test.cpp -ldyninstAPI
-lcommon -lsymtabAPI -lpatchAPI -lparseAPI -lstackwalk -lpcontrol
-linstructionAPI -ldynC_API -ldynDwarf -ldynElf -lsymLite -lsymtabAPI
-ldl

> Are you building libdwarf from source or using the package? I believe the
> package just provides a .a, which you wouldn't be able to link dynamically.

Originally from source, but I switched to using the Ubuntu package of
libdwarf when I found the --with-libdwarf-static in the configure
script.

I am now using the Ubuntu packages for libdwarf and dyninst. The above
g++ command fails with the following error:

/usr/bin/ld: warning: libdwarf.so, needed by /usr/lib/libsymtabAPI.so,
not found (try using -rpath or -rpath-link)

Sure enough, libsymtabAPI expects a .so :

bash$ ldd /usr/lib/libsymtabAPI.so
	linux-vdso.so.1 =>  (0x00007fff26f54000)
	libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f0b45b2c000)
	libdwarf.so => not found
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0b4582b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0b4552f000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0b45319000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0b44f59000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f0b460ab000)

This is something I can get working on my end (by using the source
distro of either libdwarf or dyninst), but it looks like the Dyninst
.deb does not use --with-libdwarf-static.
[← Prev in Thread] Current Thread [Next in Thread→]