make _win.S know if it's 64-bit
authorMike Klein <mtklein@chromium.org>
Wed, 29 Mar 2017 23:29:13 +0000 (19:29 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 30 Mar 2017 18:45:19 +0000 (18:45 +0000)
I think this is the root of my Windows / Chrome problems.
Even on 32-bit builds, Chrome compiles nacl64.exe in 64-bit mode.

So to make things simple, always put _win.S in the sources,
and no-op it away when assembling for 32-bit.

Change-Id: I19f163491739a6c0cbdedd0ce353f1d2289907ae
Reviewed-on: https://skia-review.googlesource.com/10637
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

BUILD.gn
gn/BUILD.gn
src/jumper/SkJumper_generated_win.S
src/jumper/build_stages.py

index 88ec34f..b84a0a7 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -520,9 +520,9 @@ optional("jumper") {
     "src/jumper/SkJumper.cpp",
     "src/jumper/SkJumper_stages.cpp",
   ]
-  if (is_win && target_cpu == "x64") {
+  if (is_win) {
     sources += [ "src/jumper/SkJumper_generated_win.S" ]
-  } else if (!is_win) {
+  } else {
     sources += [ "src/jumper/SkJumper_generated.S" ]
   }
 }
index 30a8669..52c13bf 100644 (file)
@@ -502,7 +502,11 @@ toolchain("msvc") {
   }
 
   tool("asm") {
-    command = "$env_setup$bin/ml64.exe /nologo /c /Fo {{output}} {{source}}"
+    _ml = "ml"
+    if (target_cpu == "x64") {
+      _ml += "64"
+    }
+    command = "$env_setup$bin/$_ml.exe /nologo /c /Fo {{output}} {{source}}"
     outputs = [
       "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
     ]
index 984169e..1590b7b 100644 (file)
@@ -6,6 +6,7 @@
 ; This file is generated semi-automatically with this command:
 ;   $ src/jumper/build_stages.py
 
+IFDEF RAX
 _text SEGMENT
 
 PUBLIC _sk_start_pipeline_hsw
@@ -5550,4 +5551,5 @@ _sk_linear_gradient_2stops_sse2 LABEL PROC
   DB  72,173                              ; lods          %ds:(%rsi),%rax
   DB  65,15,40,192                        ; movaps        %xmm8,%xmm0
   DB  255,224                             ; jmpq          *%rax
+ENDIF
 END
index dc2f41f..4bedeb5 100755 (executable)
@@ -167,9 +167,11 @@ print '''; Copyright 2017 Google Inc.
 ;   $ src/jumper/build_stages.py
 '''
 
+print 'IFDEF RAX'
 print '_text SEGMENT'
 parse_object_file('win_hsw.o',   'DB')
 parse_object_file('win_avx.o',   'DB')
 parse_object_file('win_sse41.o', 'DB')
 parse_object_file('win_sse2.o',  'DB')
+print 'ENDIF'
 print 'END'