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

build: Fix undefined pthread references. #1571

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orbea
Copy link

@orbea orbea commented Mar 18, 2021

When building nghttp2 using --enable-asio-lib with slibtool (https://dev.midipix.org/cross/slibtool) it fails with undefined pthread references.

  CXXLD    libnghttp2_asio.la
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::detail::posix_thread::start_thread(boost::asio::detail::posix_thread::func_base*)':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:59: undefined reference to `pthread_create'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::detail::posix_thread::join()':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:42: undefined reference to `pthread_join'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::detail::posix_thread::join()':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:42: undefined reference to `pthread_join'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `posix_event':
/usr/include/boost/asio/detail/impl/posix_event.ipp:42: undefined reference to `pthread_condattr_setclock'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `thread<(lambda at /usr/bin/../lib64/gcc/x86_64-slackware-linux/10.2.0/../../../../include/c++/10.2.0/future:1671:27), void>':
/usr/bin/../lib64/gcc/x86_64-slackware-linux/10.2.0/../../../../include/c++/10.2.0/thread:149: undefined reference to `pthread_create'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `boost::asio::detail::posix_thread::start_thread(boost::asio::detail::posix_thread::func_base*)':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:59: undefined reference to `pthread_create'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `boost::asio::detail::posix_thread::join()':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:42: undefined reference to `pthread_join'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `boost::asio::detail::posix_thread::join()':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:42: undefined reference to `pthread_join'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_client_session_impl.o: in function `boost::asio::detail::posix_thread::start_thread(boost::asio::detail::posix_thread::func_base*)':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:59: undefined reference to `pthread_create'
/usr/bin/ld: .libs/libnghttp2_asio_la-asio_client_session_impl.o: in function `~posix_thread':
/usr/include/boost/asio/detail/impl/posix_thread.ipp:35: undefined reference to `pthread_detach'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
rlibtool: exec error upon slbt_exec_link_create_library(), line 1446: (see child process error messages).
rlibtool: < returned to > slbt_exec_link(), line 1843.
make[2]: *** [Makefile:1401: libnghttp2_asio.la] Error 2

This doesn't happen with GNU libtool because it silently filters out -no-undefined while slibtool does not which is set in lib/Makefile.am.

Additionally the existing pthread checks in configure.ac don't seem to work as m4/ax_pthread.m4 does and does not actually seem to be needed?

Also see this downstream issue: https://bugs.gentoo.org/776973

@Polynomial-C
Copy link

Any news here? What's holding this PR from being merged?

@voyageur
Copy link

Can we get this in? Anything blocking it? No conflicts and tests pass. It would avoid us not to carry that patch downstream and update it with autoconf changes

@tatsuhiro-t
Copy link
Member

Sorry for late reply. libnghttp2_asio has been deprecated and will not get any update, and will be removed in the future release. Please consider remove the libnghttp2_asio package or provide this patch until it get removed.

@atari83
Copy link

atari83 commented Jul 10, 2022

😔 Could we find a maintainer for nghttp2_asio code ? It'd be a waste if we leave the code in this state.

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.

None yet

5 participants