This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Shared library compilation



[Much deleted]

Something is broken here, and since nobody can put their finger on a
particular piece of code being buggy, it must be a design error.

1. Code duplication, massive code duplication of the crt* stuff in
   shared libraries.
2. Inconsistent versions of the same stuff on the same system,
   consequence of problem 1.
3. Ambiguities in some situations and undefined references in others,
   consequence of problem 1.

Now I can put my finger on the design error. The error is that every shared
library is getting a copy of the C runtime and (if necessary) C++ runtime
support code, which is the code dupe that is problem 1. The solution is to
collect all the stuff being duplicated into its own shared object which is
(dynamically) linked to anything that needs it, namely all the other shared
libraries and all the programs. 
A program loads with the shared objects it uses, including the crt shared
object, which then initializes the C runtime for the program and the other
loaded shared objects, then entering the main() function, and everything is
peachy keen.

Requires changes to the linker and possibly to the C runtime objects, and
recompilation of stuff.

Consequences:

1. Code duplication goes away.
2. Painless modular upgrading: replace the crt shared object and
   everything instantly uses the new version. No inconsistent
   versions coexist. 
3. No ambiguities since only one version exists at a time on a box,
   and no undefined references since that one version does exist and
   everything knows exactly where to find it.

Or is this fix unworkable for some reason?

-- 
   .*.  "Clouds are not spheres, mountains are not cones, coastlines are not
-()  <  circles, and bark is not smooth, nor does lightning travel in a
   `*'  straight line."    -------------------------------------------------
        -- B. Mandelbrot  |http://surf.to/pgd.net
_____________________ ____|________     Paul Derbyshire     pderbysh@usa.net
Programmer & Humanist|ICQ: 10423848|