[gccsdk] GCC4: Advise using -static for linking

Alex Waugh alex at alexwaugh.com
Sun Jan 14 07:56:50 PST 2007


Graham Shaw <gdshaw at sagitta.demon.co.uk> wrote:

> In article <0f8530a34e.ajw498 at caramel.cp15.org>,
>    Alex Waugh <alex at alexwaugh.com> wrote:
> > Libraries can exist in a common location, which can be managed
> > either manually, or by RiscPkg.
> 
> That would be one way of using RiscPkg, and is the way most other
> operating systems work.
> 
> Another method would be to put each shared library (or related group of
> libraries) in its own application directory, and use RiscPkg to ensure
> that an appropriate path variable is set up at boot time.  This has two
> advantages:
> - it provides a natural home for any other resources associated with the
> library (such as message files, documentation, header files etc.)
> - it is arguably more in keeping with the "RISC OS" way of doing things.

I do like some aspects of this approach, but I'm not yet sure if it
outweighs the disadvantages.

One complication with that approach is setting that path when creating
the library. If there is a single location, then it would be easy for
the linker to substitute e.g. /home/riscos/env to SharedLibPath:, either
when creating the library or when dynamically linking it. If each
library had a different path, then that would have to be specified
somehow during the build process. I sure this can be solved, but it is
an extra complication.

This would require each library to register an allocation for an
application directory name.

What happens for 2 major versions of the same library? Do they share
the same application directory, or have two different ones?


Alex

-- 
Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/




More information about the gcc mailing list