|
Boost-Build : |
From: Zbynek Winkler (zwin_at_[hidden])
Date: 2003-05-12 07:51:14
David Abrahams wrote:
>Vladimir Prus <ghost_at_[hidden]> writes:
>
>
>>Zbynek Winkler wrote:
>>
>>
>>>This is the command line used for final linking stage of my debug build:
>>>
>>>LINK /DEBUG /OPT:REF,ICF /subsystem:console
>>>/out:"test\bin\msvc\debug\main-target-test\test.exe "
>>>@"test\bin\msvc\debug\main-target-test\test.rsp"
>>>
>>>I am getting a warning:
>>>LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /OPT specification
>>>
>>>Why is there /OPT option even for debug build? Is that a bug or a feature?
>>>
>>>
>>The msvc support was implemented by David Abrahams. Dave, can you comment on
>>this issue?
>>
>>
>
>Well, the docs say:
>
> The following linker options disable Edit and Continue.
>
> Setting /OPT:REF, /OPT:ICF, or /INCREMENTAL:NO disables Edit
> and Continue with the following warning:
>
> LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /OPT
> specification
>
>So the warning is going to be there for some combination of
>optimizations whether we like it or not.
>
When we specify an optimization that disables edit-and-continue then we
should not use the debug info that allows the edit-and-continue feature.
That should get rid off the warning. The option for the compiler to
enable E&C is /ZI. I think that /Zi should be used instead (Program
Database). The equivalent for the linker should be /DEBUG /DEBUGTYPE:CV
(according to the docs). After a while of experimenting with the linker
my impression is that when you do not specify /DEBUGTYPE it defaults to
(undocumented) /EDITANDCONTIUE option.
Different question is what the default should be. I am in the position
of replacing *.dsp with Jamfiles so the best defaults for me are the
defaults used in *.dsp. That includes default to enable "Edit and
Continue". What is the current rule to decide what should be the default
for release/debug builds on each platform?
The docs about the /OPT:REF,ICF also say:
If the /DEBUG option is specified, the default for /OPT changes from
REF* *to NOREF, and all functions are preserved in the image. To
override this default and optimize a debugging build, specify
/OPT:REF. The /OPT:REF option disables incremental linking.
So obviously the MS's default is not to optimize debugging build in any
way unless told otherwise which seems reasonable to me.
Anyway, I think that saying <optimization>off should disable all
optimizations (including linker) and that <optimization>off should be
set for the default debug build. Why to include some optimization and
some other not?
Zbynek
-- <zwin at robotika.cz> http://zw.matfyz.cz/ http://robotika.cz/ Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk