Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link with pthread #87

Merged
merged 1 commit into from
Nov 10, 2017
Merged

Link with pthread #87

merged 1 commit into from
Nov 10, 2017

Conversation

frederikaalund
Copy link
Contributor

When importing uvloop, I got the following error:

>>> import uvloop
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/projects/RedPitaya/OS/buildroot/buildroot-2017.02/output/target/usr/lib/python3.5/site-packages/uvloop/__init__.py", line 7, in <module>
ImportError: /usr/lib/python3.5/site-packages/uvloop/loop.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: pthread_atfork

This is fixed by linking the plugin (loop.cpython-35m-arm-linux-gnueabihf.so) to pthread as done in this patch.

When importing uvloop, I got the following error:

    >>> import uvloop
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/projects/RedPitaya/OS/buildroot/buildroot-2017.02/output/target/usr/lib/python3.5/site-packages/uvloop/__init__.py", line 7, in <module>
    ImportError: /usr/lib/python3.5/site-packages/uvloop/loop.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: pthread_atfork

This is fixed by linking the plugin (`loop.cpython-35m-arm-linux-gnueabihf.so`) to pthread as done in this patch.
@1st1
Copy link
Member

1st1 commented Apr 29, 2017

Do we need to do this for all platforms or for Linux+arm only?

@frederikaalund
Copy link
Contributor Author

Do we need to do this for all platforms or for Linux+arm only?

Good point. Theoretically, it's needed for all operating systems that use POSIX threads, which is most Unix-like operating systems (Linux, MacOS, etc.). Practically speaking, that is every platform except Windows.

I'm surprised that I'm the first person to get the undefined symbol error. Apparently, this error only triggers in the Linux + ARM combination? Anyhow, linking explicitly against pthread is the way to go.

Also, consider using -pthread instead of -lpthread. I know that I use -lpthread in my patch; I learnt about the difference after making the pull request.

@1st1 1st1 merged commit 357cb60 into MagicStack:master Nov 10, 2017
@1st1
Copy link
Member

1st1 commented Nov 10, 2017

Merged as is. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants