[comp.windows.x.motif] Motif 1.1.2 and SunOS shlib

tsang@ISI.COM (Kam C. Tsang) (06/04/91)

[This is really for Scott Weitzenkamp.  Our mailer can't handle uunet
address.  Sorry for wasting bandwidth.]

> How hard is it to make SunOS shared libraries for Motif 1.1.2? 

Building sharable library for motif is easy.  Just compile the motif
files with the -pic flag and link the object files (ld -o libXm.so.1.1
-assert pure-text *.o) .  One complication is that in 1.1 motif has
grown to size beyond what Sparc can handle, so you need to splt the
library into two and probably call them libXm1.so.1.1 and
libXm2.so.1.1, and your applications will have to link with -lXm1
-lXm2.  You can play with your Imakefile to make it happen, but since
it's more or less a one time deal it's easier to just tweak the make
file.

> Does OSF have any plans to support this in a future release of Motif?

I don't work for OSF so I can't speak for them as far as plans to
support this.  I guess they have their worries, too, because they
probably want to do it on all platforms, and that may be a task of
reconizable size to them.  (This is just an observation, not a flame)
So, in a nutshell, the last word from OSF was that they have other
priorities and this one is not one of them.

> is there any kind of FAQ for motif-talk

If you stick around on motif-talk long enough there will be a FAQ
distributed every now and then, by Jan Newmarch
(jan@echo.canberra.edu.au) in Australia.  There's not mailing list for
this FAQ, so please don't post a message asking to be put on the list.

-kam

sydorow@bisco.kodak.com (Steve Sydorowicz) (06/04/91)

tsang@ISI.COM (Kam C. Tsang) writes:

>[This is really for Scott Weitzenkamp.  Our mailer can't handle uunet
>address.  Sorry for wasting bandwidth.]
>
>> How hard is it to make SunOS shared libraries for Motif 1.1.2?
>
>Building sharable library for motif is easy.  Just compile the motif
>files with the -pic flag and link the object files (ld -o libXm.so.1.1
>-assert pure-text *.o) .  One complication is that in 1.1 motif has
>grown to size beyond what Sparc can handle, so you need to splt the
>library into two and probably call them libXm1.so.1.1 and
>libXm2.so.1.1, and your applications will have to link with -lXm1
>-lXm2.  You can play with your Imakefile to make it happen, but since
>

To avoid the size problem, you can use "-PIC" in place of "-pic".
Sparc cc defaults the global offset table to 8K (pic). This can be increased
to allow 32 bit addresses via PIC.

Of course, using dbx on applications that link in shared libraries seems
to be somewhat of a crap shoot. Typically, you can not look into the shared
library (same as on SUN3). However, dbx will also dump core on *startup*
sometimes.  (Haven't figured out how to avoid this though...)

Hope this helps...

-- 
--------------------------------------------------------------------------------
Stephen J. Sydorowicz                                 Azatar Computer Systems
REPLY TO: sydorow@bisco.kodak.com                     (716)726-5636
		Opinions expressed do not reflect those of my employer

tsang@ISI.COM (Kam C. Tsang) (06/05/91)

> To avoid the size problem, you can use "-PIC" in place of "-pic".
> Sparc cc defaults the global offset table to 8K (pic). This can be increased
> to allow 32 bit addresses via PIC.

We had tried -PIC, too.  That didn't help.  But thanks for the tip
anyway.

> Of course, using dbx on applications that link in shared libraries seems
> to be somewhat of a crap shoot. Typically, you can not look into the shared
> library (same as on SUN3). However, dbx will also dump core on *startup*
> sometimes.  (Haven't figured out how to avoid this though...)

May be it *is* crappy on the sun3, but on the sparc we developed xmath
where most parts were sharable libraries, and dbx works.  What's
needed is to build the object file that you want to debug with the -g
flag (instead of -pic or -PIC) and then link it into the executable.
No special changes to the library needed.  We have traced into both
our own libraries and X/Motif libraries with no problem.

-kam

db@sunbim.be (Danny Backx) (06/13/91)

Newsgroups: comp.windows.x.motif
References: <9106021754.AA25809@mview> <9106031823.AA01972@sirius>
Reply-To: db@whitney.UUCP (Danny Backx)
Distribution: inet
Organization: BIM Everberg Belgium

In article <9106031823.AA01972@sirius> tsang@ISI.COM (Kam C. Tsang) writes:
>> How hard is it to make SunOS shared libraries for Motif 1.1.2? 
>
>Building sharable library for motif is easy.  Just compile the motif
>files with the -pic flag and link the object files (ld -o libXm.so.1.1
>-assert pure-text *.o) .

Well, if you do just that, your libraries won't REALLY be shared. Motif will
write into some variables inside your "shared" library at run time, and as
a consequence, the initially shared library will be duplicated by SunOS.

You'll have to do better than that.

By the way, the split of the library in two is really not necessary. Use
-PIC on SPARC instead of -pic. It's in the manual.

	Danny Backx
	System Engineer, BIM Networks

E-Mail: db@sunbim.be    (or uunet!mcsun!ub4b!sunbim!db)

Telephone: +32(2)759.59.25	Fax : +32(2)759.47.95

Postal Mail :
	Danny Backx
	BIM
	Kwikstraat 4
	3078 Everberg
	Belgium