Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!news.funet.fi!funic!santra!santra!sja From: sja@sirius.hut.fi (Sakari Jalovaara) Newsgroups: comp.windows.x.motif Subject: Re: Shared Motif libraries on RISC System/6000 Message-ID: <1991Mar23.181817.18575@santra.uucp> Date: 23 Mar 91 19:17:51 GMT References: <1991Mar22.121625.29734@santra.uucp> Sender: news@santra.uucp (Cnews - USENET news system) Organization: Helsinki University of X-nology Lines: 48 In-Reply-To: sja@sirius.hut.fi's message of 22 Mar 91 14:16:03 I wrote: > Has anyone made shared Motif 1.1.1 libraries on an IBM RS/6000? > > I don't seem to be able to make them work. If Motif programs are > linked statically they work but if any or all of Mrm, Xm or Xt are > shared libraries some programs give errors [...] Two people, Kaleb Keithley at JPL and Kee Hinckley at Alfalfa Software Inc, knew what was happening: Xm redefines VendorShell and the AIX linker put _both_ Xm's and Xt's VendorShell into programs. When an AIX shared library is created as many references inside the library are resolved as possible. If the symbol vendorShellClassRec is defined in libXt and referenced, say, from a function XtFoo() also in libXt, the "ld" run that creates the shared library resolves the reference: XtFoo() -> vendorShellClassRec Then I create the Motif library that has its own vendorShellClassRec and an XmBar() function that uses it; libXm will also contain a resolved reference to vendorShellClassRec: XmBar() -> vendorShellClassRec Finally, I link a program that uses both XtFoo() and XmBar() and the program will end up with _two_ independent "vendorShellClassRec"s: XtFoo() -> vendorShellClassRec [Xt version] XmBar() -> vendorShellClassRec [Xm version] Instand schizo zaphod mode. In reality, vendorShellClassRec is not referenced from functions but from other widget class records. I can't just pull Vendor.o out from the shared Xt (Vendor.o appears to define the only external symbols redefined by libXm) because AIX shared libraries apparently can't contain unresolved external references. If I take out Vendor.o I have to take out every other file that uses symbols defined there - and then files that need those files, etc. I tried it and ended up with three or four object files in libXt and the res non-sharable. I kludged around this by putting all of libXt (minus Vendor.o) into the shared libXm. It isn't a pretty solution but it works - and beats having a statically linked two-megabyte "periodic" demo... ++sja