[gccsdk] GCC4: Advise using -static for linking

Graham Shaw gdshaw at sagitta.demon.co.uk
Sat Jan 13 00:18:27 PST 2007


In article <0f8530a34e.ajw498 at caramel.cp15.org>,
   Alex Waugh <alex at alexwaugh.com> wrote:
> Peter Naulls <peter at chocky.org> wrote:

> > Great.  At this time, can we review the plan for packaging/distributing
> > shared libraries.  Alan B. has some views on this with regards to
> > developement libraries that he's keen to get going with, which is the
> > other side of the coin.

> I've listed below what I'd like to see as the requirements. Are there
> any others that need adding?

> Cross compiling works out of the box with the normal libtool based
> flows.

> Applications can dlopen shared objects from a specific location, e.g.
> their own application directory.

> 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.

(Before anyone quotes the !System directory as a counterexample, please
note that third party modules were never actually supposed to be placed
there according to the PRM - although I would obviously have to
acknowledge that many are in practice.)

The main difficulty with this approach is ensuring that programs can still
be installed and used without a package manager.  There are several ways
this could be addressed:

(1) Have programs look for a library first via a path variable specific to
the library, then in a central location.

(2) Put all libraries in an application directory (analogous to !System)
which scans them in some way and sets up appropriate path variables.

(3) Put all library application directories in the !Boot Resources
directory.

(4) Put all library application directories in another application
directory which ensures they are booted.

I don't know what the best answer is, but as far as possible I think it
would be desirable to avoid building assumptions about disc layout into
either the libraries themselves or the programs that use them.

-- 
Graham Shaw (http://www.sagitta.demon.co.uk/graham/)
The RISC OS Packaging Project (http://www.riscpkg.org/)
The RISC OS Toolkit (http://rtk.riscos.org.uk/)




More information about the gcc mailing list