Hi,
On Wed, Jan 23, 2019 at 08:45:06PM +0000, Richard W.M. Jones wrote:
> On Wed, Jan 23, 2019 at 09:01:19PM +0100, Bruno Haible wrote:
[...]
> I checked the history of the Fedora package which adds these flags, and
> it seems like --as-needed was added for:
>
> https://fedoraproject.org/wiki/Changes/RemoveExcessiveLinking
>
> Removing -Wl,--as-needed fixes the problem. However I'm still unclear
> about this. Is Fedora wrong? Is hivex using gnulib wrongly? Is
> gnulib wrong?
We also build everything with --as-needed by default, but
gnulib does the right thing nowadays by using
-Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state
instead of plain -lpthread.
libtool can "helpfully" reorder those flags so they don't do anything though.
Cheers,
mwh