From 631bae47239d6b1e4a12a6a423f7b36bc4364bfd Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 3 Apr 2005 19:16:58 +0000 Subject: [PATCH] Extend Solaris x86 support to amd64. Note that if both gcc and Sun C are installed, it defaults to gcc, because it beats Sun C on every benchmark. Also note that gcc shared build was verified to work woth Sun C... --- Configure | 10 +++++++++ TABLE | 50 +++++++++++++++++++++++++++++++++++++++++++++ config | 11 ++++++++-- crypto/bn/Makefile | 1 + crypto/rc4/Makefile | 2 +- 5 files changed, 71 insertions(+), 3 deletions(-) diff --git a/Configure b/Configure index a83c5d406c..3b7bcb5d83 100755 --- a/Configure +++ b/Configure @@ -169,9 +169,19 @@ my %table=( # 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic" # error message. "solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +# -shared -static-libgcc might appear controversial, but modules taken +# from static libgcc do not have relocations and linking them into our +# shared objects doesn't have any negative side-effects. On the contrary, +# doing so makes it possible to use gcc shared build with Sun C. Given +# that gcc generates faster code [thanks to inline assembler], I would +# actually recommend to consider using gcc shared build even with vendor +# compiler:-) +# +"solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:asm/x86_64-gcc.o::::::asm/rc4-amd64.o:::dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### Solaris x86 with Sun C setups "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL::::::::::dlfcn:solaris-shared:-KPIC:-xarch=amd64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### SPARC Solaris with GNU C setups "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", diff --git a/TABLE b/TABLE index dda6b50159..eb5600203d 100644 --- a/TABLE +++ b/TABLE @@ -4175,6 +4175,56 @@ $shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR) $ranlib = $arflags = +*** solaris64-x86_64-cc +$cc = cc +$cflags = -fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN +$unistd = +$thread_cflag = -D_REENTRANT +$sys_id = +$lflags = -lsocket -lnsl -ldl +$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL +$bn_obj = +$des_obj = +$bf_obj = +$md5_obj = +$sha1_obj = +$cast_obj = +$rc4_obj = +$rmd160_obj = +$rc5_obj = +$dso_scheme = dlfcn +$shared_target= solaris-shared +$shared_cflag = -KPIC +$shared_ldflag = -xarch=amd64 +$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR) +$ranlib = +$arflags = + +*** solaris64-x86_64-gcc +$cc = gcc +$cflags = -m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int +$unistd = +$thread_cflag = -D_REENTRANT +$sys_id = +$lflags = -lsocket -lnsl -ldl +$bn_ops = SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL +$bn_obj = asm/x86_64-gcc.o +$des_obj = +$bf_obj = +$md5_obj = +$sha1_obj = +$cast_obj = +$rc4_obj = asm/rc4-amd64.o +$rmd160_obj = +$rc5_obj = +$dso_scheme = dlfcn +$shared_target= solaris-shared +$shared_cflag = -fPIC +$shared_ldflag = -m64 -shared -static-libgcc +$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR) +$ranlib = +$arflags = + *** sunos-gcc $cc = gcc $cflags = -O3 -mv8 -Dssize_t=int diff --git a/config b/config index d8d2ca5b67..bee3586a91 100755 --- a/config +++ b/config @@ -442,7 +442,7 @@ if [ "$SYSTEM" = "SunOS" ]; then egrep -e '^cc: .* C [0-9]\.[0-9]' | \ sed 's/.* C \([0-9]\)\.\([0-9]\).*/\1\2/'` CCVER=${CCVER:-0} - if [ $CCVER -gt 40 ]; then + if [ $MACHINE != i86pc -a $CCVER -gt 40 ]; then CC=cc # overrides gcc!!! if [ $CCVER -eq 50 ]; then echo "WARNING! Detected WorkShop C 5.0. Do make sure you have" @@ -654,7 +654,14 @@ EOF sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;; sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;; - *86*-*-solaris2) OUT="solaris-x86-$CC" ;; + *86*-*-solaris2) + ISA64=`(isalist) 2>/dev/null | grep amd64` + if [ "$ISA64" != "" ]; then + OUT="solaris64-x86_64-$CC" + else + OUT="solaris-x86-$CC" + fi + ;; *-*-sunos4) OUT="sunos-$CC" ;; alpha*-*-freebsd*) OUT="FreeBSD-alpha" ;; sparc64-*-freebsd*) OUT="FreeBSD-sparc64" ;; diff --git a/crypto/bn/Makefile b/crypto/bn/Makefile index a5ab12deb0..f693d35d87 100644 --- a/crypto/bn/Makefile +++ b/crypto/bn/Makefile @@ -118,6 +118,7 @@ asm/ia64-cpp.o: asm/ia64.S rm -f /tmp/ia64.$$$$.s asm/x86_64-gcc.o: asm/x86_64-gcc.c + $(CC) $(ASFLAGS) -c -o $@ $< asm/pa-risc2W.o: asm/pa-risc2W.s /usr/ccs/bin/as -o asm/pa-risc2W.o asm/pa-risc2W.s diff --git a/crypto/rc4/Makefile b/crypto/rc4/Makefile index b30498d925..64e06924f4 100644 --- a/crypto/rc4/Makefile +++ b/crypto/rc4/Makefile @@ -66,7 +66,7 @@ asm/rx86bsdi.o: asm/rx86unix.cpp asm/rx86unix.cpp: asm/rc4-586.pl ../perlasm/x86asm.pl (cd asm; $(PERL) rc4-586.pl cpp >rx86unix.cpp) -asm/rc4-amd64.s: asm/rc4-amd64.pl; $(PERL) $< $@ +asm/rc4-amd64.s: asm/rc4-amd64.pl; $(PERL) asm/rc4-amd64.pl $@ asm/rc4-ia64.s: asm/rc4-ia64.S $(CC) $(CFLAGS) -E asm/rc4-ia64.S > $@ -- 2.25.1