diff options
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 97 |
1 files changed, 63 insertions, 34 deletions
@@ -180,65 +180,94 @@ fixup_masm() { | |||
180 | # generate assembly crypto algorithms | 180 | # generate assembly crypto algorithms |
181 | asm_src=$libcrypto_src | 181 | asm_src=$libcrypto_src |
182 | gen_asm_stdout() { | 182 | gen_asm_stdout() { |
183 | CC=true perl $asm_src/$2 $1 > $3.tmp | 183 | CC=true perl $asm_src/$2 $1 > crypto/$3.tmp |
184 | [ $1 = "elf" ] && cat <<-EOF >> $3.tmp | 184 | [ $1 = "elf" ] && cat <<-EOF >> crypto/$3.tmp |
185 | #if defined(HAVE_GNU_STACK) | 185 | #if defined(HAVE_GNU_STACK) |
186 | .section .note.GNU-stack,"",%progbits | 186 | .section .note.GNU-stack,"",%progbits |
187 | #endif | 187 | #endif |
188 | EOF | 188 | EOF |
189 | if [ $1 = "masm" ]; then | 189 | if [ $1 = "masm" ]; then |
190 | fixup_masm $3.tmp $3 | 190 | fixup_masm crypto/$3.tmp crypto/$3 |
191 | else | 191 | else |
192 | $MV $3.tmp $3 | 192 | $MV crypto/$3.tmp crypto/$3 |
193 | fi | 193 | fi |
194 | } | 194 | } |
195 | gen_asm_mips() { | ||
196 | abi=$1 | ||
197 | dir=$2 | ||
198 | src=$3 | ||
199 | dst=$4 | ||
200 | CC=true perl $asm_src/$dir/asm/$src.pl $abi $dst.S | ||
201 | cat <<-EOF >> $dst.S | ||
202 | #if defined(HAVE_GNU_STACK) | ||
203 | .section .note.GNU-stack,"",%progbits | ||
204 | #endif | ||
205 | EOF | ||
206 | mv $dst.S crypto/$dir/$dst.S | ||
207 | } | ||
195 | gen_asm() { | 208 | gen_asm() { |
196 | CC=true perl $asm_src/$2 $1 $3.tmp | 209 | CC=true perl $asm_src/$2 $1 crypto/$3.tmp |
197 | [ $1 = "elf" ] && cat <<-EOF >> $3.tmp | 210 | [ $1 = "elf" ] && cat <<-EOF >> crypto/$3.tmp |
198 | #if defined(HAVE_GNU_STACK) | 211 | #if defined(HAVE_GNU_STACK) |
199 | .section .note.GNU-stack,"",%progbits | 212 | .section .note.GNU-stack,"",%progbits |
200 | #endif | 213 | #endif |
201 | EOF | 214 | EOF |
202 | if [ $1 = "masm" ]; then | 215 | if [ $1 = "masm" ]; then |
203 | fixup_masm $3.tmp $3 | 216 | fixup_masm crypto/$3.tmp crypto/$3 |
204 | else | 217 | else |
205 | $MV $3.tmp $3 | 218 | $MV crypto/$3.tmp crypto/$3 |
206 | fi | 219 | fi |
207 | } | 220 | } |
208 | 221 | ||
222 | echo generating mips ASM source for elf | ||
223 | gen_asm_mips o32 aes aes-mips aes-mips | ||
224 | gen_asm_mips o32 bn mips bn-mips | ||
225 | gen_asm_mips o32 bn mips-mont mont-mips | ||
226 | gen_asm_mips o32 sha sha1-mips sha1-mips | ||
227 | gen_asm_mips o32 sha sha512-mips sha256-mips | ||
228 | gen_asm_mips o32 sha sha512-mips sha512-mips | ||
229 | |||
230 | echo generating mips64 ASM source for elf | ||
231 | gen_asm_mips 64 aes aes-mips aes-mips64 | ||
232 | gen_asm_mips 64 bn mips bn-mips64 | ||
233 | gen_asm_mips 64 bn mips-mont mont-mips64 | ||
234 | gen_asm_mips 64 sha sha1-mips sha1-mips64 | ||
235 | gen_asm_mips 64 sha sha512-mips sha256-mips64 | ||
236 | gen_asm_mips 64 sha sha512-mips sha512-mips64 | ||
237 | |||
209 | echo generating arm ASM source for elf | 238 | echo generating arm ASM source for elf |
210 | gen_asm_stdout elf aes/asm/aes-armv4.pl crypto/aes/aes-elf-armv4.S | 239 | gen_asm_stdout elf aes/asm/aes-armv4.pl aes/aes-elf-armv4.S |
211 | gen_asm_stdout elf bn/asm/armv4-gf2m.pl crypto/bn/gf2m-elf-armv4.S | 240 | gen_asm_stdout elf bn/asm/armv4-gf2m.pl bn/gf2m-elf-armv4.S |
212 | gen_asm_stdout elf bn/asm/armv4-mont.pl crypto/bn/mont-elf-armv4.S | 241 | gen_asm_stdout elf bn/asm/armv4-mont.pl bn/mont-elf-armv4.S |
213 | gen_asm_stdout elf sha/asm/sha1-armv4-large.pl crypto/sha/sha1-elf-armv4.S | 242 | gen_asm_stdout elf sha/asm/sha1-armv4-large.pl sha/sha1-elf-armv4.S |
214 | gen_asm_stdout elf sha/asm/sha256-armv4.pl crypto/sha/sha256-elf-armv4.S | 243 | gen_asm_stdout elf sha/asm/sha256-armv4.pl sha/sha256-elf-armv4.S |
215 | gen_asm_stdout elf sha/asm/sha512-armv4.pl crypto/sha/sha512-elf-armv4.S | 244 | gen_asm_stdout elf sha/asm/sha512-armv4.pl sha/sha512-elf-armv4.S |
216 | gen_asm_stdout elf modes/asm/ghash-armv4.pl crypto/modes/ghash-elf-armv4.S | 245 | gen_asm_stdout elf modes/asm/ghash-armv4.pl modes/ghash-elf-armv4.S |
217 | $CP $libcrypto_src/arch/arm/armv4cpuid.S crypto | 246 | $CP $libcrypto_src/arch/arm/armv4cpuid.S crypto |
218 | $CP $libcrypto_src/arch/arm/armcap.c crypto | 247 | $CP $libcrypto_src/arch/arm/armcap.c crypto |
219 | $CP $libcrypto_src/arch/arm/arm_arch.h crypto | 248 | $CP $libcrypto_src/arch/arm/arm_arch.h crypto |
220 | 249 | ||
221 | for abi in elf macosx masm mingw64; do | 250 | for abi in elf macosx masm mingw64; do |
222 | echo generating x86_64 ASM source for $abi | 251 | echo generating x86_64 ASM source for $abi |
223 | gen_asm_stdout $abi aes/asm/aes-x86_64.pl crypto/aes/aes-$abi-x86_64.S | 252 | gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S |
224 | gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl crypto/aes/vpaes-$abi-x86_64.S | 253 | gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl aes/vpaes-$abi-x86_64.S |
225 | gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl crypto/aes/bsaes-$abi-x86_64.S | 254 | gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl aes/bsaes-$abi-x86_64.S |
226 | gen_asm_stdout $abi aes/asm/aesni-x86_64.pl crypto/aes/aesni-$abi-x86_64.S | 255 | gen_asm_stdout $abi aes/asm/aesni-x86_64.pl aes/aesni-$abi-x86_64.S |
227 | gen_asm_stdout $abi aes/asm/aesni-sha1-x86_64.pl crypto/aes/aesni-sha1-$abi-x86_64.S | 256 | gen_asm_stdout $abi aes/asm/aesni-sha1-x86_64.pl aes/aesni-sha1-$abi-x86_64.S |
228 | gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl crypto/bn/modexp512-$abi-x86_64.S | 257 | gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl bn/modexp512-$abi-x86_64.S |
229 | gen_asm_stdout $abi bn/asm/x86_64-mont.pl crypto/bn/mont-$abi-x86_64.S | 258 | gen_asm_stdout $abi bn/asm/x86_64-mont.pl bn/mont-$abi-x86_64.S |
230 | gen_asm_stdout $abi bn/asm/x86_64-mont5.pl crypto/bn/mont5-$abi-x86_64.S | 259 | gen_asm_stdout $abi bn/asm/x86_64-mont5.pl bn/mont5-$abi-x86_64.S |
231 | gen_asm_stdout $abi bn/asm/x86_64-gf2m.pl crypto/bn/gf2m-$abi-x86_64.S | 260 | gen_asm_stdout $abi bn/asm/x86_64-gf2m.pl bn/gf2m-$abi-x86_64.S |
232 | gen_asm_stdout $abi camellia/asm/cmll-x86_64.pl crypto/camellia/cmll-$abi-x86_64.S | 261 | gen_asm_stdout $abi camellia/asm/cmll-x86_64.pl camellia/cmll-$abi-x86_64.S |
233 | gen_asm_stdout $abi md5/asm/md5-x86_64.pl crypto/md5/md5-$abi-x86_64.S | 262 | gen_asm_stdout $abi md5/asm/md5-x86_64.pl md5/md5-$abi-x86_64.S |
234 | gen_asm_stdout $abi modes/asm/ghash-x86_64.pl crypto/modes/ghash-$abi-x86_64.S | 263 | gen_asm_stdout $abi modes/asm/ghash-x86_64.pl modes/ghash-$abi-x86_64.S |
235 | gen_asm_stdout $abi rc4/asm/rc4-x86_64.pl crypto/rc4/rc4-$abi-x86_64.S | 264 | gen_asm_stdout $abi rc4/asm/rc4-x86_64.pl rc4/rc4-$abi-x86_64.S |
236 | gen_asm_stdout $abi rc4/asm/rc4-md5-x86_64.pl crypto/rc4/rc4-md5-$abi-x86_64.S | 265 | gen_asm_stdout $abi rc4/asm/rc4-md5-x86_64.pl rc4/rc4-md5-$abi-x86_64.S |
237 | gen_asm_stdout $abi sha/asm/sha1-x86_64.pl crypto/sha/sha1-$abi-x86_64.S | 266 | gen_asm_stdout $abi sha/asm/sha1-x86_64.pl sha/sha1-$abi-x86_64.S |
238 | gen_asm $abi sha/asm/sha512-x86_64.pl crypto/sha/sha256-$abi-x86_64.S | 267 | gen_asm $abi sha/asm/sha512-x86_64.pl sha/sha256-$abi-x86_64.S |
239 | gen_asm $abi sha/asm/sha512-x86_64.pl crypto/sha/sha512-$abi-x86_64.S | 268 | gen_asm $abi sha/asm/sha512-x86_64.pl sha/sha512-$abi-x86_64.S |
240 | gen_asm_stdout $abi whrlpool/asm/wp-x86_64.pl crypto/whrlpool/wp-$abi-x86_64.S | 269 | gen_asm_stdout $abi whrlpool/asm/wp-x86_64.pl whrlpool/wp-$abi-x86_64.S |
241 | gen_asm $abi x86_64cpuid.pl crypto/cpuid-$abi-x86_64.S | 270 | gen_asm $abi x86_64cpuid.pl cpuid-$abi-x86_64.S |
242 | done | 271 | done |
243 | 272 | ||
244 | # copy libtls source | 273 | # copy libtls source |