Open cederom opened 3 years ago
We have no FreeBSD to try. Can you send a pull req?
Thanks @aquynh for ultra fast response :-) I have cloned the repository and it turns out that missing LIBCAPSTONE_PATH
seems to be the cause on FreeBSD where all userland is located in /usr/local
not /
as in Linux :-)
% LIBCAPSTONE_PATH=/usr/local/lib python setup.py build
Can we put some sort of if
that would detect FreeBSD and set that path or simply add this path to search? If so where should I put this one? With that hint I will provide a pr in a moment :-)
Hmm, even with this path provided in env, the installed python module does not remember where to find a library. Probably /usr/local/lib
needs to be added into the search path :-)
./test_basic.py
Traceback (most recent call last):
File "./test_basic.py", line 5, in <module>
from capstone import *
File "/x/capstone.git/bindings/python/capstone/__init__.py", line 315, in <module>
raise ImportError("ERROR: fail to load the dynamic library.")
ImportError: ERROR: fail to load the dynamic library.
I have found a hint [1] to use python setup.py build --rpath=/usr/local/lib
to "bake in" the library path but current setup.py
does not seem to know -R
nor --rpath
stuff :-(
% LIBCAPSTONE_PATH=/usr/local/lib python setup.py build --rpath=/usr/local/lib
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --rpath not recognized
We need to find a way to "bundle" the library path within the python module. When building the module without LIBCAPSTONE_PATH
I get exactly the same error as pip
produces trying to build the whole stuff (C extenstions + Python module).
We need to use either system provided library or fix the C module from within the Python binding (using cmake
by hand it builds fine).
Build problem is a make
(bsd) vs gmake
(gnu) issue. When using gmake
it builds fine. When using cmake
it builds even better :-) Will prepare the pr and report back :-)
Here you go https://github.com/aquynh/capstone/pull/1750 :-) Thank you for this amazing tool set! :-)
Hey @aquynh there goes yet another fix to build on all BSD platforms https://github.com/aquynh/capstone/pull/1753 :-) Tested on FreeBSD, OpenBSD, NetBSD :-)
Would that be possible to create a patch release 4.0.3
that builds on BSD with pip
please? :-)
Ping to @aquynh with release schedule question? That blocks pip build on BSD platforms..
ping ping ping to @aquynh the capstone release is the last blocker of pyOCD on BSD platforms..
@aquynh release request ping..
Good day, on FreeBsd 13.2 x64 still not installing.
The fix LIBCAPSTONE_PATH=/usr/local/lib pip install capstone
solved problem.
If I remember correctly @kabeor said somewhere that v4 is no longer supported with the v5 release. @kabeor could you confirm this?
Hello world :-)
Capstone is now a dependency for https://github.com/pyocd/pyOCD and it does not build on FreeBSD when installing with
pip
:-(The capstone 3 and 4 packages are available and I have installed version 4 on my system. Even though I cannot build a Python package. Build log is provided below. At first glance it looks like
/bin/sh
vs/bin/bash
ormake
(bsd) vsgmake
(gnu) problem..? Also build complains about missinglibcapstone.so.4
but this one is installed - missing/usr/local/
prefix somewhere?Any hints welcome :-)