components/openssl/openssl-1.0.0/patches/openssl-1.0.0d-t4-engine.sparc-patch
branchs11-update
changeset 2593 b92e6df5eaf0
parent 2592 a7d8d41eeab2
child 2594 27f414f634e9
equal deleted inserted replaced
2592:a7d8d41eeab2 2593:b92e6df5eaf0
     1 #
       
     2 # Engine t4 patch openssl-1.0.0d-t4-engine.sparc-patch.
       
     3 # This engine is SPARC-only.
       
     4 #
       
     5 Index: Configure
       
     6 ===================================================================
       
     7 diff -ru openssl-1.0.0d/Configure openssl-1.0.0d/Configure
       
     8 --- openssl-1.0.0d/Configure	2011-05-24 17:02:24.000000000 -0700
       
     9 +++ openssl-1.0.0d/Configure	2011-07-27 10:48:17.817470000 -0700
       
    10 @@ -134,8 +134,8 @@
       
    11  
       
    12  my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o";
       
    13  my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::void";
       
    14 -my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::void";
       
    15 -my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::void";
       
    16 +my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o t4_des.o:aes_core.o aes_cbc.o aes-sparcv9.o t4_aes.o::t4_md5.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o t4_sha1.o t4_sha2.o:::::::void";
       
    17 +my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o t4_des.o:t4_aes.o::t4_md5.o:t4_sha1.o t4_sha2.o:::::::void";
       
    18  my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::::void";
       
    19  my $mips3_asm=":bn-mips3.o::::::::::::void";
       
    20  my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o::aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::void";
       
    21 @@ -256,9 +256,9 @@
       
    22  #
       
    23  "solaris64-x86_64-cc-sunw","cc:-xO3 -m64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -lc:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR DES_PTR DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-KPIC:-m64 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign -M/usr/lib/ld/map.noexdata:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
       
    24  #
       
    25 -"solaris-sparcv9-cc-sunw","cc:-xtarget=ultra -m32 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
       
    26 +"solaris-sparcv9-cc-sunw","cc:-xtarget=ultra -m32 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc -lsoftcrypto:BN_LLONG RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
       
    27  #
       
    28 -"solaris64-sparcv9-cc-sunw","cc:-xtarget=ultra -m64 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -xspace -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m64 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64",
       
    29 +"solaris64-sparcv9-cc-sunw","cc:-xtarget=ultra -m64 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -xspace -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc -lsoftcrypto:BN_LLONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m64 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64",
       
    30  # Option -xF=%all instructs the compiler to place functions and data
       
    31  # variables into separate section fragments. This enables the link editor
       
    32  # to discard unused sections and files when linking wanboot-openssl.o
       
    33 ===================================================================
       
    34 diff -ru openssl-1.0.0d/crypto/aes/ openssl-1.0.0d/crypto/aes/Makefile
       
    35 --- openssl-1.0.0d/crypto/aes/Makefile	2011-05-24 17:03:31.000000000 -0700
       
    36 +++ openssl-1.0.0d/crypto/aes/Makefile	2011-06-30 17:26:34.980110000 -0700
       
    37 @@ -17,6 +17,10 @@
       
    38  ASFLAGS= $(INCLUDES) $(ASFLAG)
       
    39  AFLAGS= $(ASFLAGS)
       
    40  
       
    41 +BITS:=	$(shell if grep '^SHARED_LDFLAGS.*=.*-m32' ../../Makefile >/dev/null; \
       
    42 +		then echo 32; else echo 64; fi)
       
    43 +ASFLAGSYF= -xregsym=no -K pic -P -xarch=v9v -D_sparcv9 -D_ASM -Dsparc -m$(BITS)
       
    44 +
       
    45  GENERAL=Makefile
       
    46  #TEST=aestest.c
       
    47  TEST=
       
    48 @@ -57,6 +61,10 @@
       
    49  aes-sparcv9.s: asm/aes-sparcv9.pl
       
    50  	$(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@
       
    51  
       
    52 +t4_aes.o: asm/t4_aes.S
       
    53 +	as $(ASFLAGSYF) -o $@ asm/t4_aes.S
       
    54 +	elfedit -e 'cap:hw1 -and -cmp vis vis3' $@
       
    55 +
       
    56  aes-ppc.s:	asm/aes-ppc.pl
       
    57  	$(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@
       
    58  
       
    59 Index: crypto/des/Makefile
       
    60 ===================================================================
       
    61 diff -ru openssl-1.0.0d/crypto/des/ openssl-1.0.0d/crypto/des/Makefile
       
    62 --- openssl-1.0.0d/crypto/des/Makefile	2011-07-26 17:47:28.530315349 -0700
       
    63 +++ openssl-1.0.0d/crypto/des/Makefile	2011-07-27 10:41:47.362058958 -0700
       
    64 @@ -17,6 +17,10 @@
       
    65  ASFLAGS= $(INCLUDES) $(ASFLAG)
       
    66  AFLAGS= $(ASFLAGS)
       
    67  
       
    68 +BITS:=	$(shell if grep '^SHARED_LDFLAGS.*=.*-m32' ../../Makefile >/dev/null; \
       
    69 +		then echo 32; else echo 64; fi)
       
    70 +ASFLAGSYF= -xregsym=no -K pic -P -xarch=v9v -D_sparcv9 -D_ASM -Dsparc -m$(BITS)
       
    71 +
       
    72  GENERAL=Makefile
       
    73  TEST=destest.c
       
    74  APPS=
       
    75 @@ -61,6 +65,10 @@
       
    76  
       
    77  des_enc-sparc.S:	asm/des_enc.m4
       
    78  	m4 -B 8192 asm/des_enc.m4 > des_enc-sparc.S
       
    79 + 
       
    80 +t4_des.o: asm/t4_des.S
       
    81 +	as $(ASFLAGSYF) -o $@ asm/t4_des.S
       
    82 +	elfedit -e 'cap:hw1 -and -cmp vis vis3' $@
       
    83  
       
    84  des-586.s:	asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
       
    85  	$(PERL) asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
       
    86 Index: crypto/engine/Makefile
       
    87 ===================================================================
       
    88 diff -ru openssl-1.0.0d/crypto/engine/Makefile openssl-1.0.0d/crypto/engine/Makefile
       
    89 --- openssl-1.0.0d/crypto/engine/Makefile	2011-05-24 17:04:12.000000000 -0700
       
    90 +++ openssl-1.0.0d/crypto/engine/Makefile	2011-07-28 10:10:00.000000000 -0700
       
    91 @@ -22,12 +22,16 @@
       
    92  	tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c \
       
    93  	tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c \
       
    94  	eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c \
       
    95 +	eng_t4.c eng_t4_des.c eng_t4_md5.c \
       
    96 +	eng_t4_sha1.c eng_t4_sha256.c eng_t4_sha512.c eng_t4_montmul.c \
       
    97  	hw_pk11.c hw_pk11_pub.c hw_pk11_uri.c
       
    98  LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \
       
    99  	eng_table.o eng_pkey.o eng_fat.o eng_all.o \
       
   100  	tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o \
       
   101  	tb_cipher.o tb_digest.o tb_pkmeth.o tb_asnmth.o \
       
   102  	eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o \
       
   103 +	eng_t4.o eng_t4_des.o eng_t4_md5.o \
       
   104 +	eng_t4_sha1.o eng_t4_sha256.o eng_t4_sha512.o eng_t4_montmul.o \
       
   105  	hw_pk11.o hw_pk11_pub.o hw_pk11_uri.o
       
   106  
       
   107  SRC= $(LIBSRC)
       
   108 Index: crypto/engine/eng_all.c
       
   109 ===================================================================
       
   110 diff -ru openssl-1.0.0d/crypto/engine/eng_all.c openssl-1.0.0d/crypto/engine/eng_all.c
       
   111 --- openssl-1.0.0d/crypto/engine/eng_all.c	2011-05-24 17:02:20.000000000 -0700
       
   112 +++ openssl-1.0.0d/crypto/engine/eng_all.c	2011-06-22 17:34:25.145829355 -0700
       
   113 @@ -61,6 +61,8 @@
       
   114  
       
   115  void ENGINE_load_builtin_engines(void)
       
   116  	{
       
   117 +	/* Engines may depend on CPU capabilities */
       
   118 +	OPENSSL_cpuid_setup();
       
   119  #if 0
       
   120  	/* There's no longer any need for an "openssl" ENGINE unless, one day,
       
   121  	 * it is the *only* way for standard builtin implementations to be be
       
   122 @@ -71,6 +73,10 @@
       
   123  #if !defined(OPENSSL_NO_HW) && (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV))
       
   124  	ENGINE_load_cryptodev();
       
   125  #endif
       
   126 +#if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_T4)
       
   127 +	ENGINE_load_t4();
       
   128 +	ENGINE_register_all_complete();
       
   129 +#endif
       
   130  	ENGINE_load_dynamic();
       
   131  #ifndef OPENSSL_NO_HW_PKCS11
       
   132  	ENGINE_load_pk11();
       
   133 Index: crypto/engine/engine.h
       
   134 ==================================================================
       
   135 diff -ru openssl-1.0.0d/crypto/engine/engine.h openssl-1.0.0d/crypto/engine/engine.h
       
   136 --- openssl-1.0.0d/crypto/engine/engine.h	2011-05-24 17:02:20.000000000 -0700
       
   137 +++ openssl-1.0.0d/crypto/engine/engine.h	2011-05-24 18:05:29.075766123 -0700
       
   138 @@ -344,6 +344,7 @@
       
   139  #endif
       
   140  #endif
       
   141  void ENGINE_load_cryptodev(void);
       
   142 +void ENGINE_load_t4(void);
       
   143  void ENGINE_load_pk11(void);
       
   144  void ENGINE_load_builtin_engines(void);
       
   145  
       
   146 Index: crypto/md5/Makefile
       
   147 ==================================================================
       
   148 diff -ru openssl-1.0.0d/crypto/md5/Makefile openssl-1.0.0d/crypto/md5/Makefile
       
   149 --- openssl-1.0.0d/crypto/md5/Makefile	2011-05-24 17:03:14.000000000 -0700
       
   150 +++ openssl-1.0.0d/crypto/md5/Makefile	2011-08-27 16:01:49.000000000 -0700
       
   151 @@ -17,6 +17,10 @@
       
   152  ASFLAGS= $(INCLUDES) $(ASFLAG)
       
   153  AFLAGS= $(ASFLAGS)
       
   154  
       
   155 +BITS:=	$(shell if grep '^SHARED_LDFLAGS.*=.*-m32' ../../Makefile >/dev/null; \
       
   156 +		then echo 32; else echo 64; fi)
       
   157 +ASFLAGSYF= -xregsym=no -K pic -P -xarch=v9v -D_sparcv9 -D_ASM -Dsparc -m$(BITS)
       
   158 +
       
   159  GENERAL=Makefile
       
   160  TEST=md5test.c
       
   161  APPS=
       
   162 @@ -52,6 +58,10 @@
       
   163  	$(CC) $(CFLAGS) -E asm/md5-ia64.S | \
       
   164  	$(PERL) -ne 's/;\s+/;\n/g; print;' > $@
       
   165  
       
   166 +t4_md5.o: asm/t4_md5.S
       
   167 +	as $(ASFLAGSYF) -o $@ asm/t4_md5.S
       
   168 +	elfedit -e 'cap:hw1 -and -cmp vis vis3' $@
       
   169 +
       
   170  files:
       
   171  	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
       
   172  
       
   173 Index: crypto/sha/Makefile
       
   174 ==================================================================
       
   175 diff -ru openssl-1.0.0d/crypto/sha/Makefile openssl-1.0.0d/crypto/sha/Makefile
       
   176 --- openssl-1.0.0d/crypto/sha/Makefile	2011-05-24 17:03:18.000000000 -0700
       
   177 +++ openssl-1.0.0d/crypto/sha/Makefile	2011-08-27 16:01:49.000000000 -0700
       
   178 @@ -17,6 +17,10 @@
       
   179  ASFLAGS= $(INCLUDES) $(ASFLAG)
       
   180  AFLAGS= $(ASFLAGS)
       
   181  
       
   182 +BITS:=	$(shell if grep '^SHARED_LDFLAGS.*=.*-m32' ../../Makefile >/dev/null; \
       
   183 +		then echo 32; else echo 64; fi)
       
   184 +ASFLAGSYF= -xregsym=no -K pic -P -xarch=v9v -D_sparcv9 -D_ASM -Dsparc -m$(BITS)
       
   185 +
       
   186  GENERAL=Makefile
       
   187  TEST=shatest.c sha1test.c sha256t.c sha512t.c
       
   188  APPS=
       
   189 @@ -76,6 +82,14 @@
       
   190  sha256-%.s:	asm/sha512-%.pl;	$(PERL) $< $@
       
   191  sha512-%.s:	asm/sha512-%.pl;	$(PERL) $< $@
       
   192  
       
   193 +t4_sha1.o: asm/t4_sha1.S
       
   194 +	as $(ASFLAGSYF) -o $@ asm/t4_sha1.S
       
   195 +	elfedit -e 'cap:hw1 -and -cmp vis vis3' $@
       
   196 +
       
   197 +t4_sha2.o: asm/t4_sha2.S
       
   198 +	as $(ASFLAGSYF) -o $@ asm/t4_sha2.S
       
   199 +	elfedit -e 'cap:hw1 -and -cmp vis vis3' $@
       
   200 +
       
   201  files:
       
   202  	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
       
   203  
       
   204 Index: util/libeay.num
       
   205 ==================================================================
       
   206 diff -ru openssl-1.0.0d/util/libeay.num openssl-1.0.0d/util/libeay.num
       
   207 --- openssl-1.0.0d/util/libeay.num	2010-07-25 09:56:06.000000000 -0700
       
   208 +++ openssl-1.0.0d/util/libeay.num	2011-05-25 11:19:15.585211842 -0700
       
   209 @@ -4178,6 +4178,7 @@
       
   210  UI_method_set_prompt_constructor        4551	EXIST:!VMS:FUNCTION:
       
   211  UI_method_set_prompt_constructr         4551	EXIST:VMS:FUNCTION:
       
   212  EVP_read_pw_string_min                  4552	EXIST::FUNCTION:
       
   213 +ENGINE_load_t4                          4553	EXIST::FUNCTION:ENGINE
       
   214  CRYPTO_cts128_encrypt                   4553	EXIST::FUNCTION:
       
   215  CRYPTO_cts128_decrypt_block             4554	EXIST::FUNCTION:
       
   216  CRYPTO_cfb128_1_encrypt                 4555	EXIST::FUNCTION: