summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-10 02:25:18 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-10 02:25:18 +0000
commitbf2e3ac433f9366e189557947548a3e5c3f40c7e (patch)
treee1eff888a512e749bc358463a452823351f13ed7 /dev-libs/openssl
parent$Header: $ fixes (diff)
downloadgentoo-2-bf2e3ac433f9366e189557947548a3e5c3f40c7e.tar.gz
gentoo-2-bf2e3ac433f9366e189557947548a3e5c3f40c7e.tar.bz2
gentoo-2-bf2e3ac433f9366e189557947548a3e5c3f40c7e.zip
Some misc pointer/asm fixes from upstream.
(Portage version: 2.0.51.21-r1)
Diffstat (limited to 'dev-libs/openssl')
-rw-r--r--dev-libs/openssl/ChangeLog10
-rw-r--r--dev-libs/openssl/files/openssl-0.9.7e-ptr-casting.patch13
-rw-r--r--dev-libs/openssl/files/openssl-0.9.7e-x86_64-bn-asm.patch111
-rw-r--r--dev-libs/openssl/files/openssl-0.9.7g-mem-clr-ptr-cast.patch19
-rw-r--r--dev-libs/openssl/files/openssl-0.9.7g-ptr-casting.patch18
-rw-r--r--dev-libs/openssl/openssl-0.9.7e-r1.ebuild23
-rw-r--r--dev-libs/openssl/openssl-0.9.7g.ebuild4
7 files changed, 186 insertions, 12 deletions
diff --git a/dev-libs/openssl/ChangeLog b/dev-libs/openssl/ChangeLog
index df9d8665b454..bb8f72d95aad 100644
--- a/dev-libs/openssl/ChangeLog
+++ b/dev-libs/openssl/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-libs/openssl
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/ChangeLog,v 1.113 2005/05/09 06:38:59 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/ChangeLog,v 1.114 2005/05/10 02:25:18 vapier Exp $
+
+ 10 May 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/openssl-0.9.7e-ptr-casting.patch,
+ +files/openssl-0.9.7e-x86_64-bn-asm.patch,
+ +files/openssl-0.9.7g-mem-clr-ptr-cast.patch,
+ +files/openssl-0.9.7g-ptr-casting.patch, openssl-0.9.7e-r1.ebuild,
+ openssl-0.9.7g.ebuild:
+ Some misc pointer/asm fixes from upstream.
09 May 2005; Mike Frysinger <vapier@gentoo.org>
+files/gentoo.config-0.9.7g, openssl-0.9.7g.ebuild:
diff --git a/dev-libs/openssl/files/openssl-0.9.7e-ptr-casting.patch b/dev-libs/openssl/files/openssl-0.9.7e-ptr-casting.patch
new file mode 100644
index 000000000000..248f91a13226
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-0.9.7e-ptr-casting.patch
@@ -0,0 +1,13 @@
+Make sure when we cast as a pointer we don't truncate.
+
+Patch by Daniel Gryniewicz.
+
+--- ssl/ssltest.c
++++ ssl/ssltest.c
+@@ -1541,4 +1541,4 @@
+ fprintf(stderr, "Arg is: %s\n", (char *)arg);
+- fprintf(stderr, "Finished printing do we have a context? 0x%x a cert? 0x%x\n",
+- (unsigned int)ctx, (unsigned int)ctx->cert);
++ fprintf(stderr, "Finished printing do we have a context? 0x%p a cert? 0x%p\n",
++ ctx, ctx->cert);
+ if (ctx->cert)
diff --git a/dev-libs/openssl/files/openssl-0.9.7e-x86_64-bn-asm.patch b/dev-libs/openssl/files/openssl-0.9.7e-x86_64-bn-asm.patch
new file mode 100644
index 000000000000..f21af9d9942a
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-0.9.7e-x86_64-bn-asm.patch
@@ -0,0 +1,111 @@
+Index: crypto/bn/asm/x86_64-gcc.c
+===================================================================
+RCS file: /usr/local/src/openssl/cvs-tree/openssl/crypto/bn/asm/x86_64-gcc.c,v
+retrieving revision 1.1
+retrieving revision 1.3
+diff -u -r1.1 -r1.3
+--- crypto/bn/asm/x86_64-gcc.c 14 Dec 2002 20:42:01 -0000 1.1
++++ crypto/bn/asm/x86_64-gcc.c 28 May 2004 10:15:58 -0000 1.3
+@@ -13,20 +13,42 @@
+ * A. Well, that's because this code is basically a quick-n-dirty
+ * proof-of-concept hack. As you can see it's implemented with
+ * inline assembler, which means that you're bound to GCC and that
+- * there must be a room for fine-tuning.
++ * there might be enough room for further improvement.
+ *
+ * Q. Why inline assembler?
+- * A. x86_64 features own ABI I'm not familiar with. Which is why
+- * I decided to let the compiler take care of subroutine
+- * prologue/epilogue as well as register allocation.
++ * A. x86_64 features own ABI which I'm not familiar with. This is
++ * why I decided to let the compiler take care of subroutine
++ * prologue/epilogue as well as register allocation. For reference.
++ * Win64 implements different ABI for AMD64, different from Linux.
+ *
+ * Q. How much faster does it get?
+- * A. Unfortunately people sitting on x86_64 hardware are prohibited
+- * to disclose the performance numbers, so they (SuSE labs to be
+- * specific) wouldn't tell me. However! Very similar coding technique
+- * (reaching out for 128-bit result from 64x64-bit multiplication)
+- * results in >3 times performance improvement on MIPS and I see no
+- * reason why gain on x86_64 would be so much different:-)
++ * A. 'apps/openssl speed rsa dsa' output with no-asm:
++ *
++ * sign verify sign/s verify/s
++ * rsa 512 bits 0.0006s 0.0001s 1683.8 18456.2
++ * rsa 1024 bits 0.0028s 0.0002s 356.0 6407.0
++ * rsa 2048 bits 0.0172s 0.0005s 58.0 1957.8
++ * rsa 4096 bits 0.1155s 0.0018s 8.7 555.6
++ * sign verify sign/s verify/s
++ * dsa 512 bits 0.0005s 0.0006s 2100.8 1768.3
++ * dsa 1024 bits 0.0014s 0.0018s 692.3 559.2
++ * dsa 2048 bits 0.0049s 0.0061s 204.7 165.0
++ *
++ * 'apps/openssl speed rsa dsa' output with this module:
++ *
++ * sign verify sign/s verify/s
++ * rsa 512 bits 0.0004s 0.0000s 2767.1 33297.9
++ * rsa 1024 bits 0.0012s 0.0001s 867.4 14674.7
++ * rsa 2048 bits 0.0061s 0.0002s 164.0 5270.0
++ * rsa 4096 bits 0.0384s 0.0006s 26.1 1650.8
++ * sign verify sign/s verify/s
++ * dsa 512 bits 0.0002s 0.0003s 4442.2 3786.3
++ * dsa 1024 bits 0.0005s 0.0007s 1835.1 1497.4
++ * dsa 2048 bits 0.0016s 0.0020s 620.4 504.6
++ *
++ * For the reference. IA-32 assembler implementation performs
++ * very much like 64-bit code compiled with no-asm on the same
++ * machine.
+ */
+
+ #define BN_ULONG unsigned long
+@@ -151,7 +173,7 @@
+ }
+
+ BN_ULONG bn_add_words (BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,int n)
+-{ BN_ULONG ret,i;
++{ BN_ULONG ret=0,i=0;
+
+ if (n <= 0) return 0;
+
+@@ -174,7 +196,7 @@
+
+ #ifndef SIMICS
+ BN_ULONG bn_sub_words (BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,int n)
+-{ BN_ULONG ret,i;
++{ BN_ULONG ret=0,i=0;
+
+ if (n <= 0) return 0;
+
+@@ -318,7 +340,6 @@
+
+ void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
+ {
+- BN_ULONG bl,bh;
+ BN_ULONG t1,t2;
+ BN_ULONG c1,c2,c3;
+
+@@ -423,7 +444,6 @@
+
+ void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
+ {
+- BN_ULONG bl,bh;
+ BN_ULONG t1,t2;
+ BN_ULONG c1,c2,c3;
+
+@@ -464,7 +484,6 @@
+
+ void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
+ {
+- BN_ULONG bl,bh;
+ BN_ULONG t1,t2;
+ BN_ULONG c1,c2,c3;
+
+@@ -541,7 +560,6 @@
+
+ void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
+ {
+- BN_ULONG bl,bh;
+ BN_ULONG t1,t2;
+ BN_ULONG c1,c2,c3;
+
diff --git a/dev-libs/openssl/files/openssl-0.9.7g-mem-clr-ptr-cast.patch b/dev-libs/openssl/files/openssl-0.9.7g-mem-clr-ptr-cast.patch
new file mode 100644
index 000000000000..854b32cd3309
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-0.9.7g-mem-clr-ptr-cast.patch
@@ -0,0 +1,19 @@
+Make sure when we cast as a pointer we don't truncate.
+
+Index: crypto/mem_clr.c
+===================================================================
+RCS file: /usr/local/src/openssl/cvs-tree/openssl/crypto/mem_clr.c,v
+retrieving revision 1.2
+retrieving revision 1.3
+diff -u -r1.2 -r1.3
+--- crypto/mem_clr.c 3 Dec 2002 16:06:40 -0000 1.2
++++ crypto/mem_clr.c 29 Apr 2005 14:26:59 -0000 1.3
+@@ -68,7 +68,7 @@
+ while(loop--)
+ {
+ *(p++) = cleanse_ctr;
+- cleanse_ctr += (17 + (unsigned char)((int)p & 0xF));
++ cleanse_ctr += (17 + (unsigned char)((unsigned long)p & 0xF));
+ }
+ if(memchr(ptr, cleanse_ctr, len))
+ cleanse_ctr += 63;
diff --git a/dev-libs/openssl/files/openssl-0.9.7g-ptr-casting.patch b/dev-libs/openssl/files/openssl-0.9.7g-ptr-casting.patch
new file mode 100644
index 000000000000..11c9b6c913e4
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-0.9.7g-ptr-casting.patch
@@ -0,0 +1,18 @@
+Make sure when we cast as a pointer we don't truncate.
+
+Patch by Daniel Gryniewicz.
+
+Index: ssl/ssltest.c
+===================================================================
+RCS file: /usr/local/src/openssl/cvs-tree/openssl/ssl/ssltest.c,v
+retrieving revision 1.91
+diff -u -U1 -r1.91 ssltest.c
+--- ssl/ssltest.c 9 Apr 2005 16:07:11 -0000 1.91
++++ ssl/ssltest.c 10 May 2005 02:07:38 -0000
+@@ -1988,4 +1988,4 @@
+ fprintf(stderr, "Arg is: %s\n", cb_arg->string);
+- fprintf(stderr, "Finished printing do we have a context? 0x%x a cert? 0x%x\n",
+- (unsigned int)ctx, (unsigned int)ctx->cert);
++ fprintf(stderr, "Finished printing do we have a context? 0x%p a cert? 0x%p\n",
++ ctx, ctx->cert);
+ if (ctx->cert)
diff --git a/dev-libs/openssl/openssl-0.9.7e-r1.ebuild b/dev-libs/openssl/openssl-0.9.7e-r1.ebuild
index aea790679320..7da1aef95520 100644
--- a/dev-libs/openssl/openssl-0.9.7e-r1.ebuild
+++ b/dev-libs/openssl/openssl-0.9.7e-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.7e-r1.ebuild,v 1.10 2005/05/02 17:54:37 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.7e-r1.ebuild,v 1.11 2005/05/10 02:25:18 vapier Exp $
inherit eutils flag-o-matic toolchain-funcs
@@ -30,13 +30,16 @@ src_unpack() {
# openssl-0.9.7
cd ${WORKDIR}/${P}
- epatch ${FILESDIR}/${PN}-0.9.7c-tempfile.patch
- [[ $(tc-arch) == "ppc64" ]] && epatch ${FILESDIR}/addppc64support.diff
- epatch ${FILESDIR}/${PN}-0.9.7e-gentoo.patch
- epatch ${FILESDIR}/${PN}-0.9.7-arm-big-endian.patch
- epatch ${FILESDIR}/${PN}-0.9.7-hppa-fix-detection.patch
- epatch ${FILESDIR}/${PN}-0.9.7-alpha-default-gcc.patch
- epatch ${FILESDIR}/${PN}-0.9.7e-no-fips.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7c-tempfile.patch
+ [[ $(tc-arch) == "ppc64" ]] && epatch "${FILESDIR}"/addppc64support.diff
+ epatch "${FILESDIR}"/${PN}-0.9.7e-gentoo.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7-arm-big-endian.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7-hppa-fix-detection.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7-alpha-default-gcc.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7e-no-fips.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7e-ptr-casting.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7g-mem-clr-ptr-cast.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7e-x86_64-bn-asm.patch
case $(gcc-version) in
3.2)
@@ -84,11 +87,11 @@ src_unpack() {
test -f ${ROOT}/usr/lib/libssl.so.0.9.6 && {
cd ${WORKDIR}/${OLD_096_P}
- epatch ${FILESDIR}/${OLD_096_P}-gentoo.diff
+ epatch "${FILESDIR}"/${OLD_096_P}-gentoo.diff
case ${ARCH} in
mips)
- epatch ${FILESDIR}/openssl-0.9.6-mips.diff
+ epatch "${FILESDIR}"/openssl-0.9.6-mips.diff
;;
arm)
# patch linker to add -ldl or things linking aginst libcrypto fail
diff --git a/dev-libs/openssl/openssl-0.9.7g.ebuild b/dev-libs/openssl/openssl-0.9.7g.ebuild
index a5e6edad9e99..1050af44b1e6 100644
--- a/dev-libs/openssl/openssl-0.9.7g.ebuild
+++ b/dev-libs/openssl/openssl-0.9.7g.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.7g.ebuild,v 1.2 2005/05/09 06:38:59 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.7g.ebuild,v 1.3 2005/05/10 02:25:18 vapier Exp $
inherit eutils flag-o-matic toolchain-funcs
@@ -28,6 +28,8 @@ src_unpack() {
epatch "${FILESDIR}"/${PN}-0.9.7-hppa-fix-detection.patch
epatch "${FILESDIR}"/${PN}-0.9.7-alpha-default-gcc.patch
epatch "${FILESDIR}"/${PN}-0.9.7g-no-fips.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7g-ptr-casting.patch
+ epatch "${FILESDIR}"/${PN}-0.9.7g-mem-clr-ptr-cast.patch
# allow openssl to be cross-compiled
cp "${FILESDIR}"/gentoo.config-0.9.7g gentoo.config || die "cp cross-compile failed"