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

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

On Mon, Dec 10, 2007 at 12:35:11AM -0300, Felipe Sateler wrote:
> 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).

However, most of them are fixable. The only two problems we (ALT) had/have
with default --as-needed were mpeg4ip suit and net-snmp (though it's being
fixed already).

But again, not every upstream author accepts changes to .pc; but i've
never seen one not wanting to fix a build system.

ALT Linux Team,
ALT Linux Sisyphus project,

Attachment: signature.asc
Description: Digital signature

Reply to: