Re: Whole program optimization and debug symbols
Ulrich Eckhardt wrote:
1. There is a setting in the "General" tab that says "Whole Program
Optimization". There also is one in the C++ with the same name. =
Further,
there is one in the linker settings that reads "Link Time Code =
Generation".
If the one in the C++ tab is set, you get a warning unless you =
activate the
one for the linker, too. What are the further relations between those
three?
Whole program optimization requires cooperation between compiler and =
linker. Very roughly, the compiler dumps a parse tree into the object =
file rather than the actual machine code. At link time, the linker calls =
back into the compiler to generate machine code; at this point, the =
compiler can see the whole program, not just a single translation unit - =
hence the name.
For this to work, compiler and linker settings have to be set in =
compatible ways. The property on General tab sets them both correctly. =
You can also change them independently on C/C++ | Optimization and =
Linker | Optimization tabs, but then it's your responsibility to have =
them match (if they don't, you may get a warning).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925