From 0e8b7c1ef9bd7c313bf60ed0701809645978c3f6 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Wed, 5 Jun 2019 23:08:41 -0500 Subject: [PATCH] remove comments and unify fixups --- CMakeLists.txt | 3 --- update.sh | 23 +++++++++++------------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b0599..9537407 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,9 +290,6 @@ if(ENABLE_ASM) elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") set(HOST_ASM_MACOSX_X86_64 true) elseif(MSVC AND "${CMAKE_GENERATOR}" MATCHES "Win64") - # XXX Disabled for now, CMake's MASM support seems to either never - # build supply ASM or build it with the C compiler in a mode where it - # does not parse correctly. It might be easier to get NASM support working. set(HOST_ASM_MASM_X86_64 true) ENABLE_LANGUAGE(ASM_MASM) elseif(CMAKE_SYSTEM_NAME MATCHES "MINGW" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") diff --git a/update.sh b/update.sh index d1fe017..216f2c2 100755 --- a/update.sh +++ b/update.sh @@ -158,6 +158,15 @@ $CP crypto/compat/ui_openssl_win.c crypto/ui # add the libcrypto symbol export list $GREP -v OPENSSL_ia32cap_P $libcrypto_src/Symbols.list | $GREP '^[A-Za-z0-9_]' > crypto/crypto.sym +fixup_masm() { + cpp -I./crypto $1 \ + | sed -e 's/^#/;/' \ + | sed -e 's/|/OR/g' \ + | sed -e 's/~/NOT/g' \ + | sed -e 's/1 << \([0-9]*\)/1 SHL \1/g' \ + > $2 +} + # generate assembly crypto algorithms asm_src=$libcrypto_src gen_asm_stdout() { @@ -168,12 +177,7 @@ gen_asm_stdout() { #endif EOF if [ $1 = "masm" ]; then - cpp -I./crypto $3.tmp \ - | sed -e 's/^#/;/' \ - | sed -e 's/|/OR/g' \ - | sed -e 's/~/NOT/g' \ - | sed -e 's/1 << \([0-9]*\)/1 SHL \1/g' \ - > $3 + fixup_masm $3.tmp $3 else $MV $3.tmp $3 fi @@ -186,12 +190,7 @@ gen_asm() { #endif EOF if [ $1 = "masm" ]; then - cpp -I./crypto $3.tmp \ - | sed -e 's/^#/;/' \ - | sed -e 's/|/OR/g' \ - | sed -e 's/~/NOT/g' \ - | sed -e 's/1 << \([0-9]*\)/1 SHL \1/g' \ - > $3 + fixup_masm $3.tmp $3 else $MV $3.tmp $3 fi