Re: Loadable module support

Paul Smith <[email protected]>
Newsgroups gmane.comp.gnu.make.devel
Organization GNU's Not Unix!
Message-ID <1326658422.3482.264.camel@homebase>
On Sun, 2012-01-15 at 21:12 +0200, Eli Zaretskii wrote:
> > From: Paul Smith <[email protected]>
> > Date: Sat, 14 Jan 2012 23:22:32 -0500
> > 
> > This design is informed by the way POSIX systems work (dlopen(),
> > dlsym()).  I wonder how this would work, or not work, with alternative
> > dynamic loaders such as Windows (I assume MacOS uses POSIX semantics as
> > well)?
> 
> Windows has an API similar to `dlopen', called LoadLibrary, and an API
> similar to `dlsym', called GetProcAddress.  So it should be easy to
> have an abstract interface that will have different implementations in
> the Posix and Windows ports.

That sounds like it will work.

> Btw, are you going to use libffi for this facility?

I wasn't planning on it in the GNU make code itself, because the only
interface that we use is just to invoke an init function with a
well-known name in the loaded module.  My first inclination would be for
the init function to not take any arguments at all.  No need for FFI
here that I can see.  But obviously any loadable module could _itself_
use FFI, if necessary, to interface with some other facility and/or to
allow another facility to invoke make functions.

Even if I adopt the extra idea of passing a string argument to the setup
function, I don't know that we need FFI just to pass a single string...?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email protected]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.