Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Issue 217813007: Pass the /safeseh option to ml.exe. (Closed)

Created:
6 years, 9 months ago by wtc
Modified:
6 years, 8 months ago
Reviewers:
scottmg
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp.git@master
Visibility:
Public.

Description

Add MASM settings support to msvs_settings. The 'UseSafeExceptionHandlers' setting, if set to 'true', passes the /safeseh option to ml.exe. Without it, linking fails with error messages like this: [182/259] LINK_EMBED(DLL) crnss.dll FAILED: C:\python_27_amd64\files\python.exe gyp-win-tool link-with-manifests env ironment.x86 True crnss.dll "C:\python_27_amd64\files\python.exe gyp-win-tool li nk-wrapper environment.x86 False link.exe /nologo /IMPLIB:crnss.dll.lib /DLL /OU T:crnss.dll @crnss.dll.rsp" 2 mt.exe rc.exe "obj\third_party\nss\nss.crnss.dll.i ntermediate.manifest" obj\third_party\nss\nss.crnss.dll.generated.manifest nss_static.lib(nss_static.intel-aes-x86-masm_asm.obj) : error LNK2026: module un safe for SAFESEH image. nss_static.lib(nss_static.intel-gcm-x86-masm_asm.obj) : error LNK2026: module un safe for SAFESEH image. crnss.dll : fatal error LNK1281: Unable to generate SAFESEH image. Add the ImageHasSafeExceptionHandlers setting support for VCLinkerTool. If set to 'true', it is mapped to the /SAFESEH linker option. R=scottmg@chromium.org BUG=none Committed: https://code.google.com/p/gyp/source/detail?r=1894

Patch Set 1 #

Patch Set 2 : Add MASM settings support to msvs_settings. #

Total comments: 3

Patch Set 3 : Add a unit test gyptest-ml-safeseh.py #

Total comments: 10

Patch Set 4 : Support the ImageHasSafeExceptionHandlers setting for VCLinkerTool. #

Total comments: 1

Patch Set 5 : Add a gyptest-link-safeseh.py test. #

