Sunday, 13 September 2015

[gccsdk] dlopen query

I have compiled Lua with GCC 4.7.4. There are two sorts of libraries
that Lua can load - those written in Lua, and those written in C
to be dynamically linked with the interpreter. Both use
environment variables to search for the libraries, namely
LUA_PATH and LUA_CPATH respectively. These are lists of
templates of filepaths. A template is just a wildcarded
filepath; the wildcard is replaced by the library name.
The user can set variables when the interpreter is compiled that
determine the directory-separator symbol ('.' for RISC OS) and
the template item-separator (',' for RISC OS) and the wildcard
('?' for RISC OS). This set up has been designed to be as portable
as possible to any system.

The libraries written in Lua load just fine, but those written in
C do not - a 'file not found' error is returned. The former are
loaded with the io C-library, which I presume has been tweaked
to understand RISC OS filenaming practices. The latter are
loaded by dlopen in the dlfcn C-library. It looks to me as if
this has not been so tweaked. Lee's remark in his post on
09/09 about using a forward slash as a prefix to the pathname
given to dlopen would seem to confirm this. I tried doing this
but no joy. If users are to be able to put the application where
they want, pathnames that have to be evaluated by RISC OS,
like MyApp:lib.so.foo, are needed. I suspect that this may be why
I am getting 'file not found' errors.

The docs talk about converting Unix filenames to RISC OS. I need the
reverse, I suspect, if dlopen is to work. Or are there flags or
system variables which when set will tell the compiler to do this?

--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment