/usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/asyncns.o: in function `asyncns_free': asyncns.c:(.text+0xb38): undefined reference to `pthread_join' /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/asyncns.o: in function `asyncns_new': asyncns.c:(.text+0xd57): undefined reference to `pthread_create' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:447: libasyncns.la] Error 1 make[2]: Leaving directory '/var/tmp/portage/net-libs/libasyncns-0.8-r4/work/libasyncns-0.8-abi_x86_64.amd64/libasyncns'
https://gist.githubusercontent.com/EinstokFair/8b5ec35c86b443fbc319082a70476c82/raw/70166bf22e4e11323c3b3a171e5983410d995e43/gistfile1.txt
https://gist.githubusercontent.com/EinstokFair/0579c6e307fbd53332978e54733922ab/raw/aad9a738d7d4c40c3d68fc442573403364146992/vartmpportagenet-libslibasyncns-0.8-r4tempbuild.log
Created attachment 723985 [details] build.log
Created attachment 723988 [details] emerge --info
may be related: https://stackoverflow.com/questions/1662909/undefined-reference-to-pthread-create-in-linux
>checking whether pthreads work without any flags... yes I can't reproduce, but comparing with my own configure output this is where it diverges. Mine fails this test, and later appropriately adds -pthread flag. Your config.log may have a hint as to what happened, i.e. /var/tmp/portage/net-libs/libasyncns-0.8-r4/work/libasyncns-0.8-abi_x86_64.amd64/config.log or so
(In reply to Ionen Wolkens from comment #6) > >checking whether pthreads work without any flags... yes > I can't reproduce, but comparing with my own configure output this is where > it diverges. Mine fails this test, and later appropriately adds -pthread > flag. > > Your config.log may have a hint as to what happened, i.e. > /var/tmp/portage/net-libs/libasyncns-0.8-r4/work/libasyncns-0.8-abi_x86_64. > amd64/config.log or so Right, I did ask about this on IRC. Could you please try without your set LDFLAGS too? And depclean/select newer binutils?
Created attachment 724417 [details] config.log https://gist.github.com/EinstokFair/b3654ab513289e683c78579823a5c8af
Seem to be two things needed to reproduce this. 1. have libnsl installed (checks for it but discarded by --as-needed) 2. LDFLAGS="-Wl,--copy-dt-needed-entries" I guess #2 copies libnsl's needed and misleads configure into thinking it doesn't need -pthread. (In reply to Sam James from comment #7) > [...] Could you please try without your set LDFLAGS too? [...]
I removed previous and other versions of binutils: # eselect binutils list [1] x86_64-pc-linux-gnu-2.36.1 * # but the error is still here after source /etc/profile and remerge. I don't understood the sentence about LDFLAGS, trying to figure out it.
(In reply to Einstok Fair from comment #10) > I don't understood the sentence about LDFLAGS, trying to figure out it. You appear to be setting LDFLAGS="-Wl,--copy-dt-needed-entries" somewhere, likely in your /etc/portage/make.conf or similar. Is it your intention to set this? The idea would be to remove this and use defaults.
Without LDFLAGS it compiles, but i don't remember why I did added that flag globally (probably removing it will break something else).
(In reply to Einstok Fair from comment #12) > Without LDFLAGS it compiles, > but i don't remember why I did added that flag globally (probably removing > it will break something else). You shouldn't need it at all but *if* you do: 1. let's investigate it together 2. let's set it per-package via package.env (https://wiki.gentoo.org/wiki//etc/portage/package.env#Example_1:_Enable_debug_information_for_a_specific_package)