zsh-workers
 help / color / mirror / code / Atom feed
* Dynamic loading under Cygwin
@ 2000-07-19 12:09 Andrej Borsenkow
  0 siblings, 0 replies; only message in thread
From: Andrej Borsenkow @ 2000-07-19 12:09 UTC (permalink / raw)
  To: ZSH workers mailing list

It looks pretty doable. To do it we need

1. make sure, that symbols get `dllexport' in module source and
`dllimport' everywhere else

2. compile dll and stub library

3. link against stub library

(there may be one more point - I do not know, if Cygwin supports
LD_RUN_PATH or equiv. We may need to install DLLs into $bindir instead
of $libdir).

So

1. It is easy enough. Just let *.mdh files redefine mod_export as
`__declspec(dllimport)' if IMPORTING_MODULE_* is defined and
`__declspec(dllexport)' otherweise. The files are automatically
generated so it needs change in one place only. (It may conflict with
current usage of mod_export - but it shouldn't be so hard to solve).
There may be problems, if Cygwin does not allow more than one
declaration with dllexport flag. This should be doable as well (we can
define dllexport at the *end* of *.mdh files after all *.epro files are
included. Then only real definitions will get dllexport flag).

2. Well, playing with dllwrap shows, that this is trivial. It does
everything in one nice pass; just specify object files and names of
output files.

3. THAT makes me uneasy. It means, that if one module depends on
another, it has to be linked with stub library for the later. Shudder.
While it is definitely possible in closed environment, it makes
stand-alone module compilation even less likely. Stub library is not
needed, if we use dlopen()/dlsym() interface (it hardly makes any
performance difference). May be, it is even possible to automate it
(thus duplicating decent run-time loader on normal OS :-) Else we
eventually should install stub libraries somewhere to be available. May
be, it is easier.

-andrej

Have a nice DOS!
B >>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-07-19 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-19 12:09 Dynamic loading under Cygwin Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).