[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wget2 | build: Fix the build with slibtool (!498)
From: |
orbea (@orbea) |
Subject: |
Re: wget2 | build: Fix the build with slibtool (!498) |
Date: |
Wed, 29 Sep 2021 22:22:52 +0000 |
orbea commented:
The first issue I encountered was no `-no-whole-archive` in slibtool and it was
only after getting past that I found it failed with undefined references for
pthread. These undefined references only occur with slibtool because GNU
libtool is silently adding `-pthread` for some reason I do not understand. On
the other hand slibtool does not have such unexpected behaviors. I attached a
log using GNU libtool showing this.
> libtool: link: clang -shared -fPIC -DPIC .libs/libwget_alloc_la-xalloc.o
> -Wl,--whole-archive ../lib/.libs/libgnu.a -Wl,--no-whole-archive -g -O2
> -Wl,--no-whole-archive **-pthread** -Wl,-soname -Wl,libwget_alloc.so.1 -o
> .libs/libwget_alloc.so.1.0.0
> libtool: link: clang -shared -fPIC -DPIC .libs/libwget_ip_la-ip.o
> -Wl,--whole-archive ../lib/.libs/libgnu.a -Wl,--no-whole-archive -g -O2
> -Wl,--no-whole-archive **-pthread** -Wl,-soname -Wl,libwget_ip.so.1 -o
> .libs/libwget_ip.so.1.0.0
[wget2.log](/uploads/f5c3db633d1d5943c4e188df92419b87/wget2.log)
While this is not the issue in this case its worth noting that `-no-undefined`
is set in `libwget_la_LDFLAGS` which is then used then used everywhere else in
the file. GNU libtool has a long standing bug where it just silently ignores
`-no-undefined` while slibtool will actually respect it.
I reproduced this on Slackware64 and attached the `config.log`.
[config.log](/uploads/d0b8354971450c24f6b384b15333bf2d/config.log)
And now I reproduced both issues again on a Gentoo system.
[config.log](/uploads/6886a1f7e0190b3cc267dd0bafef343d/config.log)
Also for reference I have fixed similar pthread issues in several projects,
NetworkManager is one.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/804
--
Reply to this email directly or view it on GitLab:
https://gitlab.com/gnuwget/wget2/-/merge_requests/498#note_690725275
You're receiving this email because of your account on gitlab.com.