Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 776973 - net-libs/nghttp2-1.43.0[cxx] undefined reference to `pthread_create' when using rlibtool
Summary: net-libs/nghttp2-1.43.0[cxx] undefined reference to `pthread_create' when usi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: slibtool
  Show dependency tree
 
Reported: 2021-03-18 00:02 UTC by Alessandro Barbieri
Modified: 2022-07-16 16:49 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
nghttp2-1.43.0:20210317-192431.log (nghttp2-1.43.0:20210317-192431.log,159.04 KB, text/plain)
2021-03-18 00:02 UTC, Alessandro Barbieri
Details
https://github.com/nghttp2/nghttp2/pull/1571 (nghttp2-pthread.patch,24.36 KB, patch)
2021-03-18 15:42 UTC, orbea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2021-03-18 00:02:13 UTC
rlibtool: link: ln -s /dev/null .libs/libnghttp2_asio.a.disabled
rlibtool: link: x86_64-pc-linux-gnu-g++ .libs/libnghttp2_asio_la-util.o .libs/libnghttp2_asio_la-http2.o .libs/libnghttp2_asio_la-tls.o .libs/libnghttp2_asio_la-timegm.o .libs/libnghttp2_asio_la-asio_common.o .libs/libnghttp2_asio_la-asio_io_service_pool.o .libs/libnghttp2_asio_la-asio_server_http2.o .libs/libnghttp2_asio_la-asio_server_http2_impl.o .libs/libnghttp2_asio_la-asio_server.o .libs/libnghttp2_asio_la-asio_server_http2_handler.o .libs/libnghttp2_asio_la-asio_server_request.o .libs/libnghttp2_asio_la-asio_server_request_impl.o .libs/libnghttp2_asio_la-asio_server_response.o .libs/libnghttp2_asio_la-asio_server_response_impl.o .libs/libnghttp2_asio_la-asio_server_stream.o .libs/libnghttp2_asio_la-asio_server_serve_mux.o .libs/libnghttp2_asio_la-asio_server_request_handler.o .libs/libnghttp2_asio_la-asio_server_tls_context.o .libs/libnghttp2_asio_la-asio_client_session.o .libs/libnghttp2_asio_la-asio_client_session_impl.o .libs/libnghttp2_asio_la-asio_client_session_tcp_impl.o .libs/libnghttp2_asio_la-asio_client_session_tls_impl.o .libs/libnghttp2_asio_la-asio_client_response.o .libs/libnghttp2_asio_la-asio_client_response_impl.o .libs/libnghttp2_asio_la-asio_client_request.o .libs/libnghttp2_asio_la-asio_client_request_impl.o .libs/libnghttp2_asio_la-asio_client_stream.o .libs/libnghttp2_asio_la-asio_client_tls_context.o -Wl,--whole-archive ../third-party/.libs/liburl-parser.a -Wl,--no-whole-archive -Wl,--whole-archive ../third-party/.libs/libllhttp.a -Wl,--no-whole-archive -std=c++14 -Os -pipe -march=native -Os -pipe -march=native -Wl,-O1 -Wl,--as-needed -L../lib/.libs -lnghttp2 -lssl -lcrypto -L/usr/lib64 -lboost_system-mt -lboost_thread -lboost_system -shared -fPIC -Wl,--no-undefined -Wl,-soname -Wl,libnghttp2_asio.so.1 -o .libs/libnghttp2_asio.so.1.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::detail::posix_thread::join()':
asio_io_service_pool.cc:(.text._ZN5boost4asio6detail12posix_thread4joinEv[_ZN5boost4asio6detail12posix_thread4joinEv]+0x10): undefined reference to `pthread_join'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::detail::scheduler::~scheduler()':
asio_io_service_pool.cc:(.text._ZN5boost4asio6detail9schedulerD2Ev[_ZN5boost4asio6detail9schedulerD5Ev]+0x81): undefined reference to `pthread_detach'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::io_context::io_context()':
asio_io_service_pool.cc:(.text._ZN5boost4asio10io_contextC2Ev[_ZN5boost4asio10io_contextC5Ev]+0xcc): undefined reference to `pthread_condattr_setclock'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `boost::asio::detail::scheduler::shutdown()':
asio_io_service_pool.cc:(.text._ZN5boost4asio6detail9scheduler8shutdownEv[_ZN5boost4asio6detail9scheduler8shutdownEv]+0x7c): undefined reference to `pthread_detach'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_io_service_pool.o: in function `std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<unsigned long (boost::asio::io_context::*)(), std::shared_ptr<boost::asio::io_context> > >, unsigned long>::_Async_state_impl(std::thread::_Invoker<std::tuple<unsigned long (boost::asio::io_context::*)(), std::shared_ptr<boost::asio::io_context> > >&&)':
asio_io_service_pool.cc:(.text._ZNSt13__future_base17_Async_state_implINSt6thread8_InvokerISt5tupleIJMN5boost4asio10io_contextEFmvESt10shared_ptrIS6_EEEEEmEC1EOSC_[_ZNSt13__future_base17_Async_state_implINSt6thread8_InvokerISt5tupleIJMN5boost4asio10io_contextEFmvESt10shared_ptrIS6_EEEEEmEC1EOSC_]+0xed): undefined reference to `pthread_create'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `boost::asio::detail::posix_thread::~posix_thread()':
asio_server.cc:(.text._ZN5boost4asio6detail12posix_threadD2Ev[_ZN5boost4asio6detail12posix_threadD5Ev]+0xa): undefined reference to `pthread_detach'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/libnghttp2_asio_la-asio_server.o: in function `boost::asio::detail::scheduler::scheduler(boost::asio::execution_context&, int, bool)':
asio_server.cc:(.text._ZN5boost4asio6detail9schedulerC2ERNS0_17execution_contextEib[_ZN5boost4asio6detail9schedulerC5ERNS0_17execution_contextEib]+0xc0): undefined reference to `pthread_condattr_setclock'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: asio_server.cc:(.text._ZN5boost4asio6detail9schedulerC2ERNS0_17execution_contextEib[_ZN5boost4asio6detail9schedulerC5ERNS0_17execution_contextEib]+0x1f2): undefined reference to `pthread_create'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/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*)':
asio_client_session_impl.cc:(.text._ZN5boost4asio6detail12posix_thread12start_threadEPNS2_9func_baseE[_ZN5boost4asio6detail12posix_thread12start_threadEPNS2_9func_baseE]+0x27): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
rlibtool: exec error upon slbt_exec_link_create_library(), line 1446: (see child process error messages).
rlibtool: < returned to > slbt_exec_link(), line 1836.
make[3]: *** [Makefile:1399: libnghttp2_asio.la] Error 2
make[3]: Leaving directory '/var/tmp/portage/net-libs/nghttp2-1.43.0/work/nghttp2-1.43.0-abi_x86_64.amd64/src'
make[2]: *** [Makefile:2679: all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-libs/nghttp2-1.43.0/work/nghttp2-1.43.0-abi_x86_64.amd64/src'
make[1]: *** [Makefile:569: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-libs/nghttp2-1.43.0/work/nghttp2-1.43.0-abi_x86_64.amd64'
make: *** [Makefile:478: all] Error 2
 * ERROR: net-libs/nghttp2-1.43.0::gentoo failed (compile phase):
 *   emake failed
Comment 1 Alessandro Barbieri 2021-03-18 00:02:39 UTC
Created attachment 692190 [details]
nghttp2-1.43.0:20210317-192431.log

buildlog
Comment 2 orbea 2021-03-18 00:39:44 UTC
I can't reproduce this with slibtool-0.5.31 or 9999 with nghttp2-1.41.0, nghttp2-1.43.0 or their git master. I'm not sure what is different.
Comment 3 Ionen Wolkens gentoo-dev 2021-03-18 05:55:23 UTC
(In reply to orbea from comment #2)
> I can't reproduce this with slibtool-0.5.31 or 9999 with nghttp2-1.41.0,
> nghttp2-1.43.0 or their git master. I'm not sure what is different.
Can reproduce here, or at least with USE=cxx

Haven't experimented further but may possibly be related to boost's USE (mine has "icu threads zlib zstd", rest disabled)
Comment 4 orbea 2021-03-18 14:48:43 UTC
Thanks, I can now reproduce it in their git master when using --enable-asio-lib.
Comment 6 orbea 2021-03-18 15:43:37 UTC
I made a PR upstream and attached the patch which solves it for me.

https://github.com/nghttp2/nghttp2/pull/1571
Comment 7 orbea 2021-03-18 15:46:49 UTC
Also for reference this as the same issue as:

https://bugs.gentoo.org/775605
https://github.com/vapoursynth/vapoursynth/pull/650
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-03-19 08:18:13 UTC
Once again thank you orbea for your great work. I will wait a bit to see what upstream thinks about your patch.
Comment 9 orbea 2022-05-05 16:10:45 UTC
@Polynomial-C

Upstream has so far ignored my PR, do you have any suggestions?
Comment 10 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2022-05-07 13:46:33 UTC
(In reply to orbea from comment #9)
> @Polynomial-C
> 
> Upstream has so far ignored my PR, do you have any suggestions?

I have asked in the PR what the current staus is. If they do not take some action soon, I am going to apply this patch in our Gentoo package.
Comment 11 orbea 2022-07-15 19:03:52 UTC
Any ideas how to proceed on this? Upstream deprecated the feature and will probably remove it eventually. The way I see it the choices are:

1) Do nothing and wait for the feature to be removed (Likely) or for the PR to be merged (Unlikely).

2) Remove the feature from the ebuild.

3) Apply the patch in the build until the feature is removed upstream.
Comment 12 Bernard Cafarelli gentoo-dev 2022-07-16 15:51:21 UTC
At least there were some comments and updates in upstream patch!

For now, downstream I will go with latest option, fixing compilation in current ebuild for a feature still around.

If it gets removed in new release well I can easily remove the patch (and support for this feature).
If it gets picked up upstream then hopefully the patch will be merged and it can be dropped in ebuild, while keeping the feature - I will keep an eye on upstream bug report activity and upcoming releases changelog
Comment 13 Larry the Git Cow gentoo-dev 2022-07-16 16:49:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa5987f984e2065454823334bcab84f83b90600d

commit fa5987f984e2065454823334bcab84f83b90600d
Author:     Bernard Cafarelli <voyageur@gentoo.org>
AuthorDate: 2022-07-16 16:48:22 +0000
Commit:     Bernard Cafarelli <voyageur@gentoo.org>
CommitDate: 2022-07-16 16:49:29 +0000

    net-libs/nghttp2: fix undefined pthread references
    
    Upstream patch not merging as feature is deprecated
    Also fix cunit automagic detection and sync live ebuild
    
    Closes: https://bugs.gentoo.org/776973
    Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>

 .../nghttp2/files/nghttp2-1.48.0-pthread.patch     | 576 +++++++++++++++++++++
 net-libs/nghttp2/nghttp2-1.48.0.ebuild             |   9 +-
 net-libs/nghttp2/nghttp2-9999.ebuild               |   5 +-
 3 files changed, 587 insertions(+), 3 deletions(-)