diff --git a/src/cmake/perlasm.cmake b/src/cmake/perlasm.cmake index 0dc104ca9..17a47b9e0 100644 --- a/src/cmake/perlasm.cmake +++ b/src/cmake/perlasm.cmake @@ -40,9 +40,9 @@ function(perlasm var arch dest src) add_perlasm_target("${dest}-linux.S" ${src} linux32 ${ARGN}) append_to_parent_scope("${var}_ASM" "${dest}-linux.S") elseif(arch STREQUAL "x86") - add_perlasm_target("${dest}-apple.S" ${src} macosx -fPIC -DOPENSSL_IA32_SSE2 ${ARGN}) - add_perlasm_target("${dest}-linux.S" ${src} elf -fPIC -DOPENSSL_IA32_SSE2 ${ARGN}) - add_perlasm_target("${dest}-win.asm" ${src} win32n -DOPENSSL_IA32_SSE2 ${ARGN}) + add_perlasm_target("${dest}-apple.S" ${src} macosx -fPIC ${ARGN}) + add_perlasm_target("${dest}-linux.S" ${src} elf -fPIC ${ARGN}) + add_perlasm_target("${dest}-win.asm" ${src} win32n ${ARGN}) append_to_parent_scope("${var}_ASM" "${dest}-apple.S" "${dest}-linux.S") append_to_parent_scope("${var}_NASM" "${dest}-win.asm") elseif(arch STREQUAL "x86_64") diff --git a/src/crypto/chacha/asm/chacha-x86.pl b/src/crypto/chacha/asm/chacha-x86.pl index 482d53f3d..ec23a51b7 100755 --- a/src/crypto/chacha/asm/chacha-x86.pl +++ b/src/crypto/chacha/asm/chacha-x86.pl @@ -45,7 +45,7 @@ require "x86asm.pl"; $output=pop; open STDOUT,">$output"; -&asm_init($ARGV[0],$ARGV[$#ARGV] eq "386"); +&asm_init($ARGV[0]); $xmm=$ymm=1; $gasver=999; # enable everything diff --git a/src/crypto/fipsmodule/aes/asm/vpaes-x86.pl b/src/crypto/fipsmodule/aes/asm/vpaes-x86.pl index 04c407d75..d7c090563 100644 --- a/src/crypto/fipsmodule/aes/asm/vpaes-x86.pl +++ b/src/crypto/fipsmodule/aes/asm/vpaes-x86.pl @@ -62,7 +62,7 @@ $output = pop; open OUT,">$output"; *STDOUT=*OUT; -&asm_init($ARGV[0],$x86only = $ARGV[$#ARGV] eq "386"); +&asm_init($ARGV[0]); $PREFIX="vpaes"; diff --git a/src/crypto/fipsmodule/bn/asm/bn-586.pl b/src/crypto/fipsmodule/bn/asm/bn-586.pl index c23d6a929..eae6da946 100644 --- a/src/crypto/fipsmodule/bn/asm/bn-586.pl +++ b/src/crypto/fipsmodule/bn/asm/bn-586.pl @@ -16,8 +16,7 @@ open STDOUT,">$output"; &asm_init($ARGV[0]); -$sse2=0; -for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } +$sse2=1; &external_label("OPENSSL_ia32cap_P") if ($sse2); diff --git a/src/crypto/fipsmodule/bn/asm/x86-mont.pl b/src/crypto/fipsmodule/bn/asm/x86-mont.pl index 58b28ade8..c097574a8 100755 --- a/src/crypto/fipsmodule/bn/asm/x86-mont.pl +++ b/src/crypto/fipsmodule/bn/asm/x86-mont.pl @@ -42,8 +42,7 @@ open STDOUT,">$output"; &asm_init($ARGV[0]); -$sse2=0; -for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } +$sse2=1; &external_label("OPENSSL_ia32cap_P") if ($sse2); diff --git a/src/crypto/fipsmodule/modes/asm/ghash-x86.pl b/src/crypto/fipsmodule/modes/asm/ghash-x86.pl index f893b50c2..17dbeadb8 100644 --- a/src/crypto/fipsmodule/modes/asm/ghash-x86.pl +++ b/src/crypto/fipsmodule/modes/asm/ghash-x86.pl @@ -141,10 +141,10 @@ require "x86asm.pl"; $output=pop; open STDOUT,">$output"; -&asm_init($ARGV[0],$x86only = $ARGV[$#ARGV] eq "386"); +&asm_init($ARGV[0]); -$sse2=0; -for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } +$x86only=0; +$sse2=1; if (!$x86only) {{{ if ($sse2) {{ diff --git a/src/crypto/fipsmodule/sha/asm/sha1-586.pl b/src/crypto/fipsmodule/sha/asm/sha1-586.pl index 90c236108..795263652 100644 --- a/src/crypto/fipsmodule/sha/asm/sha1-586.pl +++ b/src/crypto/fipsmodule/sha/asm/sha1-586.pl @@ -126,18 +126,15 @@ require "x86asm.pl"; $output=pop; open STDOUT,">$output"; -&asm_init($ARGV[0],$ARGV[$#ARGV] eq "386"); +&asm_init($ARGV[0]); -$xmm=$ymm=0; -for (@ARGV) { $xmm=1 if (/-DOPENSSL_IA32_SSE2/); } +$xmm = 1; # In upstream, this is controlled by shelling out to the compiler to check # versions, but BoringSSL is intended to be used with pre-generated perlasm # output, so this isn't useful anyway. $ymm = 1; -$ymm = 0 unless ($xmm); - $shaext=$xmm; ### set to zero if compiling for 1.0.1 # TODO(davidben): Consider enabling the Intel SHA Extensions code once it's diff --git a/src/crypto/fipsmodule/sha/asm/sha256-586.pl b/src/crypto/fipsmodule/sha/asm/sha256-586.pl index 99b4cf195..d23d81fbf 100644 --- a/src/crypto/fipsmodule/sha/asm/sha256-586.pl +++ b/src/crypto/fipsmodule/sha/asm/sha256-586.pl @@ -76,10 +76,9 @@ require "x86asm.pl"; $output=pop; open STDOUT,">$output"; -&asm_init($ARGV[0],$ARGV[$#ARGV] eq "386"); +&asm_init($ARGV[0]); -$xmm=$avx=0; -for (@ARGV) { $xmm=1 if (/-DOPENSSL_IA32_SSE2/); } +$xmm = 1; # In upstream, this is controlled by shelling out to the compiler to check # versions, but BoringSSL is intended to be used with pre-generated perlasm diff --git a/src/crypto/fipsmodule/sha/asm/sha512-586.pl b/src/crypto/fipsmodule/sha/asm/sha512-586.pl index 1aee14d18..b28877658 100644 --- a/src/crypto/fipsmodule/sha/asm/sha512-586.pl +++ b/src/crypto/fipsmodule/sha/asm/sha512-586.pl @@ -62,10 +62,9 @@ require "x86asm.pl"; $output=pop; open STDOUT,">$output"; -&asm_init($ARGV[0],$ARGV[$#ARGV] eq "386"); +&asm_init($ARGV[0]); -$sse2=0; -for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } +$sse2=1; &external_label("OPENSSL_ia32cap_P") if ($sse2); diff --git a/src/util/generate_build_files.py b/src/util/generate_build_files.py index e29a20314..6038ba24d 100644 --- a/src/util/generate_build_files.py +++ b/src/util/generate_build_files.py @@ -30,13 +30,13 @@ import json # downstream scripts import this to find what folders to add/remove from git. OS_ARCH_COMBOS = [ ('apple', 'aarch64', 'ios64', [], 'S'), - ('apple', 'x86', 'macosx', ['-fPIC', '-DOPENSSL_IA32_SSE2'], 'S'), + ('apple', 'x86', 'macosx', ['-fPIC'], 'S'), ('apple', 'x86_64', 'macosx', [], 'S'), ('linux', 'arm', 'linux32', [], 'S'), ('linux', 'aarch64', 'linux64', [], 'S'), - ('linux', 'x86', 'elf', ['-fPIC', '-DOPENSSL_IA32_SSE2'], 'S'), + ('linux', 'x86', 'elf', ['-fPIC'], 'S'), ('linux', 'x86_64', 'elf', [], 'S'), - ('win', 'x86', 'win32n', ['-DOPENSSL_IA32_SSE2'], 'asm'), + ('win', 'x86', 'win32n', [], 'asm'), ('win', 'x86_64', 'nasm', [], 'asm'), ('win', 'aarch64', 'win64', [], 'S'), ]