[csw-maintainers] Proposal: direct binding for all the opencsw software stack

Ben Walton bwalton at opencsw.org
Fri Aug 24 21:04:16 CEST 2012


Excerpts from Yann Rouillard's message of Tue Aug 07 16:43:08 -0400 2012:

Hi Yann,

Sorry it took me so long to get back to this...It's an interesting
topic and I think you've outlined a good solution.

> Direct Binding changes the behaviour of the linker at runtime, when
> a program or a library has a direct binding against a library, the
> linker will now link a symbol against the exact library that
> provided the symbol at compile time. That exactly solves the problem
> we have here because openssl 0.9.8 symbols will be linked against
> libssl0.9.8 and not libssl1.0.0 (and vice versaà.

I think that for 99% of our use cases this is definitely a good thing
to turn on.  In my understanding, the only place that having it on
globally (-B direct) as opposed to toggling on and off per shared
object (-z direct) is if something was relying on interposition (using
the first symbol found in the default search algorithm -> normal
runtime binding).  The only case I could think of where that would be
desirable behaviour is in something that dlopen()'s multiple
objects for a plugin system where one plugin could redefine an
interface and a second plugin could re-redefine it and so on.  It's
like that there are other cases where it _might_ be desirable
behaviour but I have to think it's by far the minority.

> So to avoid futures difficulties of the same kind, I am proposing to
> enable direct binding by default for all opencsw software !)

I think this is a good change to add.

> I don't see a lot of cons, maybe these ones:
>   - sometimes, it seems some programs do need the original linker behaviour
> but that could be fixed by some other ld options,

Yes, in those cases, either turning off direct linking or somehow
inserting the on/off toggles to only use direct linking for some
objects.

>   - we never enabled it so maybe we will uncover some problems,

>   - it works only with Sun ld (we don't use GNU ld somewhere do we
>   - ?)

I'd almost be surprised if there wasn't some package that used gnu ld
but I'm not currently aware of any.

>  1. write a checkpkg test to test if direct binding if properly enabled in
> a package,

How do you envision this check being implemented?  As a positive or
negative check?

>  2. enable Direct Binding manually for a reduced set of packages (at least
> my packages :) )
>      (we just have to pass "-Bdirect" to SUN ld)

I see you're doing this already! +1

>  3. wait a bit to see if something unexpected happens :)
>  3. if it works, enable it by globally adding the option to LINKER_FLAGS
>  4. enable the checkpkg direct binding test by default so we can catch even
> packages that don't use LDFLAGS

+1.  I think it's a sound plan.

Thanks
-Ben
--
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302



More information about the maintainers mailing list