Bug 12339

Summary: python-cryptography 2.0.3 from OE rocko requires -pthread in CFLAGS on some platforms
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Gino Badouri <badouri.g>
Component: devtools / tool chainAssignee: Derek Straka <derek>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium CC: akuster, meta.mr.watcher, meta.watcher, tim.orling
Version: unspecified   
Target Milestone: 2.5   
Hardware: Other   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Gino Badouri 2017-11-13 10:17:39 UTC
Hi there,

In OE rocko python cryptography will fail to load when built for cortexa15hf-neon-vfpv4.

Plugin  Extensions/OpenWebif failed to load: /usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: pthread_atfork
Traceback (most recent call last):
  File "/usr/lib/enigma2/python/Components/PluginComponent.py", line 52, in readPluginList
  File "/usr/lib/enigma2/python/Tools/Import.py", line 2, in my_import
  File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/plugin.py", line 29, in <module>
    from httpserver import HttpdStart, HttpdStop, HttpdRestart
  File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/httpserver.py", line 16, in <module>
    from twisted.internet import reactor, ssl
  File "/usr/lib/python2.7/site-packages/twisted/internet/ssl.py", line 59, in <module>
  File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/usr/lib/python2.7/site-packages/OpenSSL/crypto.py", line 16, in <module>
    from OpenSSL._util import (
  File "/usr/lib/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /usr/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: pthread_atfork

Adding CFLAGS_append = " -pthread " to the recipe:
https://github.com/openembedded/meta-openembedded/blob/rocko/meta-python/recipes-devtools/python/python-cryptography_2.0.3.bb (or the include file).

Will fix the problem and doesn't seem to hurt the other platforms where the issue doesn't occur (mips32el and mips32el-nf).

See also: https://bugs.gentoo.org/630578
Comment 1 Paul Eggleton 2017-11-13 20:29:41 UTC
So we don't normally track bugs for meta-python in this bug tracker, but since you've filed it I'll assign it over to Derek to have a look at.
Comment 3 Gino Badouri 2017-12-04 15:21:22 UTC
Thank you :)