Groundworkstech / pybfd

A Python interface to the GNU Binary File Descriptor (BFD) library.
GNU General Public License v2.0
121 stars 23 forks source link

Failure to find static binutils ArchLinux binutils 2.25.1 #4

Open archey opened 9 years ago

archey commented 9 years ago

We are working on building this tool into the archassault repo, to bring in the barf-project. Now per upstream Arch binutils is built statically, as /usr/include/bfd.h and /usr/include/dis-asm.h exist, however the setup.py is failing to see it.

python2 setup.py build running build running build_py running build_ext [+] Using binutils headers at: [+] /usr/include [+] Searching binutils libraries... Traceback (most recent call last): File "setup.py", line 431, in main "Topic :: Utilities" File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 127, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run self.build_extensions() File "setup.py", line 320, in build_extensions raise Exception("unable to find binutils libraries.") Exception: unable to find binutils libraries. [-] Error : unable to find binutils libraries.

find /usr/include -type f -name bfd.h -print -or -name dis-asm.h -print /usr/include/dis-asm.h /usr/include/bfd.h

Name : binutils Version : 2.25-1 Description : A set of programs to assemble and manipulate binary and object files Architecture : x86_64

Can you be of any assistance with this?

alfred-gw commented 9 years ago

Do you have multiarch binutils? you may try uninstalling it and try using the regular bfd. Or just try the latest revision, I just add a patch that support multiarch on debian-like distros.

archey commented 9 years ago

yeah I was using the version from pypi, but that its having issues like the git version from your master. Forgive my simpleton but which is the regular bfd?

archey commented 9 years ago

ArchLinux doesnt uses a multiarch-binutils we have a static bintuils built from upstream and /usr/include/bfd.h exists, let me try with the latest git version.

archey commented 9 years ago

Ok I have tried with both the pypi versions 0.1.1 and the git version, it still does not find the bfd.h and dis-asm.h files in /usr/include. I have verified they do exist and are being built statically, I tried to use the --with-static-binutils option as well with both pypi version and git version. Here is a link to the version of binutils and the file list https://www.archlinux.org/packages/core/x86_64/binutils/files/

As you can see the bfd.h dis-asm.h are in /usr/include, please let us know if we can test anything else for you.

archey commented 9 years ago

Any update on this?

q6r commented 9 years ago

@archey The way to fix it either fix the build script to find the right names or ln -s these files /usr/lib/libbfd-2....0.so -> /usr/lib/libbfd.so /usr/lib/libopcodes-2...0.so -> /usr/lib/libopcodes.so then it'll be able to find them

archey commented 9 years ago

Ok @q6r Ill see what I can do to patch it and fix it