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

--as-needed linker option (was Re: binary-without-manpage)

On Thu, Aug 21, 2008 at 09:44:52PM +0200, Jeffrey Ratcliffe wrote:
> >> I've tried using --as-needed, but ocropus then FTBFS.
> http://paste.debian.net/15317/

--as-needed will let the linker throw away all symbols that aren't used.
It always does this when linking static libraries.  That's why with
those, it's important that they're in the right order.  The same is true
when using --as-needed.  The order should be such, that all used symbols
from a library must be used by files which are mentioned before (so they
are undefined references when the library gets linked).  This means your
source file must be before all libraries (not after them, as it is now),
and libararies which depend on each other must be in the correct order
as well[1].

Hope this helps,

[1] Not sure about that, perhaps that's sorted out when they were
    compiled.  Anyway, it doesn't hurt to do it.

I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://a82-93-13-222.adsl.xs4all.nl/e-mail.html

Attachment: signature.asc
Description: Digital signature

Reply to: