Re: -Wl,--as-needed considered possibly harmful
On Mon, Dec 10, 2007 at 12:45:46AM +0300, Nikita V. Youshchenko wrote:
> > Ok, let's consider another very simple case:
> > libshout allows to perform streaming of speex, vorbis, and theora formats.
> > Hence, when asking for the libs to link with, you got -lspeex and -ltheora
> > since it's needed to cover all build cases.
> > However, most of the applications don't need to link against theora and
> > speex.
> Doesn't libshout reference symbols from libspeex and libtheora?
> If it does, resulting binary must be linked against both these libraries.
Where "binary" means libshout, yes. The application does not
directly use libspeex and libtheora so should not have any undefined
symbols that are defined in either libspeex or libtheora.
> Unresolved symbols within binaries are really bad, because they will once
> be unexpectedly called (e.g. in some init or deinit or error-handling), and
> binary will crash, leaving user data unsaved.
> If it does not, then what for -lspeex and -ltheora are in the script output?
That is only useful for linking to a static version of libshout.