<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>161517</bug_id>
          
          <creation_ts>2016-09-01 16:50:26 -0700</creation_ts>
          <short_desc>WebKit fails to build on Windows with Ninja due to bad flags passed to ml.exe</short_desc>
          <delta_ts>2017-05-12 15:49:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Windows 10</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>170833</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Blaze Burg">bburg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bburg</cc>
    
    <cc>bfulgham</cc>
    
    <cc>don.olmstead</cc>
    
    <cc>lforschler</cc>
    
    <cc>pvollan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1225616</commentid>
    <comment_count>0</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-09-01 16:50:26 -0700</bug_when>
    <thetext>Configuration:

- MSVC 14.0
- using Ninja
- No Cygwin

I don&apos;t really know enough about what&apos;s going on with Ninja and CMake to debug this without any pointers.

Here&apos;s the relevant CMake rule:

# The explanation for not making LLIntAssembly.h part of the OBJECT_DEPENDS property of some of
# the .cpp files below is similar to the one in the previous comment. However, since these .cpp
# files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
# since it is used in the add_library() call at the end of this file.
if (MSVC)
    enable_language(ASM_MASM)
    list(APPEND JavaScriptCore_SOURCES
        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
    )
    # Win32 needs /safeseh with assembly, but Win64 does not.
    if (CMAKE_SIZEOF_VOID_P EQUAL 4)
        set_source_files_properties(${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LowLevelInterpreterWin.asm
            PROPERTIES COMPILE_FLAGS  &quot;/safeseh&quot;
        )
    endif ()
else ()
    list(APPEND JavaScriptCore_HEADERS
        ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h
    )
endif ()

Here&apos;s the build command that ninja made (from build.ninja). It should not have all of those flags, as the macro assembler doesn&apos;t seem to like cl.exe&apos;s flags.

build Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\__\__\DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm.obj: ASM_MASM_COMPILER__JavaScriptCore DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm || cmake_order_depends_target_JavaScriptCore
  DEFINES = -DBUILDING_JavaScriptCore -DBUILDING_WITH_CMAKE=1 -DHAVE_CONFIG_H=1 -DJavaScriptCore_EXPORTS -DNOMINMAX -DUNICODE -DWINVER=0x601 -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_UNICODE -D_WINDOWS
  DEP_FILE = Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\__\__\DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm.obj.d
  FLAGS = /wd4018 /wd4068 /wd4099 /wd4100 /wd4127 /wd4138 /wd4146 /wd4180 /wd4189 /wd4201 /wd4206 /wd4244 /wd4251 /wd4267 /wd4275 /wd4288 /wd4291 /wd4305 /wd4309 /wd4344 /wd4355 /wd4389 /wd4396 /wd4456 /wd4457 /wd4458 /wd4459 /wd4481 /wd4503 /wd4505 /wd4510 /wd4512 /wd4530 /wd4610 /wd4611 /wd4646 /wd4702 /wd4706 /wd4722 /wd4800 /wd4819 /wd4951 /wd4952 /wd4996 /wd6011 /wd6031 /wd6211 /wd6246 /wd6255 /wd6387 /Zi /GS /EHa- /EHc- /EHs- /fp:except- /analyze- /bigobj /Gy- /openmp- /GF- /Oy- /WX /Wv:18 /safeseh
  INCLUDES = -IDerivedSources\ForwardingHeaders -IDerivedSources -I..\..\WebKitLibraries\win\include -I. -I..\..\Source\JavaScriptCore -I..\..\Source\JavaScriptCore\.. -I..\..\Source\JavaScriptCore\API -I..\..\Source\JavaScriptCore\ForwardingHeaders -I..\..\Source\JavaScriptCore\assembler -I..\..\Source\JavaScriptCore\b3 -I..\..\Source\JavaScriptCore\b3\air -I..\..\Source\JavaScriptCore\bindings -I..\..\Source\JavaScriptCore\builtins -I..\..\Source\JavaScriptCore\bytecode -I..\..\Source\JavaScriptCore\bytecompiler -I..\..\Source\JavaScriptCore\dfg -I..\..\Source\JavaScriptCore\disassembler -I..\..\Source\JavaScriptCore\disassembler\udis86 -I..\..\Source\JavaScriptCore\ftl -I..\..\Source\JavaScriptCore\heap -I..\..\Source\JavaScriptCore\debugger -I..\..\Source\JavaScriptCore\inspector -I..\..\Source\JavaScriptCore\inspector\agents -I..\..\Source\JavaScriptCore\inspector\augmentable -I..\..\Source\JavaScriptCore\inspector\remote -I..\..\Source\JavaScriptCore\interpreter -I..\..\Source\JavaScriptCore\jit -I..\..\Source\JavaScriptCore\llint -I..\..\Source\JavaScriptCore\parser -I..\..\Source\JavaScriptCore\profiler -I..\..\Source\JavaScriptCore\replay -I..\..\Source\JavaScriptCore\runtime -I..\..\Source\JavaScriptCore\tools -I..\..\Source\JavaScriptCore\wasm -I..\..\Source\JavaScriptCore\yarr -IDerivedSources\JavaScriptCore -IDerivedSources\JavaScriptCore\inspector -I..\include\private
  OBJECT_DIR = Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir
  OBJECT_FILE_DIR = Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\__\__\DerivedSources\JavaScriptCore
  TARGET_COMPILE_PDB = Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\
  TARGET_PDB = bin32\JavaScriptCore.pdb
  RSP_FILE = Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\__\__\DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm.obj.rsp

The terminal output from the failed command is here:

[3/2292] Building ASM_MASM object Source\JavaScriptCore\CMakeFiles\J...r\__\__\DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm.obj
FAILED: Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/LowLevelInterpreterWin.asm.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\ml.exe    @Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\__\__\DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm.obj.rsp /c  /Fo Source\JavaScriptCore\CMakeFiles\JavaScriptCore.dir\__\__\DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm.obj DerivedSources\JavaScriptCore\LowLevelInterpreterWin.asm
MASM : warning A4018:invalid command-line option : /wd4018
MASM : warning A4018:invalid command-line option : /wd4068
MASM : warning A4018:invalid command-line option : /wd4099
MASM : warning A4018:invalid command-line option : /wd4100
MASM : warning A4018:invalid command-line option : /wd4127
MASM : warning A4018:invalid command-line option : /wd4138
MASM : warning A4018:invalid command-line option : /wd4146
MASM : warning A4018:invalid command-line option : /wd4180
MASM : warning A4018:invalid command-line option : /wd4189
MASM : warning A4018:invalid command-line option : /wd4201
MASM : warning A4018:invalid command-line option : /wd4206
MASM : warning A4018:invalid command-line option : /wd4244
MASM : warning A4018:invalid command-line option : /wd4251
MASM : warning A4018:invalid command-line option : /wd4267
MASM : warning A4018:invalid command-line option : /wd4275
MASM : warning A4018:invalid command-line option : /wd4288
MASM : warning A4018:invalid command-line option : /wd4291
MASM : warning A4018:invalid command-line option : /wd4305
MASM : warning A4018:invalid command-line option : /wd4309
MASM : warning A4018:invalid command-line option : /wd4344
MASM : warning A4018:invalid command-line option : /wd4355
MASM : warning A4018:invalid command-line option : /wd4389
MASM : warning A4018:invalid command-line option : /wd4396
MASM : warning A4018:invalid command-line option : /wd4456
MASM : warning A4018:invalid command-line option : /wd4457
MASM : warning A4018:invalid command-line option : /wd4458
MASM : warning A4018:invalid command-line option : /wd4459
MASM : warning A4018:invalid command-line option : /wd4481
MASM : warning A4018:invalid command-line option : /wd4503
MASM : warning A4018:invalid command-line option : /wd4505
MASM : warning A4018:invalid command-line option : /wd4510
MASM : warning A4018:invalid command-line option : /wd4512
MASM : warning A4018:invalid command-line option : /wd4530
MASM : warning A4018:invalid command-line option : /wd4610
MASM : warning A4018:invalid command-line option : /wd4611
MASM : warning A4018:invalid command-line option : /wd4646
MASM : warning A4018:invalid command-line option : /wd4702
MASM : warning A4018:invalid command-line option : /wd4706
MASM : warning A4018:invalid command-line option : /wd4722
MASM : warning A4018:invalid command-line option : /wd4800
MASM : warning A4018:invalid command-line option : /wd4819
MASM : warning A4018:invalid command-line option : /wd4951
MASM : warning A4018:invalid command-line option : /wd4952
MASM : warning A4018:invalid command-line option : /wd4996
MASM : warning A4018:invalid command-line option : /wd6011
MASM : warning A4018:invalid command-line option : /wd6031
MASM : warning A4018:invalid command-line option : /wd6211
MASM : warning A4018:invalid command-line option : /wd6246
MASM : warning A4018:invalid command-line option : /wd6255
MASM : warning A4018:invalid command-line option : /wd6387
MASM : warning A4018:invalid command-line option : /GS
MASM : warning A4018:invalid command-line option : /EHa-
MASM : warning A4018:invalid command-line option : /EHc-
MASM : warning A4018:invalid command-line option : /EHs-
MASM : warning A4018:invalid command-line option : /fp:except-
MASM : warning A4018:invalid command-line option : /analyze-
MASM : warning A4018:invalid command-line option : /bigobj
MASM : warning A4018:invalid command-line option : /openmp-
MASM : warning A4018:invalid command-line option : /GF-
MASM : warning A4018:invalid command-line option : /Oy-
MASM : fatal error A1013:invalid numerical command-line argument : /W
Microsoft (R) Macro Assembler Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[5/2292] cmd.exe /C &quot;cd /D C:\Code\webkit\OpenSource\WebKitBuild\Rel...\OpenSource\WebKitBuild\Release\DerivedSources\WebCore\preBuild.cmd&quot;
ninja: build stopped: subcommand failed.


===== BUILD FAILED ======</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1225619</commentid>
    <comment_count>1</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2016-09-01 17:00:10 -0700</bug_when>
    <thetext>Building without ninja works as expected (at least builds through JavaScriptCore).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1225626</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-09-01 17:12:28 -0700</bug_when>
    <thetext>Is this a 32-bit build?  My WinCairo bot is doing 64-bit ninja builds and has been successfully for a while.

We could do something like what I did in https://trac.webkit.org/changeset/194434 and just call ml.exe directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1308115</commentid>
    <comment_count>3</comment_count>
    <who name="Don Olmstead">don.olmstead</who>
    <bug_when>2017-05-12 15:49:02 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 170833 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>