Search code examples
python-2.7buildsolaris-10python-cffipython-cryptography

Installing Python cryptography package from source on Solaris 10


I am trying to install the Python cryptography package on a Solaris 10 system. I have built Python 2.7 and libffi from source in my home directory. I can build cffi by specifying the path to libffi:

$ python setup.py build_ext --include-dirs ~/libffi/lib/libffi-3.2.1/include --library-dirs ~/libffi/lib

However, attempts to build cryptography fail with this error:

ImportError: ld.so.1: python: fatal: relocation error: file /export/home/ef/python/lib/python2.7/site-packages/cffi-1.9.1-py2.7-solaris-2.10-sun4v.32bit.egg/_cffi_backend.so: symbol __sync_synchronize: referenced symbol not found

I have set LD_LIBRARY_PATH to /export/home/ef/libffi/lib.

I notice the following warning when I compile cffi - could it be related?

c/call_python.c:219: warning: implicit declaration of function `__sync_synchronize'

How can I resolve this? All the similar issues I have found online were fixed by installing the relevant OS packages (e.g. sudo apt-get install build-essential libssl-dev libffi-dev python-dev). OpenCSW is not an option.


Solution

  • __sync_synchronize is a built-in function, but it is only supported by gcc and clang. I guess you're using a different compiler or a very old version of gcc or clang. Can you try to install from the cffi trunk? We recently added support for some other compilers (not released yet, will be in version 1.10).

    https://bitbucket.org/cffi/cffi/downloads?tab=branches, download the "default" branch (e.g. by clicking gz).