summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2014-10-29 17:48:28 -0400
committerAdam Langley <agl@google.com>2014-10-29 23:14:11 +0000
commit03a739d8d2cdc2560531a7446ead0f705409670a (patch)
tree6d02d5ea2674d24bb2066859bec5b3c8104a84ff
parent3e700bb3e812730f60bec529a14c0d35ea9665aa (diff)
downloadsrc-03a739d8d2cdc2560531a7446ead0f705409670a.tar.gz
Build Win32 with Yasm rather than MASM.
Although x86masm.pl exists, upstream's documentation suggest only x86nasm.pl is supported. Yasm seems to handle it fine with a small change. Change-Id: Ia77be57c6b743527225924b2b398f2f07a084a7f Reviewed-on: https://boringssl-review.googlesource.com/2092 Reviewed-by: Adam Langley <agl@google.com>
-rw-r--r--crypto/CMakeLists.txt10
-rw-r--r--crypto/perlasm/x86nasm.pl8
2 files changed, 15 insertions, 3 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 117614e..f98c7c8 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -12,12 +12,16 @@ else()
if (CMAKE_CL_64)
message("Using masm")
set(PERLASM_STYLE masm)
+ enable_language(ASM_MASM)
else()
- message("Using win32")
- set(PERLASM_STYLE win32)
+ message("Using win32n")
+ set(PERLASM_STYLE win32n)
+
+ # On 32-bit, upstream supports only NASM, not MASM. We'll use Yasm, specifically.
+ set(CMAKE_ASM_NASM_COMPILER "yasm")
+ enable_language(ASM_NASM)
endif()
set(ASM_EXT asm)
- enable_language(ASM_MASM)
endif()
function(perlasm dest src)
diff --git a/crypto/perlasm/x86nasm.pl b/crypto/perlasm/x86nasm.pl
index 5d92f60..f8332bb 100644
--- a/crypto/perlasm/x86nasm.pl
+++ b/crypto/perlasm/x86nasm.pl
@@ -83,7 +83,15 @@ sub ::file
%ifidn __OUTPUT_FORMAT__,obj
section code use32 class=code align=64
%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes @feat.00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
\$\@feat.00 equ 1
+%endif
section .text code align=64
%else
section .text code