Improved PowerPC support. Proper ./config support for ppc targets,

especially for AIX. But most important BIGNUM assembler implementation
submitted by IBM.

Submitted by: Peter Waltenberg <pwalten@au1.ibm.com>
Reviewed by: appro
This commit is contained in:
Andy Polyakov 2004-04-27 22:05:50 +00:00
parent bd1640bb01
commit dd55880644
5 changed files with 2178 additions and 66 deletions

View File

@ -390,7 +390,8 @@ my %table=(
"linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}",
"linux-mipsel", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-mips", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ppc", "gcc:-DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:asm/linux_ppc32.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:asm/linux_ppc64.o:::::::::dlfcn:linux-shared:-fPIC:-m64:.so..\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-m68k", "gcc:-DB_ENDIAN -DTERMIO -O2 -fomit-frame-pointer -Wall::-D_REENTRANT:::BN_LLONG::",
"linux-s390", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-s390x", "gcc:-DB_ENDIAN -DTERMIO -DNO_ASM -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
@ -446,11 +447,12 @@ my %table=(
# IBM's AIX.
"aix-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::",
"aix-gcc", "gcc:-O3 -DB_ENDIAN::(unknown):AIX::BN_LLONG RC4_CHAR:::",
"aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:aix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::",
"aix43-gcc", "gcc:-O1 -DAIX -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR::::::::::dlfcn:",
"aix64-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384 -q64::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHAR::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
"aix-gcc", "gcc:-O -DB_ENDIAN::(unknown):AIX::BN_LLONG RC4_CHAR:asm/aix_ppc32.o:::::::::dlfcn:",
"aix43-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):::BN_LLONG RC4_CHAR:asm/aix_ppc32.o:::::::::dlfcn:aix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::",
# Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE
# at build time. $OBJECT_MODE is respected at ./config stage!
"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:asm/aix_ppc32.o:::::::::dlfcn:aix-shared::-q32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32",
"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR:asm/aix_ppc64.o:::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64",
#
# Cray T90 and similar (SDSC)
@ -553,7 +555,7 @@ my %table=(
##### MacOS X (a.k.a. Rhapsody or Darwin) setup
"rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
"darwin-ppc-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"darwin-ppc-cc","cc:-O3 -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:asm/osx_ppc32.o::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common -DB_ENDIAN::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
##### A/UX

98
TABLE
View File

@ -1027,13 +1027,13 @@ $arflags =
*** aix-cc
$cc = cc
$cflags = -O -DB_ENDIAN -qmaxmem=16384
$cflags = -q32 -O -DB_ENDIAN -qmaxmem=16384
$unistd =
$thread_cflag = (unknown)
$sys_id = AIX
$lflags =
$bn_ops = BN_LLONG RC4_CHAR
$bn_obj =
$bn_obj = asm/aix_ppc32.o
$des_obj =
$bf_obj =
$md5_obj =
@ -1042,23 +1042,23 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$shared_target=
$dso_scheme = dlfcn
$shared_target= aix-shared
$shared_cflag =
$shared_ldflag =
$shared_extension =
$shared_ldflag = -q32
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$arflags = -X 32
*** aix-gcc
$cc = gcc
$cflags = -O3 -DB_ENDIAN
$cflags = -O -DB_ENDIAN
$unistd =
$thread_cflag = (unknown)
$sys_id = AIX
$lflags =
$bn_ops = BN_LLONG RC4_CHAR
$bn_obj =
$bn_obj = asm/aix_ppc32.o
$des_obj =
$bf_obj =
$md5_obj =
@ -1067,7 +1067,7 @@ $cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme =
$dso_scheme = dlfcn
$shared_target=
$shared_cflag =
$shared_ldflag =
@ -1077,13 +1077,13 @@ $arflags =
*** aix43-cc
$cc = cc
$cflags = -O -DAIX -DB_ENDIAN -qmaxmem=16384
$cflags = -O -DB_ENDIAN -qmaxmem=16384
$unistd =
$thread_cflag = (unknown)
$sys_id =
$lflags =
$bn_ops = BN_LLONG RC4_CHAR
$bn_obj =
$bn_obj = asm/aix_ppc32.o
$des_obj =
$bf_obj =
$md5_obj =
@ -1100,40 +1100,15 @@ $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
*** aix43-gcc
$cc = gcc
$cflags = -O1 -DAIX -DB_ENDIAN
$unistd =
$thread_cflag = (unknown)
$sys_id =
$lflags =
$bn_ops = BN_LLONG RC4_CHAR
$bn_obj =
$des_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target=
$shared_cflag =
$shared_ldflag =
$shared_extension =
$ranlib =
$arflags =
*** aix64-cc
$cc = cc
$cflags = -O -DAIX -DB_ENDIAN -qmaxmem=16384 -q64
$cflags = -q64 -O -DB_ENDIAN -qmaxmem=16384
$unistd =
$thread_cflag = (unknown)
$sys_id =
$sys_id = AIX
$lflags =
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR
$bn_obj =
$bn_obj = asm/aix_ppc64.o
$des_obj =
$bf_obj =
$md5_obj =
@ -1452,13 +1427,13 @@ $arflags =
*** darwin-ppc-cc
$cc = cc
$cflags = -O3 -fomit-frame-pointer -fno-common -DB_ENDIAN
$cflags = -O3 -fno-common -DB_ENDIAN
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id = MACOSX
$lflags =
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
$bn_obj =
$bn_obj = asm/osx_ppc32.o
$des_obj =
$bf_obj =
$md5_obj =
@ -1702,7 +1677,7 @@ $arflags =
*** debug-levitte-linux-elf
$cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
@ -1727,7 +1702,7 @@ $arflags =
*** debug-levitte-linux-elf-extreme
$cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
@ -1752,7 +1727,7 @@ $arflags =
*** debug-levitte-linux-noasm
$cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
@ -1777,7 +1752,7 @@ $arflags =
*** debug-levitte-linux-noasm-extreme
$cc = gcc
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$cflags = -DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
@ -3127,7 +3102,7 @@ $arflags =
*** linux-ia32-icc
$cc = icc
$cflags = -DL_ENDIAN -DTERMIO -O2
$cflags = -DL_ENDIAN -DTERMIO -O2 -no_cpprt
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
@ -3352,13 +3327,13 @@ $arflags =
*** linux-ppc
$cc = gcc
$cflags = -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall
$cflags = -DB_ENDIAN -DTERMIO -O3 -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL
$bn_obj =
$bn_obj = asm/linux_ppc32.o
$des_obj =
$bf_obj =
$md5_obj =
@ -3375,6 +3350,31 @@ $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
*** linux-ppc64
$cc = gcc
$cflags = -m64 -DB_ENDIAN -DTERMIO -O3 -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL
$bn_obj = asm/linux_ppc64.o
$des_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag = -m64
$shared_extension = .so..$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
*** linux-ppro
$cc = gcc
$cflags = -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -mcpu=pentiumpro -Wall

42
config
View File

@ -110,12 +110,8 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
echo "m68k-apple-aux3"; exit 0
;;
AIX:[3456789]:4:*)
echo "${MACHINE}-ibm-aix43"; exit 0
;;
AIX:*:[56789]:*)
echo "${MACHINE}-ibm-aix43"; exit 0
AIX:*:[5-9]:*)
echo "${MACHINE}-ibm-aix5"; exit 0
;;
AIX:*)
@ -537,10 +533,7 @@ EOF
${CC} -o dummy dummy.c && OUT=`./dummy ${MACHINE}`
rm dummy dummy.c
;;
ppc64-*-linux2)
#Use the standard target for PPC architecture until we create a
#special one for the 64bit architecture.
OUT="linux-ppc" ;;
ppc64-*-linux2) OUT="linux-ppc64" ;;
ppc-*-linux2) OUT="linux-ppc" ;;
m68k-*-linux*) OUT="linux-m68k" ;;
ia64-*-linux?) OUT="linux-ia64" ;;
@ -719,6 +712,35 @@ EOF
fi
options="$options -D_REENTRANT" ;;
*-hpux) OUT="hpux-parisc-$CC" ;;
*-aix5)
KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null`
KERNEL_BITS=${KERNEL_BITS:-32}
if [ $KERNEL_BITS -eq 64 ]; then
# we default to 64-bit because PKI performance is >3x better...
OBJECT_MODE=${OBJECT_MODE:-$KERNEL_BITS}
else
OBJECT_MODE=32
fi
OUT="aix-cc"
if [ "$CC" = "cc" -a $OBJECT_MODE -eq 64 ]; then
OUT="aix64-cc"
echo "WARNING! If you wish to build 32-bit kit, then you have to"
echo " invoke './Configure aix-cc' *manually*."
if [ "$TEST" = "false" ]; then
echo " You have ~5 seconds to press Ctrl-C to abort."
(stty -icanon min 0 time 50; read waste) < /dev/tty
fi
elif [ "$CC" = "gcc ]; then
OUT="aix-gcc"
fi
;;
*-aix)
if [ "$CC" = "gcc" ]; then
OUT="aix-gcc"
else
OUT="aix43-cc"
fi
;;
# these are all covered by the catchall below
# *-aix) OUT="aix-$CC" ;;
# *-dgux) OUT="dgux" ;;

View File

@ -129,6 +129,13 @@ asm/pa-risc2W.o: asm/pa-risc2W.s
asm/pa-risc2.o: asm/pa-risc2.s
/usr/ccs/bin/as -o asm/pa-risc2.o asm/pa-risc2.s
# ppc - AIX, Linux, MacOS X...
asm/linux_ppc32.s: asm/ppc.pl; $(PERL) $< $@
asm/linux_ppc64.s: asm/ppc.pl; $(PERL) $< $@
asm/aix_ppc32.s: asm/ppc.pl; $(PERL) $< $@
asm/aix_ppc64.s: asm/ppc.pl; $(PERL) $< $@
asm/osx_ppc32.s: asm/ppc.pl; $(PERL) $< $@
files:
$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

2081
crypto/bn/asm/ppc.pl Normal file

File diff suppressed because it is too large Load Diff