Re: [openssl.org #2795] openssl-1.0.1a - undefined symbol: OPENSSL_ia32cap_P with ultrasparc cpus (solution inside)

2012-04-27 Thread Andy Polyakov via RT
Hi,

 i got following error, when building the new openssl-1.0.1a package on a Sun 
 Solaris 10 operation system with an UltraSPARC cpu:
 
 make[3]: Entering directory `/home/df/openssl-1.0.1a'
 [ -z  ] || /opt/sunstudio/bin/cc -KPIC -DOPENSSL_PIC -DZLIB_SHARED -DZLIB 
 -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -xtarget=ultra 
 -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DOPENSSL_BN_ASM_MONT 
 -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM -Iinclude \
 -DFINGERPRINT_PREMAIN_DSO_LOAD -o fips_premain_dso  \
 fips_premain.c fipscanister.o \
 libcrypto.a -lsocket -lnsl -ldl -R/home/df/lib
 make[4]: Entering directory `/home/df/openssl-1.0.1a'
 make[5]: Entering directory `/home/df/openssl-1.0.1a'
 Undefined   first referenced
  symbol in file
 OPENSSL_ia32cap_P   libcrypto.a(e_rc4_hmac_md5.o)
 ld: warning: Symbol referencing errors
 make[5]: Leaving directory `/home/df/openssl-1.0.1a'
 make[5]: Entering directory `/home/df/openssl-1.0.1a'

Addressed in 1.0.1b release.


__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


[openssl.org #2795] openssl-1.0.1a - undefined symbol: OPENSSL_ia32cap_P with ultrasparc cpus (solution inside)

2012-04-20 Thread Daniel Flinkmann via RT
Hi,

i got following error, when building the new openssl-1.0.1a package on a Sun 
Solaris 10 operation system with an UltraSPARC cpu:

make[3]: Entering directory `/home/df/openssl-1.0.1a'
[ -z  ] || /opt/sunstudio/bin/cc -KPIC -DOPENSSL_PIC -DZLIB_SHARED -DZLIB 
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -xtarget=ultra 
-xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DOPENSSL_BN_ASM_MONT 
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DGHASH_ASM -Iinclude \
-DFINGERPRINT_PREMAIN_DSO_LOAD -o fips_premain_dso  \
fips_premain.c fipscanister.o \
libcrypto.a -lsocket -lnsl -ldl -R/home/df/lib
make[4]: Entering directory `/home/df/openssl-1.0.1a'
make[5]: Entering directory `/home/df/openssl-1.0.1a'
Undefined   first referenced
 symbol in file
OPENSSL_ia32cap_P   libcrypto.a(e_rc4_hmac_md5.o)
ld: warning: Symbol referencing errors
make[5]: Leaving directory `/home/df/openssl-1.0.1a'
make[5]: Entering directory `/home/df/openssl-1.0.1a'


I figured out that the bottom of 
openssl-1.0.1-a/crypto/evp/e_rc4_hmac_md5.c  was modified in 1.0.1a and 
utilizes the non-existing OPENSSL_ia32cap_P. 

I quickly looked into the code and made following patch: 

--- openssl-1.0.1a-Original/crypto/evp/e_rc4_hmac_md5.c  Wed Apr 18 17:51:33 
2012
+++ openssl-1.0.1a-Modified/crypto/evp/e_rc4_hmac_md5.c  Thu Apr 19 14:28:41 
2012
@@ -289,8 +289,12 @@
 
 const EVP_CIPHER *EVP_rc4_hmac_md5(void)
{
+#if defined(STITCHED_CALL)
extern unsigned int OPENSSL_ia32cap_P[];
/* RC4_CHAR flag v */
return(OPENSSL_ia32cap_P[0](120) ? NULL : r4_hmac_md5_cipher);
+#else
+   return(r4_hmac_md5_cipher);
+#endif
}
 #endif



This fixed the compilation issue on Non-Intel/AMD cpus  

Kind regards,

Daniel Flinkmann
http://www.Flinkmann.de/


-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

--- openssl-1.0.1a/crypto/evp/e_rc4_hmac_md5.c	Wed Apr 18 17:51:33 2012
+++ /tmp/e_rc4_hmac_md5.c	Thu Apr 19 14:28:41 2012
@@ -289,8 +289,12 @@
 
 const EVP_CIPHER *EVP_rc4_hmac_md5(void)
 	{
+#if defined(STITCHED_CALL)
 	extern unsigned int OPENSSL_ia32cap_P[];
 	/* RC4_CHAR flag v */
 	return(OPENSSL_ia32cap_P[0](120) ? NULL : r4_hmac_md5_cipher);
+#else
+	return(r4_hmac_md5_cipher);
+#endif
 	}
 #endif