[yocto] Python cryptography failing due to undefined symbol: pthread_atfork

Alan Martinovic alan.martinovic at senic.com
Fri Dec 29 05:49:54 PST 2017


Hey Tim,
your hunch was right, it can be fixed with the .bbappend, thanks.
Would like to submit it as a patch to python-cryptography.inc.

Is there a policy on what should be the base commit
for which the patch should be applied on?

I can't test it with master, I saw there is a rocko-next,
should that be a starting point?


On Sat, Dec 23, 2017 at 5:18 AM, Tim Orling <ticotimo at gmail.com> wrote:
> My hunch (not tested) is that the recipe needs -pthread added to LDSHARED:
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/distutils.bbclass#n82
>
> So try a python3-cryptography_%.bbappend file with “export LDSHARED="${CCLD}
> -shared -pthread” in your own layer
>
> Or try adding that line to python-cryptography.inc and then submit a patch
> if it works.
> On Fri, Dec 22, 2017 at 9:10 AM Alan Martinovic <alan.martinovic at senic.com>
> wrote:
>>
>> I have confirmed that no `-pthread` flags are being set for building
>> python-cryptography.
>>
>> Running the following:
>>
>>     bitbake python-cryptography -c do_compile
>>     bitbake python-cryptography -c devshell
>>     grep pthread ../temp/run.do_compile
>>
>> gives no returns.
>> Also there isn't a mention of it when doing a build in full
>> verbose:
>>
>>     bitbake python-cryptography -c cleanall
>>     bitbake python-cryptography -vvv | vi -
>>
>>
>> On the target the symbol is identified as missing (NOTYPE):
>>
>>     ~# readelf -a
>>
>> /usr/lib/python3.5/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so
>> | grep pthread_atfork
>>     000aebb4  0002d916 R_ARM_JUMP_SLOT   00000000   pthread_atfork
>>        729: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND pthread_atfork
>>
>>
>> My current goal is to extend the recipe with the `-pthread` so that
>> it's there when
>> the '_openssl' extension is being built.
>> Still open to suggestions.
>>
>>
>> A thing that seems to be underlying my assumption is that the recipe
>> for python-cryptography
>> hasn't actually changed between Morty (where it worked) and Rocko...
>>
>> On Thu, Dec 21, 2017 at 6:17 PM, Alan Martinovic
>> <alan.martinovic at senic.com> wrote:
>> > Hi there,
>> > just did a migration to Rocko and am witnessing"
>> >
>> >     root at device:~# python3
>> >     Python 3.5.3 (default, Dec 20 2017, 02:02:22)
>> >     [GCC 7.2.0] on linux
>> >     Type "help", "copyright", "credits" or "license" for more
>> > information.
>> >     >>> from cryptography.hazmat.bindings._openssl import ffi, lib
>> >     Traceback (most recent call last):
>> >       File "<stdin>", line 1, in <module>
>> >     ImportError:
>> >
>> > /usr/lib/python3.5/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so:
>> > undefined symbol: pthread_atfork
>> >
>> >
>> > Have tried both the recipe that comes with Rocko
>> > and master of meta-openembedded.
>> >
>> > Seems to be the same bug as this one:
>> >
>> > https://bugs.gentoo.org/630578
>> >
>> > resolved with this patch:
>> >
>> >
>> > https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c824d1c44fcf4556de21d2c8b8ae3732b0fc0c5b
>> >
>> > Can someone provide hints on what would that translate to
>> >  for the python cryptography recipe?
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list