[gccsdk] Dynamic library path handling

Peter Naulls peter at chocky.org
Sat Jul 5 19:14:03 PDT 2008

I've made a local terrible hack (but seemling robust) to include the
riscosify handling into libdl, so that it has some more sophisticated
and consistent handling than the current simplistic processing.  This is
a cut down version of the code that is used in SCL, for this specific
usage.  I'll check this in in due course.

However, my question is, what should be the behaviour for finding
libraries?   For example, I need to set:

set LD$Env "LD_WARN=1 LD_LIBRARY_PATH=/Firefox:"

And note the slightly unsatisfactory slash due to riscosify; but as a
general solution this isn't great.  !GCC sets:

GCCSOLib$Path : SharedLibs:lib

But it's not clear to me that this is used anywhere, and in any case
that is the default search path.   But a solution like this would be
fine, using the binary name as a basis, as we do for other things.

I also changed the bogus (in the case of RISC OS) "/lib" search path to
an empty string, which makes absolute paths work (or more specifically,
paths relative to a RISC OS path variable).

In my testing I also saw that errno wasn't being set from a dlopen
failure - not sure of the best way to fix this.

Finally, I see this, which I haven't investigated yet:

Text relocation of data symbol '' found: Firefox:libxlibrgb/so (offset

Which is presumably due to this library being misformed.

Peter Naulls - peter at chocky.org        | http://www.chocky.org/
RISC OS Community Wiki - add your own content   | http://www.riscos.info/

More information about the gcc mailing list