diff options
author | David Benjamin <davidben@chromium.org> | 2014-10-29 17:13:38 -0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-10-29 23:13:20 +0000 |
commit | 3e700bb3e812730f60bec529a14c0d35ea9665aa (patch) | |
tree | 6bcab6fc57502e75c316d855c018d256d4c6def4 | |
parent | 2a0f3420f72b47b31c259ffd9f1dde8e646cc0e6 (diff) | |
download | src-3e700bb3e812730f60bec529a14c0d35ea9665aa.tar.gz |
Get MASM output working on Win32.
We were building the NASM flavor with MASM which is why it didn't work. Get the
MASM output working: cpuid and cmove are not available in MASM unless the file
declares .686. Also work around MASM rejecting a very long line in SHA-256.
The follow-up change will get the NASM flavor working. We should probably use
that one as it's documented as supported upstream. But let's make this one
functional too.
Change-Id: Ica69cc042a7250c7bc9ba9325caab597cd4ce616
Reviewed-on: https://boringssl-review.googlesource.com/2091
Reviewed-by: Adam Langley <agl@google.com>
-rw-r--r-- | crypto/CMakeLists.txt | 9 | ||||
-rw-r--r-- | crypto/bn/generic.c | 2 | ||||
-rw-r--r-- | crypto/perlasm/x86asm.pl | 4 | ||||
-rw-r--r-- | crypto/perlasm/x86masm.pl | 7 |
4 files changed, 13 insertions, 9 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 5d656ec..117614e 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -13,8 +13,8 @@ else() message("Using masm") set(PERLASM_STYLE masm) else() - message("Using win32n") - set(PERLASM_STYLE win32n) + message("Using win32") + set(PERLASM_STYLE win32) endif() set(ASM_EXT asm) enable_language(ASM_MASM) @@ -27,9 +27,10 @@ function(perlasm dest src) DEPENDS ${src} ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl - ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86gas.pl - ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl + ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86gas.pl + ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86masm.pl + ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86nasm.pl WORKING_DIRECTORY . ) endfunction() diff --git a/crypto/bn/generic.c b/crypto/bn/generic.c index b745750..c60cfd9 100644 --- a/crypto/bn/generic.c +++ b/crypto/bn/generic.c @@ -61,7 +61,7 @@ #include "internal.h" -#if defined(OPENSSL_WINDOWS) || defined(OPENSSL_NO_ASM) || \ +#if defined(OPENSSL_NO_ASM) || \ (!defined(OPENSSL_X86_64) && !defined(OPENSSL_X86)) #if defined(OPENSSL_WINDOWS) diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index bab15e7..3c7be40 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl @@ -235,9 +235,9 @@ sub ::asciz sub ::asm_finish { &file_end(); - print "#if defined(__i386__)\n"; + print "#if defined(__i386__)\n" unless $win32; print @out; - print "#endif\n"; + print "#endif\n" unless $win32; } sub ::asm_init diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl index 1741342..a491529 100644 --- a/crypto/perlasm/x86masm.pl +++ b/crypto/perlasm/x86masm.pl @@ -82,7 +82,7 @@ TITLE $_[0].asm IF \@Version LT 800 ECHO MASM version 8.00 or later is strongly recommended. ENDIF -.486 +.686 .MODEL FLAT OPTION DOTNAME IF \@Version LT 800 @@ -166,7 +166,10 @@ sub ::data_short { push(@out,("DW\t").join(',',@_)."\n"); } sub ::data_word -{ push(@out,("DD\t").join(',',@_)."\n"); } +{ # MASM can't handle long lines, so emit one word at a time. + foreach(@_) + { push(@out,"DD\t$_\n"); } +} sub ::align { push(@out,"ALIGN\t$_[0]\n"); } |