You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When aria2 is built with --enable-libaria2 most of the relevant code is built into the shared library. However, src/Makefile.am puts almost all linked dependency libraries into LDADD which applies to executables only. Therefore, most of the NEEDED entries land in the executable rather than the library.
This has two consequences:
The library lacks proper dependencies and therefore can't be used by a program unless it links to all its dependency libraries directly.
If aria2c is linked using ld.gold (the new binutils linker) with -Wl,--as-needed, the linker detects that aria2c executable does not use most of the passed -l libraries and removes them. As a result, aria2c is broken since neither the program nor the library links to necessary dependency libraries.
I think the correct solution here is to move all the dependency libraries from LDADD to libaria2_la_LIBADD.
The text was updated successfully, but these errors were encountered:
When aria2 is built with
--enable-libaria2
most of the relevant code is built into the shared library. However,src/Makefile.am
puts almost all linked dependency libraries intoLDADD
which applies to executables only. Therefore, most of the NEEDED entries land in the executable rather than the library.This has two consequences:
-Wl,--as-needed
, the linker detects that aria2c executable does not use most of the passed-l
libraries and removes them. As a result, aria2c is broken since neither the program nor the library links to necessary dependency libraries.I think the correct solution here is to move all the dependency libraries from
LDADD
tolibaria2_la_LIBADD
.The text was updated successfully, but these errors were encountered: