[lsb-discuss] Best-effort dynamic linking -- take 1

Jeff Licquia jeff at licquia.org
Wed Jun 18 14:13:01 PDT 2008

I've done a somewhat naive implementation of best-effort dynamic linking 
in lsbcc.  You can see my branch here:


Just build lsbcc and use it, as normal, and your resulting binaries will 
do best-effort.

Some notes:

  - Right now, the branch just does best-effort by default, and no other 
linker options are available.  This will be fixed once we decide how we 
want to expose this option, and what the default should be.

  - Constructor priority is not available in gcc 4.1, so the order in 
which the best-effort code gets run might not be as early as we'd like. 
  We can probably do some autoconf-like stuff to figure out if 
constructor priority is supported, or just use it and say "no builds 
with old gcc", or not worry about constructor priority.  Which do we 
think we want to do?

  - The implementation is most certainly missing tests it should be 
doing, or is otherwise buggy, suboptimal, ugly, and flame-worthy.  It's 
in lsbdev-cc/besteffort.c; please review.

  - In particular, this implementation creates new dependencies on 
/proc: /proc/[pid]/cmdline, /proc/[pid]/exe, and /proc/self as an alias 
for /proc/[my-pid].  It's probably not difficult to kill the use of 
/proc/[pid]/exe, but we need some way to get to argv without the benefit 
of main() so we can pass it in the re-exec.  Ideas welcome.

More information about the lsb-discuss mailing list