Closed
Bug 1220016
Opened 9 years ago
Closed 9 years ago
Don't mix-and-match debug/non-debug MS CRT in NSS
Categories
(NSS :: Build, defect)
Tracking
(firefox45 affected)
RESOLVED
FIXED
3.21
Tracking | Status | |
---|---|---|
firefox45 | --- | affected |
People
(Reporter: jld, Assigned: jld)
References
Details
Attachments
(1 file)
5.18 KB,
patch
|
mt
:
review+
ekr
:
feedback+
mt
:
feedback+
kmckinley
:
feedback+
mt
:
checked-in+
|
Details | Diff | Splinter Review |
The NSS makefiles, for reasons lost to history (or at least to hg blame), build on Windows with /D_DEBUG whenever BUILD_OPT=0, regardless of whether a debug CRT library is being used (controlled by USE_DEBUG_RTL in the NSS/NSPR makefiles).
For C this appears to be tolerated, but it causes some of the C++ standard library headers to enable error-checking containing calls to _CrtDbgReportW, which exists only in the debug CRT.
The current workaround is to force building gtests and the gtest library with /MTd. This isn't the best idea to begin with — https://support.microsoft.com/en-us/kb/140584 explains some of the footguns of CRT-mixing — but more immediately this prevents statically linking gtests with the code under test, to allow unit tests to cover internal interfaces.
(Additional side-effect: forcing debug mode on ssl_gtest is hiding an instance of
optimization warning C4800 that would otherwise break the build.)
I'm not sure why we're changing the definedness of _DEBUG at all, rather than leaving that to the /M flags, but it's been like that since 2000 so I'm hesistant to touch it. One alternative would be to just filter it out for C++ files or for directories using C++.
Assignee | ||
Updated•9 years ago
|
Component: Test → Build
Assignee | ||
Comment 1•9 years ago
|
||
This is one approach; changing the flags just for the gtest directories also works.
Attachment #8681572 -
Flags: review?(rrelyea)
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8681572 [details] [diff] [review]
Patch: remove explicit -D_DEBUG and -U_DEBUG from all compilation.
(Applying suggestions I got about asking whether this patch is reasonable.)
Attachment #8681572 -
Flags: review?(rrelyea)
Attachment #8681572 -
Flags: feedback?(martin.thomson)
Attachment #8681572 -
Flags: feedback?(kmckinley)
Attachment #8681572 -
Flags: feedback?(ekr)
Comment 3•9 years ago
|
||
Comment on attachment 8681572 [details] [diff] [review]
Patch: remove explicit -D_DEBUG and -U_DEBUG from all compilation.
Seems fine.
Attachment #8681572 -
Flags: feedback?(martin.thomson) → feedback+
Comment 4•9 years ago
|
||
Comment on attachment 8681572 [details] [diff] [review]
Patch: remove explicit -D_DEBUG and -U_DEBUG from all compilation.
Review of attachment 8681572 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me.
Attachment #8681572 -
Flags: feedback?(kmckinley) → feedback+
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8681572 [details] [diff] [review]
Patch: remove explicit -D_DEBUG and -U_DEBUG from all compilation.
Thanks for the feedback. It's passed all 2h20m of NSS tests and doesn't break Gecko on Windows, so r?.
Attachment #8681572 -
Flags: review?(martin.thomson)
Comment 6•9 years ago
|
||
Comment on attachment 8681572 [details] [diff] [review]
Patch: remove explicit -D_DEBUG and -U_DEBUG from all compilation.
Review of attachment 8681572 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8681572 -
Flags: feedback?(ekr) → feedback+
Comment 7•9 years ago
|
||
Comment on attachment 8681572 [details] [diff] [review]
Patch: remove explicit -D_DEBUG and -U_DEBUG from all compilation.
http://hg.mozilla.org/projects/nss/rev/24d118f3c692
Attachment #8681572 -
Flags: review?(martin.thomson)
Attachment #8681572 -
Flags: review+
Attachment #8681572 -
Flags: checked-in+
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.21
You need to log in
before you can comment on or make changes to this bug.
Description
•