Skip to content

Commit

Permalink
restrict patches to windows / macos platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
busterb committed Oct 31, 2023
1 parent 9bca15b commit 548b3d0
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,18 @@ fixup_masm() {

# generate assembly crypto algorithms
asm_src=$CWD/asm
rm -fr $asm_src
cp -a $libcrypto_src $asm_src
for i in `ls -1 patches/asm/*.patch | sort -n`; do
patch -d $asm_src -p 4 < $i;
done

setup_asm_generator() {
rm -fr $asm_src
cp -a $libcrypto_src $asm_src
}

setup_asm_generator_patched() {
setup_asm_generator
for i in `ls -1 patches/asm/*.patch | sort -n`; do
patch -d $asm_src -p 4 < $i 1> /dev/null 2>/dev/null ;
done
}

gen_asm_stdout() {
CC=true perl $asm_src/$2 $1 > crypto/$3.tmp
Expand Down Expand Up @@ -242,6 +249,8 @@ gen_asm() {
fi
}

setup_asm_generator

echo generating mips ASM source for elf
gen_asm_mips o32 aes aes-mips aes-mips
gen_asm_mips o32 bn mips bn-mips
Expand Down Expand Up @@ -271,6 +280,14 @@ $CP $libcrypto_src/arch/arm/arm_arch.h crypto

for abi in elf macosx masm mingw64; do
echo generating x86_64 ASM source for $abi

# use patched generators for non-elf targets
if [ $abi = "elf" ]; then
setup_asm_generator
else
setup_asm_generator_patched
fi

gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S
gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl aes/vpaes-$abi-x86_64.S
gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl aes/bsaes-$abi-x86_64.S
Expand Down

0 comments on commit 548b3d0

Please sign in to comment.