How to build libpthread.so from source code?
I need a 开发者_开发问答non-stripped version of libpthread.so for debugging. How can I compile it from source code? Host is Linux 2.6.
If you're on an RPM based system, use rpm -qf .../libpthread.so
to find out which package installed the file (if that doesn't produce a result, the .so file is probably a link; then run the command on the file the link points to).
If you have the package name, search for the "source package". How this works depends on the distribution you use. For openSUSE, you must add the Source Repository using Yast. After that, you can install the source package which will give you some entries under /usr/src/packages
. To build the package, go to /usr/src/packages/SPECS
and run rpmbuild
with the pthread.spec
file as parameter.
When the build suceeds, edit the .spec
file and change it so it doesn't strip the symbols.
Alternatively, look if there is a *-debug
package (replace "*" with the name of the package) and install that. It should contain the version of the library with the symbols.
精彩评论