0

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.

Community
  • 1
  • 1
ef99
  • 3
  • 2

1 Answers1

0

__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).

Armin Rigo
  • 12,048
  • 37
  • 48
  • Thanks for your reply. I am using gcc version 3.4.3. I have compiled cffi from the trunk (cffi-cffi-3234afed406d.tar.gz) as suggested. However, I'm still getting the same fatal:relocation error when I try to build cryptography. – ef99 Jan 12 '17 at 02:24
  • That's indeed a very old gcc. I should add a version check if I find out at which version the ``__sync_synchronize()`` was added. In the meantime you can edit the file ``call_python.c`` line 180, replacing ``#if defined(__GNUC__)`` with ``#if 0`` (then you get a warning, which you can ignore if you're not doing multi-thread initialization in embedded mode) – Armin Rigo Jan 12 '17 at 11:01
  • That worked perfectly, thanks. Much easier than upgrading gcc! :) – ef99 Jan 12 '17 at 20:44
  • Should be fixed in the default branch. – Armin Rigo Jan 13 '17 at 10:03