Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 154484

Summary: dev-libs/openssl -DPURIFY support
Product: Gentoo Linux Reporter: nir tzachar <tzachar>
Component: New packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WONTFIX    
Severity: enhancement    
Priority: Lowest    
Version: 2006.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description nir tzachar 2006-11-08 09:37:38 UTC
can a use flag be added to openssl, to add support for -DPURIFY when
building openssl? 
this helps a lot when using valgrind.

a simple patch:

--- /tmp/openssl-0.9.8d.ebuild  2006-11-08 19:26:23.000000000 +0200
+++ /usr/portage/dev-libs/openssl/openssl-0.9.8d.ebuild 2006-11-08 19:28:20.000000000 +0200
@@ -11,7 +11,7 @@
 LICENSE="openssl"
 SLOT="0"
 KEYWORDS="-* alpha amd64 ~arm hppa ia64 m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
-IUSE="bindist emacs sse2 test zlib"
+IUSE="bindist emacs sse2 test zlib purify"
 
 RDEPEND=""
 DEPEND="${RDEPEND}
@@ -77,6 +77,7 @@
        fi
        use zlib && confopts="${confopts} zlib-dynamic"
        use sse2 || confopts="${confopts} no-sse2"
+       use purify && confopts="${confopts} -DPURIFY"
 
        local sslout=$(./gentoo.config)
        einfo "Use configuration ${sslout:-(openssl knows best)}"
Comment 1 SpanKY gentoo-dev 2006-11-08 12:08:52 UTC
the openssl code doesnt say what that does ... what does it do ?

besides, i see it used in *two* places to control a total of *two* lines of code; a USE flag is overkill
Comment 2 nir tzachar 2006-11-08 13:30:29 UTC
(In reply to comment #1)
> the openssl code doesnt say what that does ... what does it do ?
> 
> besides, i see it used in *two* places to control a total of *two* lines of
> code; a USE flag is overkill
> 

openssl uses uninitialized memory to gather entrpy.
this makes valgrind very angry, and makes it spew hundreds of 
false bugs.
compiling openssl using -DPURIFY makes sure openssl does not use any uninitialized memory.

as for adding a use flags, is there any other option????


Comment 3 SpanKY gentoo-dev 2006-11-08 13:57:51 UTC
CPPFLAGS=-DPURIFY emerge openssl
Comment 4 nir tzachar 2006-11-08 14:01:40 UTC
(In reply to comment #3)
> CPPFLAGS=-DPURIFY emerge openssl
> 

alas, this would not work when updating the entire system.
and i do _not_ want to add this in make.conf .
why do u object to adding a use flags?? 
it seems the cleanest way... just adding -DPURIFY to CPPFLAGS and CFLAGS can be
considered a hack which might break in the future (or break other packages)
Comment 5 SpanKY gentoo-dev 2006-11-08 14:10:02 UTC
i dont really care about the upgrading world aspect, that is Bug 44796

as i said already, adding a USE flag for changing two lines of code seems kind of weak
Comment 6 nir tzachar 2006-11-08 14:31:53 UTC
(In reply to comment #5)
> i dont really care about the upgrading world aspect, that is Bug 44796
> 
> as i said already, adding a USE flag for changing two lines of code seems kind
> of weak
> 
i agree. however, consider the following:
1) the interface of adding the purify directive might change.
2) these two lines makes working with valgrind possible. without them, 
   valgrind just throws a humongous amount of bogus errors.
3) im asking nicely ;)

as for the bug you mentioned, it is not resolved (only skimmed it). and anyway, 
see reason (1).
Comment 7 Stefan de Konink 2008-12-20 00:42:57 UTC
I would propose a debug flag; that adds this flags to the CFLAGS automatically. Purify as useflag might be not the right way, the debug flag is used in many packages and using purify is for debugging.

Please Reopen.