Browse Source

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>
kris/onging/CECPQ3_patch15
David Benjamin 10 years ago
committed by Adam Langley
parent
commit
03a739d8d2
2 changed files with 15 additions and 3 deletions
  1. +7
    -3
      crypto/CMakeLists.txt
  2. +8
    -0
      crypto/perlasm/x86nasm.pl

+ 7
- 3
crypto/CMakeLists.txt View File

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


+ 8
- 0
crypto/perlasm/x86nasm.pl View File

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


Loading…
Cancel
Save