diff options
author | Brent Cook <busterb@gmail.com> | 2023-10-31 09:25:23 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2023-10-31 09:25:23 -0500 |
commit | 548b3d0485c0ad00c6041670c2192c4b5bd80e66 (patch) | |
tree | 2df1ddee47fd15877baf590709454045400149fe | |
parent | 9bca15bad544eeaa12f59f1f49271e83a4b34ca3 (diff) | |
download | portable-548b3d0485c0ad00c6041670c2192c4b5bd80e66.tar.gz portable-548b3d0485c0ad00c6041670c2192c4b5bd80e66.tar.bz2 portable-548b3d0485c0ad00c6041670c2192c4b5bd80e66.zip |
restrict patches to windows / macos platforms
-rwxr-xr-x | update.sh | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -196,11 +196,18 @@ fixup_masm() { | |||
196 | 196 | ||
197 | # generate assembly crypto algorithms | 197 | # generate assembly crypto algorithms |
198 | asm_src=$CWD/asm | 198 | asm_src=$CWD/asm |
199 | rm -fr $asm_src | 199 | |
200 | cp -a $libcrypto_src $asm_src | 200 | setup_asm_generator() { |
201 | for i in `ls -1 patches/asm/*.patch | sort -n`; do | 201 | rm -fr $asm_src |
202 | patch -d $asm_src -p 4 < $i; | 202 | cp -a $libcrypto_src $asm_src |
203 | done | 203 | } |
204 | |||
205 | setup_asm_generator_patched() { | ||
206 | setup_asm_generator | ||
207 | for i in `ls -1 patches/asm/*.patch | sort -n`; do | ||
208 | patch -d $asm_src -p 4 < $i 1> /dev/null 2>/dev/null ; | ||
209 | done | ||
210 | } | ||
204 | 211 | ||
205 | gen_asm_stdout() { | 212 | gen_asm_stdout() { |
206 | CC=true perl $asm_src/$2 $1 > crypto/$3.tmp | 213 | CC=true perl $asm_src/$2 $1 > crypto/$3.tmp |
@@ -242,6 +249,8 @@ gen_asm() { | |||
242 | fi | 249 | fi |
243 | } | 250 | } |
244 | 251 | ||
252 | setup_asm_generator | ||
253 | |||
245 | echo generating mips ASM source for elf | 254 | echo generating mips ASM source for elf |
246 | gen_asm_mips o32 aes aes-mips aes-mips | 255 | gen_asm_mips o32 aes aes-mips aes-mips |
247 | gen_asm_mips o32 bn mips bn-mips | 256 | gen_asm_mips o32 bn mips bn-mips |
@@ -271,6 +280,14 @@ $CP $libcrypto_src/arch/arm/arm_arch.h crypto | |||
271 | 280 | ||
272 | for abi in elf macosx masm mingw64; do | 281 | for abi in elf macosx masm mingw64; do |
273 | echo generating x86_64 ASM source for $abi | 282 | echo generating x86_64 ASM source for $abi |
283 | |||
284 | # use patched generators for non-elf targets | ||
285 | if [ $abi = "elf" ]; then | ||
286 | setup_asm_generator | ||
287 | else | ||
288 | setup_asm_generator_patched | ||
289 | fi | ||
290 | |||
274 | gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S | 291 | gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S |
275 | gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl aes/vpaes-$abi-x86_64.S | 292 | gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl aes/vpaes-$abi-x86_64.S |
276 | gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl aes/bsaes-$abi-x86_64.S | 293 | gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl aes/bsaes-$abi-x86_64.S |