Hello Marcus and Carsten,

First of, we also do need debugging symbols in release builds.

Microsoft writes on
https://msdn.microsoft.com/en-us/library/windows/desktop/ee416349(v=vs.85).aspx

"You also need to take steps to maintain full compiler optimizations 
while generating symbols."

- set Debug Information Format to Program Database (/Zi).
- set Generate Debug Info to Yes (/DEBUG).
- set References to Eliminate Unreferenced Data (/OPT:REF).
- set Enable COMDAT Folding to Remove Redundant COMDATs (/OPT:ICF).

That reference initiated my initial change of the code generation of all 
of our libraries and executables since we have started to generate 
memory dumps on crash in release code.

The flags are detailed on
https://msdn.microsoft.com/en-us/library/bxwfs976(v=vs.120).aspx

/OPT:REF eliminates functions and data that are never referenced;
/OPT:ICF to perform identical COMDAT folding. Redundant COMDATs can be 
removed from the linker output.

Usage of /OPT:REF implicitly sets /OPT:ICF.
Usage of /Zi /DEBUG implicitly sets /OPT:NOREF

/OPT:ICF is controversial. Microsoft recommends to use OPT:NOICF to 
preserve identical functions in debugging builds.

"If /DEBUG is specified, the default for /OPT is NOREF, and all 
functions are preserved in the image. To override this default and 
optimize a debugging build, specify /OPT:REF. Because /OPT:REF implies 
/OPT:ICF, we recommend that you also specify /OPT:NOICF to preserve 
identical functions in debugging builds. This makes it easier to read 
stack traces and set breakpoints in functions that would otherwise be 
folded together. The /OPT:REF option disables incremental linking."

On 25.01.2017 11:05, Marcus Lindblom Sonestedt wrote:
> We need debugging symbols in release builds.
>
> If OPT:REF / OPT:ICF doesn't conflict with /Zi and pdb-generation, I
> have no objections.
>
I'm not quite sure on that. Probably the /OPT:REF /OPT:NOICF is the 
better combination.

Finally, I think that best we should create some cmake options for that, 
so that nobody is negatively affected. Then we can experiment a little 
with these settings and see what is best.

What do you think,

Best,
Johannes





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to