[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: -Wl,--as-needed considered possibly harmful

Steve Langasek wrote:

> ... also, -Wl,--as-needed is *not* a complete solution for the problems
> caused by generating extra -l arguments.  Every -lfoo option passed to the
> linker requires the corresponding -dev package to be installed at build
> time; while it is a bug if the -dev packages don't declare their
> dependencies, the impact of such bugs (which do happen fairly often) would
> be limited to static linking if appropriately-constructed .pc files were
> available.

Note that pkgconfig is not the only problem here. Some extra links arise
from the fact that several utilities or plugins for an application are
built with the same "environment" (ie: the same flags), and not all of them
require all the linked libraries. Of course, one could argue that fixing
the build script is the way to go, but sometimes it is not trivial to do
that (badly crafted or unmaintained build scripts tend to be quite ugly).


  Felipe Sateler

Reply to: