[gnutls-devel] Automatic library initialization

Tim Rühsen tim.ruehsen at gmx.de
Mon Nov 16 19:37:27 CET 2015


Am Montag, 16. November 2015, 19:10:02 schrieb Andrew W. Nosenko:
> On Mon, Nov 16, 2015 at 6:24 PM, Nikos Mavrogiannopoulos <nmav at gnutls.org>
> 
> wrote:
> > On Mon, Nov 16, 2015 at 4:54 PM, Tim Ruehsen <tim.ruehsen at gmx.de> wrote:
> > >> Something like the following. Have each program not wishing to use
> > >> global initialization to define a symbol which overrides a weak one
> > >> from gnutls. In practice that would mean setting:
> > >> GNUTLS_SKIP_GLOBAL_INIT
> > >> in some global section in your program. That can also be easily
> > >> backported in 3.3.x and you can check for that feature with an ifdef.
> > >> Would that be acceptable?
> > > 
> > > Brilliant idea. I'll use it for my projects... but other projects won't
> > > benefit immediately (they first have to know).
> > 
> > I'll then include it in 3.4.x and 3.3.x releases.
> 
> First at all, IMHO, _current_ API, which eliminates requirement to call
> explicitly some init function is a good.  And the "old-style API" with
> requirement to call some init function before any thread and/or child
> processes will be forked, which you want to resurrect, is a bad.
> 
> Very simple example: DSO uses some library, which have requirement to
> global init.  DSO loaded on demand.  How you meet this "global init before
> any thread forked" requirement?

I already wrote some words regarding this scenario earlier in this thread.
Please re-read.

Despite that, Nikos found a solution that doesn't touch current behavior.

Tim




More information about the Gnutls-devel mailing list