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>
This commit is contained in:
David Benjamin 2014-10-29 17:13:38 -04:00 committed by Adam Langley
parent 2a0f3420f7
commit 3e700bb3e8
4 changed files with 13 additions and 9 deletions

View File

@ -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/x86asm.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/x86masm.pl
${PROJECT_SOURCE_DIR}/crypto/perlasm/x86nasm.pl
WORKING_DIRECTORY .
)
endfunction()

View File

@ -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)

View File

@ -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

View File

@ -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"); }