This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Different linking behavior between g++ 4.5.2 and 4.6.1


On 16 November 2011 00:01, Manuel López-Ibáñez wrote:
>
> Perhaps we should add a new entry to the FAQ at the wiki about this.

Good idea.

> I could add it myself, but I am not sure how to summarize the problem
> and, in particular, it doesn't seem to me that "just use
> --no-as-needed" is the correct answer.

It probably isn't.  There are two parts to the change, one is to use
--as-needed by default, the other is to use
--no-copy-dt-needed-entries (the option formerly known as
--no-add-needed) by default.

I suspect for most people's uses --as-needed is ok if they don't link
to libraries that aren't referenced by the rest of their program.
People might have problems with --no-copy-dt-needed-entries more
often, but that's easily solved by adding the missing libraries
explicitly to the link command (I first encountered that issue when
using the gold linker, which doesn't even support the option.)

I could try to write something for the FAQ if Andrew and/or Ian would
cast an eye over it to check I've got the facts right, I don't think I
understand the issue completely myself.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]