在 Solaris 10 上从源安装 Python 加密包

Installing Python cryptography package from source on Solaris 10

我正在尝试在 Solaris 10 系统上安装 Python cryptography 软件包。我在我的主目录中从源代码构建了 Python 2.7 和 libffi。我可以通过指定 libffi 的路径来构建 cffi:

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

但是,尝试构建加密失败并出现此错误:

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

我已将 LD_LIBRARY_PATH 设置为 /export/home/ef/libffi/lib

我在编译 cffi 时注意到以下警告 - 这可能是相关的吗?

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

我该如何解决这个问题?我在网上发现的所有类似问题都已通过安装相关的 OS 软件包 (e.g. sudo apt-get install build-essential libssl-dev libffi-dev python-dev) 得到解决。 OpenCSW 不是一个选项。

__sync_synchronize是内置函数,但只有gcc和clang支持。我猜您使用的是不同的编译器或非常旧版本的 gcc 或 clang。您可以尝试从 cffi 主干安装吗?我们最近添加了对其他一些编译器的支持(尚未发布,将在 1.10 版本中)。

https://bitbucket.org/cffi/cffi/downloads?tab=branches,下载 "default" 分支(例如点击 gz)。