-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
pthread_atfork error on Arm processor #956
Comments
Wow, that's surprising. For now, I recommend just commenting out the code that calls pthread_atfork() -- it's intended to add some safety (basically preventing attempts to use the library across calls to fork()), but is not actually required for correct operation of the library. I'll add a CMake test for this in the future. |
Hi, |
Cool. |
Hi,
|
I've run into this too. It's because on some platforms/versions of libc certain pthread functions are defined in The same issue happened in openssl: openssl/openssl#3884 To quote a comment:
|
Thank you! |
I think there may be separate issues here. As this is a static build, the pthread library should be included on the link line, and must occur after -lnng. My guess is that you probably have other pthread symbols that are missing, unless pthread_atfork() is not in libc, but the other pthread functions are (which would be surprising.) You're using cmake, so this should have been handled automatically. The other thing is that platform may actually be missing pthread_atfork(). I'll have to research that. At any rate, I'll see if I can come up with a better fix. |
Hi,
I finished writing my code that uses nng and I successfully compiled it and run it on my laptop.
Then, I moved the source code to an Odroid-XU4 board, where the code is intended to run, and tried to compiled it there, but I got the following error:
//usr/local/lib/libnng.a(posix_thread.c.o): In function
nni_plat_init':posix_thread.c:(.text+0x5a0): undefined reference to
pthread_atfork' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.
I had no problem in compiling and installing nng on the Odroid-XU4, so I hope that some cmake flag could solve the problem...
The Odroid board is based on an Arm processor and the O.S. installed is Ubuntu 18.04, without any Desktop Environment.
I hope you can help me solve this "undefined reference" issue.
Thank you!
The text was updated successfully, but these errors were encountered: