Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 802252 - net-libs/libasyncns - undefined reference to pthread_join
Summary: net-libs/libasyncns - undefined reference to pthread_join
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL: https://gist.githubusercontent.com/Ei...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-15 09:05 UTC by Einstok Fair
Modified: 2021-07-16 22:50 UTC (History)
3 users (show)

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


Attachments
build.log (file_802252.txt,16.07 KB, text/plain)
2021-07-15 09:18 UTC, Einstok Fair
Details
emerge --info (file_802252.txt,5.76 KB, text/plain)
2021-07-15 09:19 UTC, Einstok Fair
Details
config.log (file_802252.txt,98.45 KB, text/plain)
2021-07-16 21:48 UTC, Einstok Fair
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Einstok Fair 2021-07-15 09:05:05 UTC
/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'
Comment 3 Einstok Fair 2021-07-15 09:18:22 UTC
Created attachment 723985 [details]
build.log
Comment 4 Einstok Fair 2021-07-15 09:19:20 UTC
Created attachment 723988 [details]
emerge --info
Comment 6 Ionen Wolkens gentoo-dev 2021-07-16 16:37:36 UTC
>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
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-16 19:02:45 UTC
(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?
Comment 9 Ionen Wolkens gentoo-dev 2021-07-16 22:07:32 UTC
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? [...]
Comment 10 Einstok Fair 2021-07-16 22:18:20 UTC
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.
Comment 11 Ionen Wolkens gentoo-dev 2021-07-16 22:25:19 UTC
(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.
Comment 12 Einstok Fair 2021-07-16 22:39:32 UTC
Without LDFLAGS it compiles,
but i don't remember why I did added that flag globally (probably removing it will break something else).
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-16 22:41:20 UTC
(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)