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

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



Le Sunday 09 December 2007 20:03:27 Kurt Roeckx, vous avez écrit :
> Anyway, I think it is bad style to use macro's in public header
> files that call functions from another library.  It's also easy
> to replace them with real functions.  If there are such functions
> being called I suggest you replace them.
>
> What might be harder is avoiding the includes from other libraries
> because you use types from the other library.  It would be great
> if you didn't have to do that, and there are some ways to avoid that.

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.

So, not only do I agree with Josselin, but I think that looking at each 
project to fullfill any possible use case IS the problem itself. we can't 
expect any upstream to commit and release every little hack that might solve 
this or that issue.

The solution is, indeed, to link what's needed for each application and 
nothing else.


Romain



Reply to: