libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool on OS/390?


From: Howard Chu
Subject: libtool on OS/390?
Date: Fri, 25 Apr 2003 06:46:32 -0700

Has anyone worked on adding shared library support for OS/390 to libtool yet?
It's coming up fast on my TODO list but I was wondering if someone has beaten
me to it. It seems that we can do a naive implementation pretty quickly - use
the EXPORTALL option, rather than requiring explicit exports of individual
symbols.

The OS/390 Unix environment is reasonably straightforward, although the
single "c89" command drives the compiler, preprocessor, *and* linker, there
aren't separate executables for each.

To use dynamic loading, both the shared library and the calling program need
to be compiled with the DLL option. In the Unix shell this is set using
"-Wc,DLL". With libtool 1.4.x you can't just add this to the CFLAGS; libtool
is too "smart" and turns this into just "DLL" when it invokes c89, which
doesn't work. Likewise libtool turns "-Wl,foo" into just "foo" when it
invokes c89 for linking, which also doesn't work. libtool needs to leave
these options exactly as specified, with the "-W" prefix intact.

The -Wl,DLL option is used during linking to produce a shared library. This
link produces the specified output file and a "linker side deck" containing
import statements for other apps to link against. The side deck has the
output file's name with a ".x" suffix appended. This side deck is
conceptually the same as an import library used by other platforms.

That's all there is to it, really.

For libltdl, OS/390 provides 4 basic functions - dllload() and dllfree(),
equivalent to SVR4 dlopen() and dlclose(), respectively, and dllqueryfn() and
dllqueryvar() for looking up functions and variables. For the purposes of
libltdl, I would use both in lt_dlsym, trying the function first.

By the way, I referred to libtool 1.4.x up above because the packages I'm
porting all come with that. (Berkeley DB 4.1.25, Cyrus-SASL 2.1.13, OpenLDAP
2.X.) If libtool 1.5 is less intrusive in its option handling, I may take a
run at adapting it but it's very unlikely that my changes will be adopted by
the respective package maintainers any time soon. I need to get current
versions of software working in their current form, I can't spearhead their
migration to the newer libtool.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support





reply via email to

[Prev in Thread] Current Thread [Next in Thread]