Patch Set 6 : Rename the assmebly code test file. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -10 lines) Patch
M pylib/gyp/generator/ninja.py View 1 3 chunks +4 lines, -1 line 2 comments Download
M pylib/gyp/msvs_emulation.py View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
A test/win/gyptest-link-safeseh.py View 1 2 3 4 1 chunk +40 lines, -0 lines 4 comments Download
A test/win/gyptest-ml-safeseh.py View 1 2 1 chunk +22 lines, -0 lines 0 comments Download
A test/win/linker-flags/safeseh.gyp View 1 2 3 4 5 1 chunk +47 lines, -0 lines 2 comments Download
A + test/win/linker-flags/safeseh_hello.cc View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
A test/win/linker-flags/safeseh_zero.asm View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
A test/win/ml-safeseh/a.asm View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
A + test/win/ml-safeseh/hello.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
A + test/win/ml-safeseh/ml-safeseh.gyp View 1 2 3 1 chunk +7 lines, -7 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
wtc
Scott: please review. I found the /safeseh option for ML at http://msdn.microsoft.com/en-us/library/s0ksfwcf.aspx This is the ...
6 years, 9 months ago (2014-03-29 01:13:01 UTC) #1
scottmg
I don't think this should be hardcoded in the generator. I checked VS2013 and the ...
6 years, 8 months ago (2014-03-31 16:25:18 UTC) #2
wtc
On 2014/03/31 16:25:18, scottmg wrote: > I don't think this should be hardcoded in the ...
6 years, 8 months ago (2014-04-09 02:14:07 UTC) #3
scottmg
On 2014/04/09 02:14:07, wtc wrote: > On 2014/03/31 16:25:18, scottmg wrote: > > I don't ...
6 years, 8 months ago (2014-04-09 02:23:30 UTC) #4
wtc
Thanks a lot for the hint. Please review patch set 2. https://codereview.chromium.org/217813007/diff/20001/pylib/gyp/msvs_emulation.py File pylib/gyp/msvs_emulation.py (right): ...
6 years, 8 months ago (2014-04-09 03:41:08 UTC) #5
scottmg
Looks fine, please add a test similar to those in test\win. https://codereview.chromium.org/217813007/diff/20001/pylib/gyp/msvs_emulation.py File pylib/gyp/msvs_emulation.py (right): ...
6 years, 8 months ago (2014-04-09 03:44:59 UTC) #6
wtc
I added a test. Please review patch set 3. https://codereview.chromium.org/217813007/diff/20001/pylib/gyp/msvs_emulation.py File pylib/gyp/msvs_emulation.py (right): https://codereview.chromium.org/217813007/diff/20001/pylib/gyp/msvs_emulation.py#newcode349 pylib/gyp/msvs_emulation.py:349: ...
6 years, 8 months ago (2014-04-10 02:41:59 UTC) #7
scottmg
https://codereview.chromium.org/217813007/diff/40001/test/win/gyptest-ml-safeseh.py File test/win/gyptest-ml-safeseh.py (right): https://codereview.chromium.org/217813007/diff/40001/test/win/gyptest-ml-safeseh.py#newcode8 test/win/gyptest-ml-safeseh.py:8: Make sure the /safeseh option can be passed to ...
6 years, 8 months ago (2014-04-10 03:31:51 UTC) #8
wtc
Please review patch set 4. Thanks. https://codereview.chromium.org/217813007/diff/40001/test/win/gyptest-ml-safeseh.py File test/win/gyptest-ml-safeseh.py (right): https://codereview.chromium.org/217813007/diff/40001/test/win/gyptest-ml-safeseh.py#newcode16 test/win/gyptest-ml-safeseh.py:16: test = TestGyp.TestGyp(formats=['ninja']) ...
6 years, 8 months ago (2014-04-10 18:21:48 UTC) #9
scottmg
Thanks! Is there something in dumpbin's output that indicates that an image is /SAFESEH? If ...
6 years, 8 months ago (2014-04-10 19:23:21 UTC) #10
wtc
Please review patch set 6. I added a new gyptest-link-safeseh.py test. https://codereview.chromium.org/217813007/diff/90001/test/win/gyptest-link-safeseh.py File test/win/gyptest-link-safeseh.py (right): ...
6 years, 8 months ago (2014-04-10 22:21:43 UTC) #11
scottmg
lgtm, thanks for your patience. https://codereview.chromium.org/217813007/diff/90001/test/win/gyptest-link-safeseh.py File test/win/gyptest-link-safeseh.py (right): https://codereview.chromium.org/217813007/diff/90001/test/win/gyptest-link-safeseh.py#newcode16 test/win/gyptest-link-safeseh.py:16: test = TestGyp.TestGyp(formats=['ninja']) On ...
6 years, 8 months ago (2014-04-10 22:57:08 UTC) #12
wtc
The CQ bit was checked by wtc@chromium.org
6 years, 8 months ago (2014-04-10 23:32:01 UTC) #13
wtc
Scott: are the gyp-win64 and gyp-win32 trybot failures caused by my CL? They don't seem ...
6 years, 8 months ago (2014-04-10 23:34:23 UTC) #14
scottmg
Committed patchset #6 manually as r1894 (presubmit successful).
6 years, 8 months ago (2014-04-10 23:36:42 UTC) #15
wtc
https://codereview.chromium.org/217813007/diff/90001/pylib/gyp/generator/ninja.py File pylib/gyp/generator/ninja.py (right): https://codereview.chromium.org/217813007/diff/90001/pylib/gyp/generator/ninja.py#newcode1873 pylib/gyp/generator/ninja.py:1873: description='CXX $out', Scott: when compiling a C++ file, Ninja ...
6 years, 8 months ago (2014-04-11 03:13:18 UTC) #16
scottmg
6 years, 8 months ago (2014-04-11 03:31:43 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/217813007/diff/90001/pylib/gyp/generator/ninj...
File pylib/gyp/generator/ninja.py (right):

https://codereview.chromium.org/217813007/diff/90001/pylib/gyp/generator/ninj...
pylib/gyp/generator/ninja.py:1873: description='CXX $out',
On 2014/04/11 03:13:19, wtc wrote:
> 
> Scott: when compiling a C++ file, Ninja displays the output filename, but when
> assembling an assembly code file, Ninja displays the input filename. See line
> 1893. I was confused by this.
> 
> Why the difference?

No reason, probably because Evan/Nico wrote the CC rules for Linux/Mac that
Windows was copied from, and I wrote those Windows-specific rules for IDL/RC. I
guess the input seemed more useful than the output at the time. It's just a
message for the user, so it could be "ASM $in -> $out" or whatever.

Powered by Google App Engine
This is Rietveld 408576698