From 73d924f643be938205d434dc7ba7aa642150ba84 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 23 Mar 2023 06:07:31 -0500 Subject: fix mips/mips64 builds --- update.sh | 97 +++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 34 deletions(-) (limited to 'update.sh') diff --git a/update.sh b/update.sh index 29600a4..cac95ca 100755 --- a/update.sh +++ b/update.sh @@ -180,65 +180,94 @@ fixup_masm() { # generate assembly crypto algorithms asm_src=$libcrypto_src gen_asm_stdout() { - CC=true perl $asm_src/$2 $1 > $3.tmp - [ $1 = "elf" ] && cat <<-EOF >> $3.tmp + CC=true perl $asm_src/$2 $1 > crypto/$3.tmp + [ $1 = "elf" ] && cat <<-EOF >> crypto/$3.tmp #if defined(HAVE_GNU_STACK) .section .note.GNU-stack,"",%progbits #endif EOF if [ $1 = "masm" ]; then - fixup_masm $3.tmp $3 + fixup_masm crypto/$3.tmp crypto/$3 else - $MV $3.tmp $3 + $MV crypto/$3.tmp crypto/$3 fi } +gen_asm_mips() { + abi=$1 + dir=$2 + src=$3 + dst=$4 + CC=true perl $asm_src/$dir/asm/$src.pl $abi $dst.S + cat <<-EOF >> $dst.S + #if defined(HAVE_GNU_STACK) + .section .note.GNU-stack,"",%progbits + #endif + EOF + mv $dst.S crypto/$dir/$dst.S +} gen_asm() { - CC=true perl $asm_src/$2 $1 $3.tmp - [ $1 = "elf" ] && cat <<-EOF >> $3.tmp + CC=true perl $asm_src/$2 $1 crypto/$3.tmp + [ $1 = "elf" ] && cat <<-EOF >> crypto/$3.tmp #if defined(HAVE_GNU_STACK) .section .note.GNU-stack,"",%progbits #endif EOF if [ $1 = "masm" ]; then - fixup_masm $3.tmp $3 + fixup_masm crypto/$3.tmp crypto/$3 else - $MV $3.tmp $3 + $MV crypto/$3.tmp crypto/$3 fi } +#echo generating mips ASM source for elf +gen_asm_mips o32 aes aes-mips aes-mips +gen_asm_mips o32 bn mips bn-mips +gen_asm_mips o32 bn mips-mont mont-mips +gen_asm_mips o32 sha sha1-mips sha1-mips +gen_asm_mips o32 sha sha512-mips sha256-mips +gen_asm_mips o32 sha sha512-mips sha512-mips + +echo generating mips64 ASM source for elf +gen_asm_mips 64 aes aes-mips aes-mips64 +gen_asm_mips 64 bn mips bn-mips64 +gen_asm_mips 64 bn mips-mont mont-mips64 +gen_asm_mips 64 sha sha1-mips sha1-mips64 +gen_asm_mips 64 sha sha512-mips sha256-mips64 +gen_asm_mips 64 sha sha512-mips sha512-mips64 + echo generating arm ASM source for elf -gen_asm_stdout elf aes/asm/aes-armv4.pl crypto/aes/aes-elf-armv4.S -gen_asm_stdout elf bn/asm/armv4-gf2m.pl crypto/bn/gf2m-elf-armv4.S -gen_asm_stdout elf bn/asm/armv4-mont.pl crypto/bn/mont-elf-armv4.S -gen_asm_stdout elf sha/asm/sha1-armv4-large.pl crypto/sha/sha1-elf-armv4.S -gen_asm_stdout elf sha/asm/sha256-armv4.pl crypto/sha/sha256-elf-armv4.S -gen_asm_stdout elf sha/asm/sha512-armv4.pl crypto/sha/sha512-elf-armv4.S -gen_asm_stdout elf modes/asm/ghash-armv4.pl crypto/modes/ghash-elf-armv4.S +gen_asm_stdout elf aes/asm/aes-armv4.pl aes/aes-elf-armv4.S +gen_asm_stdout elf bn/asm/armv4-gf2m.pl bn/gf2m-elf-armv4.S +gen_asm_stdout elf bn/asm/armv4-mont.pl bn/mont-elf-armv4.S +gen_asm_stdout elf sha/asm/sha1-armv4-large.pl sha/sha1-elf-armv4.S +gen_asm_stdout elf sha/asm/sha256-armv4.pl sha/sha256-elf-armv4.S +gen_asm_stdout elf sha/asm/sha512-armv4.pl sha/sha512-elf-armv4.S +gen_asm_stdout elf modes/asm/ghash-armv4.pl modes/ghash-elf-armv4.S $CP $libcrypto_src/arch/arm/armv4cpuid.S crypto $CP $libcrypto_src/arch/arm/armcap.c crypto $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 - gen_asm_stdout $abi aes/asm/aes-x86_64.pl crypto/aes/aes-$abi-x86_64.S - gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl crypto/aes/vpaes-$abi-x86_64.S - gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl crypto/aes/bsaes-$abi-x86_64.S - gen_asm_stdout $abi aes/asm/aesni-x86_64.pl crypto/aes/aesni-$abi-x86_64.S - gen_asm_stdout $abi aes/asm/aesni-sha1-x86_64.pl crypto/aes/aesni-sha1-$abi-x86_64.S - gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl crypto/bn/modexp512-$abi-x86_64.S - gen_asm_stdout $abi bn/asm/x86_64-mont.pl crypto/bn/mont-$abi-x86_64.S - gen_asm_stdout $abi bn/asm/x86_64-mont5.pl crypto/bn/mont5-$abi-x86_64.S - gen_asm_stdout $abi bn/asm/x86_64-gf2m.pl crypto/bn/gf2m-$abi-x86_64.S - gen_asm_stdout $abi camellia/asm/cmll-x86_64.pl crypto/camellia/cmll-$abi-x86_64.S - gen_asm_stdout $abi md5/asm/md5-x86_64.pl crypto/md5/md5-$abi-x86_64.S - gen_asm_stdout $abi modes/asm/ghash-x86_64.pl crypto/modes/ghash-$abi-x86_64.S - gen_asm_stdout $abi rc4/asm/rc4-x86_64.pl crypto/rc4/rc4-$abi-x86_64.S - gen_asm_stdout $abi rc4/asm/rc4-md5-x86_64.pl crypto/rc4/rc4-md5-$abi-x86_64.S - gen_asm_stdout $abi sha/asm/sha1-x86_64.pl crypto/sha/sha1-$abi-x86_64.S - gen_asm $abi sha/asm/sha512-x86_64.pl crypto/sha/sha256-$abi-x86_64.S - gen_asm $abi sha/asm/sha512-x86_64.pl crypto/sha/sha512-$abi-x86_64.S - gen_asm_stdout $abi whrlpool/asm/wp-x86_64.pl crypto/whrlpool/wp-$abi-x86_64.S - gen_asm $abi x86_64cpuid.pl crypto/cpuid-$abi-x86_64.S + 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 + gen_asm_stdout $abi aes/asm/aesni-x86_64.pl aes/aesni-$abi-x86_64.S + gen_asm_stdout $abi aes/asm/aesni-sha1-x86_64.pl aes/aesni-sha1-$abi-x86_64.S + gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl bn/modexp512-$abi-x86_64.S + gen_asm_stdout $abi bn/asm/x86_64-mont.pl bn/mont-$abi-x86_64.S + gen_asm_stdout $abi bn/asm/x86_64-mont5.pl bn/mont5-$abi-x86_64.S + gen_asm_stdout $abi bn/asm/x86_64-gf2m.pl bn/gf2m-$abi-x86_64.S + gen_asm_stdout $abi camellia/asm/cmll-x86_64.pl camellia/cmll-$abi-x86_64.S + gen_asm_stdout $abi md5/asm/md5-x86_64.pl md5/md5-$abi-x86_64.S + gen_asm_stdout $abi modes/asm/ghash-x86_64.pl modes/ghash-$abi-x86_64.S + gen_asm_stdout $abi rc4/asm/rc4-x86_64.pl rc4/rc4-$abi-x86_64.S + gen_asm_stdout $abi rc4/asm/rc4-md5-x86_64.pl rc4/rc4-md5-$abi-x86_64.S + gen_asm_stdout $abi sha/asm/sha1-x86_64.pl sha/sha1-$abi-x86_64.S + gen_asm $abi sha/asm/sha512-x86_64.pl sha/sha256-$abi-x86_64.S + gen_asm $abi sha/asm/sha512-x86_64.pl sha/sha512-$abi-x86_64.S + gen_asm_stdout $abi whrlpool/asm/wp-x86_64.pl whrlpool/wp-$abi-x86_64.S + gen_asm $abi x86_64cpuid.pl cpuid-$abi-x86_64.S done # copy libtls source -- cgit v1.2.3-55-g6feb From 6501696dd7669b3d20d69beffc508c46f0a807da Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 23 Mar 2023 06:35:41 -0500 Subject: generate opensslconf.h for mips --- include/CMakeLists.txt | 2 ++ include/Makefile.am | 1 + include/openssl/Makefile.am.tpl | 3 +++ update.sh | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) (limited to 'update.sh') diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index a08a781..44ab86b 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -13,6 +13,8 @@ elseif(HOST_ARM) file(READ arch/arm/opensslconf.h OPENSSLCONF) elseif(HOST_I386) file(READ arch/i386/opensslconf.h OPENSSLCONF) +elseif(HOST_MIPS) + file(READ arch/mips/opensslconf.h OPENSSLCONF) elseif(HOST_MIPS64) file(READ arch/mips64/opensslconf.h OPENSSLCONF) elseif(HOST_POWERPC) diff --git a/include/Makefile.am b/include/Makefile.am index 26e82fe..077637d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -51,6 +51,7 @@ noinst_HEADERS += arch/arm/opensslconf.h noinst_HEADERS += arch/hppa/opensslconf.h noinst_HEADERS += arch/i386/opensslconf.h noinst_HEADERS += arch/m88k/opensslconf.h +noinst_HEADERS += arch/mips/opensslconf.h noinst_HEADERS += arch/mips64/opensslconf.h noinst_HEADERS += arch/powerpc/opensslconf.h noinst_HEADERS += arch/powerpc64/opensslconf.h diff --git a/include/openssl/Makefile.am.tpl b/include/openssl/Makefile.am.tpl index 2f67d10..303d0b9 100644 --- a/include/openssl/Makefile.am.tpl +++ b/include/openssl/Makefile.am.tpl @@ -17,6 +17,9 @@ endif if HOST_I386 -cp $(top_srcdir)/include/arch/i386/opensslconf.h opensslconf.h endif +if HOST_MIPS + -cp $(top_srcdir)/include/arch/mips/opensslconf.h opensslconf.h +endif if HOST_MIPS64 -cp $(top_srcdir)/include/arch/mips64/opensslconf.h opensslconf.h endif diff --git a/update.sh b/update.sh index cac95ca..15d5006 100755 --- a/update.sh +++ b/update.sh @@ -219,7 +219,7 @@ gen_asm() { fi } -#echo generating mips ASM source for elf +echo generating mips ASM source for elf gen_asm_mips o32 aes aes-mips aes-mips gen_asm_mips o32 bn mips bn-mips gen_asm_mips o32 bn mips-mont mont-mips -- cgit v1.2.3-55-g6feb