Subject: Re: Lesstif on pmax
To: Harald Bjoroy <harald@bitcon.no>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 03/26/1998 16:16:25
>Hi.
>
>I tried to use the pkgsrc tools to build lesstif for my pmax system.
>
>The build process stops somewhere in building clients/Motif-1.2/ stuff. 
>
>The makefile passes the argument -R:NONE to gcc (or cc). This option is 
>NOT documented in either cc or gcc manpages.
>
>Also, when I tried to manually edit the Makefiles causing the problems by 
>removing the option, it stopped on "cannot find file -lXm".


In summary: these problems are due to differences in how sharedlibs
work on a.out, and on ELF.  The Makefiles for various packages asume
that all NetBSD systems use a.out. They don't. Packages that build
shared libraries often lose, or are sub-optimally configured, on pmax
(and on newsmips) and on alphas.

The X11 setup for ELF shared libraries gets this right, so using imake
acutally seems to work better than configure.  For non-Imake-based
packages, every individual package needs to be fixed.

Sigh. Nobody likes this, but its the way things are.


>Well, then I tried to build the package using ./configure and make. This 
>didn't stop the same way, but it didn't compile the same files. The same 
>problem existed in the Makefiles, by removing it it seemed to work.
>
>So, after all compilation (seemingly successfully) was finished, i did 
>a(n equally successfull) make install, and I was almost happy.
>
>Now when I try to start mwm, it stops with the message "./mwm: can't load 
>library libXm.so'". The installation completed without problems, and 
>ldconfig lists amongst others "30 - ELF libXm.so.0.82 =..." (yes, the 
>full path to the lib).

This is a bug. No, Two bugs.  

First, on ELF, the linked-in library name is wrong.  On ELF, it should
not contain the library minor number.  (ie.., it should be libXm.so.0,
not libXm.so.0.82).  The last name is too specific.  Given how
NetBSD's ELF support is designed, your LessTiff applications will not
work at runtime against against any other minor version, like
libXm.so.0.83.

The second problem is that lessTiff should be creating symlinks
    libXm.so -> libXm.so.0
    libXm.so.8 -> libXm.so.0.82

both when it creates the shared library (for apps to link against)
and when it installs it (so it can be found at runtime).

Please send a problem report (PR) with the send-pr commmand, using the
pkg category.  Report the problem as an ELF problem with lesstif:
unless there's Alpha support already, it will break on ALphas in
exactly the same way.  (if there is, it should be set up to work on
mips, mipseb, and mipsel boxes too.)

>What now?

For now, you can work around the problem by creating the symlinks by
hand. Also double-check that your /etc/ld.so.conf lists /usr/X11R6/lib
and /usr/pkg/lib.


>BTW!! Gunnar Helliesen used pkgsrc on the same files, downloaded to 
>NetBSD/i386 and ran make. This compiled with a smile, and everything 
>seemed to work (maybe that machine runs on an older kernel); even the 
>-R:NONE option ran with no complaint.

Yes, that's expected: it's an ELF vs a.out problem.  I386 uses a.out,
so it works there. It's only mips and ALpha ports where this loses.
The package maintainers are probably quite rightly fed up with hearing
about it. ;)

>Either give me some hints, or just explain why this will not work.

Hope this is clearer.  I've sent a private copy to some package
maintainers.  If I've made any mistakes, I hope they'll correct them.